-
Bug
-
Resolution: Duplicate
-
P3
-
7
-
generic
-
generic
Platform: ALL
JDK: 6, 7
The following code illustrates the problem
---------------------------------------------------------------
import javax.swing.*;
public class MetalGetBaseLine {
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(
new javax.swing.plaf.metal.MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
new JComboBox().getBaseline(1, 3);
}
}
---------------------------------------------------------------
Ouput will be
Exception in thread "main" java.lang.IllegalArgumentException: Width and height must be >= 0
at javax.swing.plaf.ComponentUI.getBaseline(ComponentUI.java:292)
at javax.swing.plaf.basic.BasicComboBoxUI.getBaseline(BasicComboBoxUI.java:952)
at javax.swing.plaf.metal.MetalComboBoxUI.getBaseline(MetalComboBoxUI.java:149)
at javax.swing.JComponent.getBaseline(JComponent.java:2560)
at MetalGetBaseLine.main(MetalGetBaseLine.java:10)
JDK: 6, 7
The following code illustrates the problem
---------------------------------------------------------------
import javax.swing.*;
public class MetalGetBaseLine {
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(
new javax.swing.plaf.metal.MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
new JComboBox().getBaseline(1, 3);
}
}
---------------------------------------------------------------
Ouput will be
Exception in thread "main" java.lang.IllegalArgumentException: Width and height must be >= 0
at javax.swing.plaf.ComponentUI.getBaseline(ComponentUI.java:292)
at javax.swing.plaf.basic.BasicComboBoxUI.getBaseline(BasicComboBoxUI.java:952)
at javax.swing.plaf.metal.MetalComboBoxUI.getBaseline(MetalComboBoxUI.java:149)
at javax.swing.JComponent.getBaseline(JComponent.java:2560)
at MetalGetBaseLine.main(MetalGetBaseLine.java:10)
- duplicates
-
JDK-6632953 MetalComboBoxUI.getBaseline(JComponent, int, int) throws IAE for valid width/height
-
- Closed
-