JTextPane setFont doesnt work
807588Aug 29 2006 — edited Mar 26 2009Hi All
I have set the font of a jtextpane by using the following code:
this.text = new JTextPane( new DefaultStyledDocument() );
this.text.setBorder( new EmptyBorder( 0, 0, 0, 0 ) );
this.text.setText( "" );
this.text.setSize( 600, 300 );
this.text.setFont( new Font( "Monospaced", Font.PLAIN, 10 ));
I need to set the font to Monospaced to ensure all the characters are equally spaced. Whatever I do nothing and I mean nothing works. I have tried other font types and they dont work.
It seams like a bug but I could be doing something wrong.
Can anybody help me find a solution.