-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
None
-
6
-
None
-
generic
-
windows_xp
1. Run Test on windows.
2. Press "dump properties" button
3. Change system preferences for the frame height
(Control Panel -> Display Properties -> Appearance tab -> Advanced button -> Active Title Bar)
4. Press "dump properties" button again.
5. Please note that the value for win.frame.captionButtonWidth is not updated.
6. Close and run the applicaton again.
7. Press "dump properties" button.
8. The values are correct now.
--- Test.java
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
JButton button = new JButton("dump properties");
button.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("win.frame.captionButtonWidth "
+ Toolkit.getDefaultToolkit().getDesktopProperty("win.frame.captionButtonWidth")
+ "\nwin.frame.captionButtonHeight "
+ Toolkit.getDefaultToolkit().getDesktopProperty("win.frame.captionButtonHeight"));
}
});
frame.add(button);
frame.pack();
frame.setVisible(true);
}
}
---
After running the test some more on XP it seems that changing system
preferences while the app is running causes
win.frame.captionButtonWidth to pick up the previous correct value.
Running test on Vista b5381 looks much worse. win.frame.captionButtonWidth does not seem to pick up the right value ever.
After the system preference is changed win.frame.captionButtonWidth returns the original value all the time even if the app is restarted.
2. Press "dump properties" button
3. Change system preferences for the frame height
(Control Panel -> Display Properties -> Appearance tab -> Advanced button -> Active Title Bar)
4. Press "dump properties" button again.
5. Please note that the value for win.frame.captionButtonWidth is not updated.
6. Close and run the applicaton again.
7. Press "dump properties" button.
8. The values are correct now.
--- Test.java
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
JButton button = new JButton("dump properties");
button.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("win.frame.captionButtonWidth "
+ Toolkit.getDefaultToolkit().getDesktopProperty("win.frame.captionButtonWidth")
+ "\nwin.frame.captionButtonHeight "
+ Toolkit.getDefaultToolkit().getDesktopProperty("win.frame.captionButtonHeight"));
}
});
frame.add(button);
frame.pack();
frame.setVisible(true);
}
}
---
After running the test some more on XP it seems that changing system
preferences while the app is running causes
win.frame.captionButtonWidth to pick up the previous correct value.
Running test on Vista b5381 looks much worse. win.frame.captionButtonWidth does not seem to pick up the right value ever.
After the system preference is changed win.frame.captionButtonWidth returns the original value all the time even if the app is restarted.
- relates to
-
JDK-4866279 JInternalFrame XP L&F title bar height not machine OS settings
-
- Resolved
-
-
JDK-6395091 WIn L&F: Buttons in JInternalFrame title bar are wrong shape on Vista
-
- Resolved
-