The spec ( http://java.sun.com/javase/6/docs/api/javax/swing/border/TitledBorder.html#getBaseline(java.awt.Component,%20int,%20int) ) says:
Throws:
IllegalArgumentException - if width or height is < 0
For example, the following lines of code will throw nothing:
new TitledBorder("123").getBaseline( new Button(), -1, 0 );
new TitledBorder("123").getBaseline( new Component() {}, Integer.MIN_VALUE, 0 );
|