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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 6u10
    • Fix Version/s: 6u12
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b02
    • CPU:
      x86
    • OS:
      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

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: