Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6726866

Repainting artifacts when resizing or dragging JInternalFrames in non-opaque toplevel

    XMLWordPrintable

Details

    • b02
    • x86
    • windows_xp

    Backports

      Description

        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();
              }
            });
          }
        }

        Attachments

          Issue Links

            Activity

              People

                alexp Alexander Potochkin (Inactive)
                tdv Dmitri Trembovetski (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: