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

JInternalFrame title bar too large on WindowsClassicLookAndFeel or with -Dswing.noxp

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
      5.0
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      Compile and run the following test case on XP, using the property -Dswing.noxp. Notice how the internal frame title bar is too large and the icons are scaled. This looks wrong.

      The same problem does not happen if you switch XP to use the classic theme. This is a regression in 5.0.

      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class InternalFrameTest extends JFrame {

          public InternalFrameTest() {
              super("InternalFrameTest");
              
              JDesktopPane pane = new JDesktopPane();
              getContentPane().add(pane);
              JInternalFrame one = new JInternalFrame("One");
              JInternalFrame two = new JInternalFrame("Two");
              one.setVisible(true);
              one.getContentPane().add(new JTextField("This is One"));
              one.setResizable(true);
              one.setMaximizable(true);
              one.setBounds(100, 100, 150, 150);
              two.setVisible(true);
              two.getContentPane().add(new JTextField("This is Two"));
              two.setResizable(true);
              two.setMaximizable(true);
              two.setBounds(200, 200, 150, 150);
              pane.add(one);
              pane.add(two);
          }

          public static void main(String[] args) {
              try {
                  UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              } catch (Exception e) {
                  System.err.println(e);
                  System.exit(1);
              }
              
              InternalFrameTest test = new InternalFrameTest();
              test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              test.setSize(500, 400);
              
              Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
              test.setLocation((d.width - test.getWidth()) / 2, (d.height - test.getHeight()) / 2);
                      
              test.setVisible(true);
          }

      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jmarinacsunw Joshua Marinacci (Inactive)
              Reporter:
              shickeysunw Shannon Hickey (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: