日期:2014-05-20  浏览次数:20612 次

求助,,找了很多都没人回答,求真正的大神


这个JFrame怎么实现的,去掉最大化最小化关闭按钮,,别和我说

studentManagerUi.setUndecorated(true); //去掉边框,很有意思的功能,但是用户体验很差studentManagerUi.getRootPane().setWindowDecorationStyle(JRootPane.ERROR_DIALOG);

这个界面太难看了,根本不是我想问的!!

------解决方案--------------------
失败了,我的想法是
从jframe开始,遍历其所有的子元素,然后,从打印的效果看结果,看能不能找到那三个玩意,失败了,代码给你,你试试这种路通不通。

public Test() {
        super("test");
        setSize(300, 400);
        setResizable(false);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
        list(this);
    }

    public void list(Component comp) {
        if (comp instanceof Container) {
            System.out.println("container: " + comp);
            Component[] comps = ((Container) comp).getComponents();
            for (int i = 0, len = comps.length; i < len; i++) {
                list(comps[i]);
            }
        } else {
            System.out.println("other");
        }
    }