And here is the stackTrace :
false
font : null
java.lang.NullPointerException
at java.util.Hashtable.get(Unknown Source)
at java.awt.Component.getFontMetrics(Unknown Source)
at appli.MultiLineTable.getRowHeight(MultiLineTable.java:193)
...
Does Anybody has an idea why I can't set the font of my JTable.
Thanks.
Pierre.
> I'm trying to set font of a JTable but the method setFont(Font)
> doesn't seems to work in my case.
Your guess is wrong..
> Here is my code :
> setFont(Font.getFont("Arial"));
Try this and note the two results..
<sscce>
import java.awt.Font;
public class FontTest {
public static void main(String args[]) {
Font font1 = new Font("Arial", 20, 20),
font2 = Font.getFont("Arial");
System.out.println( "Font1 is: " + font1 );
System.out.println( "Font2 is: " + font2 );
}
}
</sscce>
HTH
--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology