1. JInternalFrame with glass pane coderanch.com |
2. problem with internalframe glassPane coderanch.comI have an internal frame. It has some buttons. When I click on "Refresh" button,I have to prevent all mouse and keyboard actions on the internal frame. After I receive the response,I have to allow user actions on internal frame. I tried to achieve this by the following logic: * When user clicks on "Refresh", Component glassPane = intenalFrame.getGlassPane(); glassPane.addMouseListener(new MouseAdapter(){}); ... |
3. Why Glass Pane becomes visible when resizing JInternalFrame? coderanch.comimport java.awt.Graphics; import javax.swing.JDesktopPane; import javax.swing.JFrame; import javax.swing.JInternalFrame; import javax.swing.JPanel; public class RunMe extends JFrame { public RunMe() { this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setBounds(10, 10, 800, 600); JDesktopPane desktop = new JDesktopPane(); JInternalFrame testJIF = new JInternalFrame("test", true, true, true, true); testJIF.setBounds(10, 10, 100, 100); desktop.add(testJIF); testJIF.setVisible(true); this.add(desktop); this.setGlassPane(new MyGlassPane()); this.setVisible(true); } private class MyGlassPane extends JPanel { public MyGlassPane() { this.setOpaque(false); } @Override ... |