-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
5.0, 6
-
x86
-
windows_xp
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);
}
}
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);
}
}
- duplicates
-
JDK-6240616 REGRESSION: Internal Frame window icons distorted in JDK1.5 using Windows XP
-
- Closed
-