Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P3
-
Resolution: Fixed
-
Affects Version/s: 6u10
-
Fix Version/s: 6u14
-
Component/s: client-libs
-
Subcomponent:
-
Introduced In Version:
-
Resolved In Build:b04
-
CPU:x86
-
OS:windows_xp
-
Verification:Verified
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2193972 | 7 | Alexander Potochkin | P3 | Closed | Fixed | b100 |
Description
FULL PRODUCT VERSION :
java version "1.6.0_10-rc"
Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Unlike other Look & Feels, Nimbus leaves space for non-visible items in a JToolBar.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expect the "Test" and "Test3" buttons to be adjacent.
ACTUAL -
"Test" and "Test3" buttons are separated by space allocated for non-visible "Test2" button.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class NimbusToolBarBug extends JFrame {
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(
"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
}
catch (Exception e) {
}
JDialog dg = new JDialog();
JToolBar tb = new JToolBar();
tb.add(new JButton("Test"));
JButton b2 = new JButton("Test2");
b2.setVisible(false);
tb.add(b2);
tb.add(new JButton("Test3"));
dg.add(tb);
dg.pack();
dg.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
For all items added to the JToolBar which might ever be non-visible, use item subclasses for which the preferred size is (0,0) when the item is not visible.
java version "1.6.0_10-rc"
Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Unlike other Look & Feels, Nimbus leaves space for non-visible items in a JToolBar.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expect the "Test" and "Test3" buttons to be adjacent.
ACTUAL -
"Test" and "Test3" buttons are separated by space allocated for non-visible "Test2" button.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class NimbusToolBarBug extends JFrame {
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(
"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
}
catch (Exception e) {
}
JDialog dg = new JDialog();
JToolBar tb = new JToolBar();
tb.add(new JButton("Test"));
JButton b2 = new JButton("Test2");
b2.setVisible(false);
tb.add(b2);
tb.add(new JButton("Test3"));
dg.add(tb);
dg.pack();
dg.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
For all items added to the JToolBar which might ever be non-visible, use item subclasses for which the preferred size is (0,0) when the item is not visible.
Attachments
Issue Links
- backported by
-
JDK-2193972 JToolBar leaves space for non-visible items under Nimbus L&F
-
- Closed
-
- relates to
-
JDK-7037141 Swing interactive tests for JMenu and JPopupMenu separator functionality fail with GTK L&F
-
- Open
-