protected MutableAttributeSet set;
public FontDemo1()
{
super("TESTING FONT");
try{
InputStream is =new FileInputStream("urdu.ttf");
f=Font.createFont(Font.TRUETYPE_FONT,is);
is.close();
jt = new JTextPane();
set = new SimpleAttributeSet();
jt.setFont(f.deriveFont(25f));
SwingConstants.setAlignment(set, SwingConstants.ALIGN_RIGHT);
it a giving two error its
FontDemo1.java:33: cannot resolve symbol
symbol : variable ALIGN_RIGHT
location: interface javax.swing.SwingConstants
SwingConstants.setAlignment(set, SwingConstants.ALIGN_RIGHT);
^
1 error
if i change the veriable then its gives me
another error
FontDemo1.java:33: cannot resolve symbol
symbol : method setAlignment (javax.swing.text.MutableAttributeSet,int)
location: interface javax.swing.SwingConstants
SwingConstants.setAlignment(set, SwingConstants.RIGHT);
^
1 error
if i change the interface to StyleConstants
StyleConstants.setAlignment(set,StyleConstants.ALIGN_RIGHT);
it does not give any error but . my create font change into defualt font of
java..
i got lots of site to see this topic but i have a simple programe i need i simple example.. atually my font start from the right side.