Relates :
|
|
Relates :
|
|
Relates :
|
As discussed in this thread: http://forums.java.net/jive/thread.jspa?threadID=43881&tstart=0 The following test case shows rendering artifacts in non-opaque toplevels when JInternalFrames are used: public class NonOpaqueWindowTest2 extends JFrame { public NonOpaqueWindowTest2() { super(); setWindowNonOpaque(this); JDesktopPane desktop = new JDesktopPane(); JInternalFrame iFrame = new JInternalFrame("Test", true, true, true, true); iFrame.add(new JLabel("internal Frame")); iFrame.setBounds(10, 10, 300, 200); iFrame.setVisible(true); desktop.add(iFrame); getContentPane().add(desktop); setTitle(getClass().getSimpleName()); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(400, 400); setLocationRelativeTo(null); setVisible(true); } private void setWindowNonOpaque(Window w) { try { Class<?> c = Class.forName("com.sun.awt.AWTUtilities"); Method m = c.getMethod("setWindowOpaque", Window.class, boolean.class); m.invoke(null, w, false); } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) throws Exception { EventQueue.invokeLater(new Runnable(){ public void run() { JFrame.setDefaultLookAndFeelDecorated(true); new NonOpaqueWindowTest2(); } }); } }
|