• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in Font

 
Iftikhar Arain
Ranch Hand
Posts: 95
Flex Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.awt.*;
public class MyFont {
public MyFont() {
TextArea ta = new TextArea(4,5);
ta.setFont(new Font("Gara",Font.BOLD,35));
ta.setText("ASDFASDFASDF");
Frame f = new Frame();
f.add(ta);
f.setSize(300,300);
f.setVisible(true);
}
//Main method
public static void main(String[] args) {
new MyFont();
}
}
Please tell me why the above code is not changing the font.I am using Jbuilder 3.0 .Is there any problem is Jbuilder. But I have also seen the output on the DOS.It just changing the style and size of only default font.
Please tell the problem.
Thanks in Advanced.
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use a JTextPane or JEditorPane. JTextArea doesn't display font styles.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!