1222N/A/* @test
1222N/A @bug 6726866
1222N/A @summary Repainting artifacts when resizing or dragging JInternalFrames in non-opaque toplevel
1222N/A @author Alexander Potochkin
1222N/A @run applet/manual=yesno bug6726866.html
1222N/A*/
1222N/A
1222N/Aimport javax.swing.*;
1222N/Aimport java.awt.*;
1222N/Aimport java.lang.reflect.Method;
1222N/A
1222N/Apublic class bug6726866 extends JApplet {
1222N/A
1222N/A public void init() {
1222N/A JFrame frame = new JFrame("bug6726866");
1222N/A frame.setUndecorated(true);
1222N/A setWindowNonOpaque(frame);
1222N/A
1222N/A JDesktopPane desktop = new JDesktopPane();
1222N/A desktop.setBackground(Color.GREEN);
1222N/A JInternalFrame iFrame = new JInternalFrame("Test", true, true, true, true);
1222N/A iFrame.add(new JLabel("internal Frame"));
1222N/A iFrame.setBounds(10, 10, 300, 200);
1222N/A iFrame.setVisible(true);
1222N/A desktop.add(iFrame);
1222N/A frame.add(desktop);
1222N/A
1222N/A frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
1222N/A frame.setSize(400, 400);
1222N/A frame.setVisible(true);
1222N/A frame.toFront();
1222N/A }
1222N/A
1222N/A private void setWindowNonOpaque(Window w) {
1222N/A try {
1222N/A Class<?> c = Class.forName("com.sun.awt.AWTUtilities");
1222N/A Method m = c.getMethod("setWindowOpaque", Window.class, boolean.class);
1222N/A m.invoke(null, w, false);
1222N/A }
1222N/A catch (Exception e) {
1222N/A e.printStackTrace();
1222N/A }
1222N/A }
1222N/A}