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

REGRESSION: JInternalFrame within JInternalFrame Drawing Problems

XMLWordPrintable

    • b46
    • 6
    • b15
    • sparc
    • solaris_10
    • Verified

        FULL PRODUCT VERSION :
        Java(TM) SE Runtime Environment (build 1.6.0-rc-b94)

        A DESCRIPTION OF THE PROBLEM :
        If a JDesktopPane is filled with JInternalFrames and the JInternalFrames themselves hold a JDesktopPane with JInternalFrames two things appear to be occuring when a another JInternalFrame is dragged in front of the nested JInternalFrames and the user selects a nested one:
        1. Drawing of the nested JInternalFrame contains the dragged over JInternalFrame
        2. The dragged over JInternalFrame does not go to the bottom of the frames

        This appears to not be the case in Java 5

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Run this test:
        import javax.swing.*;
        import java.awt.event.*;
        import java.awt.*;
        import java.io.*;

        public class JInternalFrameInJInternalFrame implements Runnable{

            JFrame jf;
            public void run(){
                jf = new JFrame();
                JDesktopPane jdp = new JDesktopPane();
                jf.add(jdp);
                JInternalFrame one = new JInternalFrame();
                one.setMaximizable(true);
                one.add(new JTextArea());
                one.setSize(200,200);
                jdp.add(one);

                JInternalFrame two = new JInternalFrame();
                two.setResizable(true);
                JDesktopPane jdp2 = new JDesktopPane();
                two.add(jdp2);
                two.setMaximizable(true);
                two.setClosable(true);
                two.setIconifiable(true);
                two.setSize(300,300);
                JInternalFrame three = new JInternalFrame();
                three.add(new JTextField(15));
                three.setMaximizable(true);
                three.setSize(200,200);
                JInternalFrame three_2 = new JInternalFrame();
                three_2.add(new JLabel("Not docking"));
                three_2.setMaximizable(true);
                three_2.setSize(200,200);
                jdp2.add(three_2);
                jdp2.add(three);
                three.setVisible(true);
                three_2.setVisible(true);
                jdp.add(two);
                one.setVisible(true);
                two.setVisible(true);
                JInternalFrame four = new JInternalFrame();
                four.add(new JButton("Not Docking"));
                four.setMaximizable(true);
                four.setSize(200,200);
                jdp.add(four);
                four.setVisible(true);
                jf.setSize(600,600);
                jf.setLocationRelativeTo(null);
                jf.setVisible(true);

            }

            public static void main(String[] args){
                if(args.length > 0){
        try{
        int i = Integer.parseInt(args[0]);
                        if(i == 0) UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                        else if(i == 1) UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");

                    }catch(Exception x){}

                }
                SwingUtilities.invokeLater(new JInternalFrameInJInternalFrame());

            }


        }
        ---------
        Drag a JIF over a JIF with nested JIFs. Select one of the nested JIFS and drag it around. You will see that it isn't drawn right, nor is it the dragged over frame moved below the frames.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The nested JIFs mother frame to be the top frame, the dragged over frame to go below it and the nested JIFs to be drawn right.
        ACTUAL -
        1. JIF's parent isn't the top JIF
        2. JIF isn't drawn right
        3. Dragged over JIF isn't drawn right as well if dragged afterwords

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import javax.swing.*;
        import java.awt.event.*;
        import java.awt.*;
        import java.io.*;

        public class JInternalFrameInJInternalFrame implements Runnable{

            JFrame jf;
            public void run(){
                jf = new JFrame();
                JDesktopPane jdp = new JDesktopPane();
                jf.add(jdp);
                JInternalFrame one = new JInternalFrame();
                one.setMaximizable(true);
                one.add(new JTextArea());
                one.setSize(200,200);
                jdp.add(one);

                JInternalFrame two = new JInternalFrame();
                two.setResizable(true);
                JDesktopPane jdp2 = new JDesktopPane();
                two.add(jdp2);
                two.setMaximizable(true);
                two.setClosable(true);
                two.setIconifiable(true);
                two.setSize(300,300);
                JInternalFrame three = new JInternalFrame();
                three.add(new JTextField(15));
                three.setMaximizable(true);
                three.setSize(200,200);
                JInternalFrame three_2 = new JInternalFrame();
                three_2.add(new JLabel("Not docking"));
                three_2.setMaximizable(true);
                three_2.setSize(200,200);
                jdp2.add(three_2);
                jdp2.add(three);
                three.setVisible(true);
                three_2.setVisible(true);
                jdp.add(two);
                one.setVisible(true);
                two.setVisible(true);
                JInternalFrame four = new JInternalFrame();
                four.add(new JButton("Not Docking"));
                four.setMaximizable(true);
                four.setSize(200,200);
                jdp.add(four);
                four.setVisible(true);
                jf.setSize(600,600);
                jf.setLocationRelativeTo(null);
                jf.setVisible(true);

            }

            public static void main(String[] args){
                if(args.length > 0){
        try{
        int i = Integer.parseInt(args[0]);
                        if(i == 0) UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                        else if(i == 1) UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");

                    }catch(Exception x){}

                }
                SwingUtilities.invokeLater(new JInternalFrameInJInternalFrame());

            }


        }
        ---------- END SOURCE ----------

        Release Regression From : 5.0
        The above release value was the last known release where this
        bug was not reproducible. Since then there has been a regression.

              mbronsonsunw Mike Bronson (Inactive)
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: