This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java Font???  RSS feed

 
ali rafiq
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how does big size in font it is very very small font ??
import java.awt.*;
import javax.swing.*;
import java.io.*;
public class FontDemo1 extends JFrame {
int i = 50;
Font f;
JTextPane jt ;
FontDemo1()
{
super("TESTING FONT");
try{
InputStream is =new FileInputStream("ArabicKufi.ttf");
f=Font.createFont(Font.TRUETYPE_FONT,is);
is.close();
jt = new JTextPane();
jt.setFont(f);
Container con = getContentPane();
con.setLayout(new BorderLayout());
con.add(jt);
setBounds(200,200,200,200);
setVisible(true);
}
catch(Exception ee){
System.out.println(ee);
}
}
public static void main(String args[])
{
new FontDemo1();
}

}
 
Trung Tran
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ali,
just use jt.setFont(f.deriveFont(18f)); instead of jt.seFont(f); (18f is the size of the font you use).
Trung
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!