Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

TextLayout

  Asked By: Richard    Date: Jun 08    Category: Java    Views: 600
  

I am trying to write a bilingual editor (English and Farsi) with unicode.
I found that TextLayout could help me, but my first simple program in Applet form doesn't work.
you could find the paint section below. The program compiles without error and runs but I could not see anything on the applet page.
Please help


public void paint(Graphics g) {
Graphics2D g2;
g2 = (Graphics2D) g;

FontRenderContext frc = g2.getFontRenderContext();
Font f = new Font("Times",Font.BOLD, 24);
String s = new String("24 Point Times Bold");
TextLayout tl = new TextLayout(s, f, frc);
Dimension theSize= getSize();
g2.setColor(Color.green);
tl.draw(g2, theSize.width/30, theSize.height/2);
}

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Lily Brown     Answered On: Jun 08

I guess that you have used swing components in your applet

Textlayout is not a swing component by itself but you may have used some container swing in your applet.

As you may know netscape 4 and all versions of IE doesn’t support swing you should install java plugin or use

some complex techniques in order to use swing in your applets.

 
Didn't find what you were looking for? Find more on TextLayout Or get search suggestion and latest updates.

Related Topics:



Tagged:  

 
 
 

Related Post