• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Problem in Font

 
Ranch Hand
Posts: 95
Spring Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
use a JTextPane or JEditorPane. JTextArea doesn't display font styles.
 
What? What, what, what? What what tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic