首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Glasspane前显示InternalFrame

在Glasspane前显示InternalFrame
EN

Stack Overflow用户
提问于 2020-12-21 15:35:54
回答 1查看 37关注 0票数 1

我希望在GlassPane前面显示一个InternalFrame。在我的程序中,用户应该能够点击文件->设置,并显示一个InternalFrame。背景中的所有内容都应该用GlassPane覆盖。有没有人有主意?

代码语言:javascript
复制
m21.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
        Settings settings = new Settings();

        //get the InternalFrame
        settings.getFrame().setBounds(100,100,getWidth()-200, getHeight()-200);
        settings.getFrame().toFront();

        setGlassPane(new Glass());
        getGlassPane().setVisible(true);

        //get the InternalFrame
        getLayeredPane().add(settings.getFrame(), BorderLayout.NORTH);
        getLayeredPane().moveToFront(settings.getFrame());

        repaint();
    }
});

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-21 15:43:06

glass pane的意义在于领先于其他一切:

但是,您可以将任何构件设置为玻璃窗格。我的建议是将设置框中的内容作为玻璃窗格进行推送。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65389011

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档