• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic