i'm a new a java beginner user...
i'm trying to create a JButton that it contain x^2 , i want the number 2 to appear like a superscript .
also i have a text field , and i want to display a text with a multiple color in the same text field ....
so how can i do this ????
You can try to use HTML mark up in the text used as the button's label.
10 for the reply
i'm using netbeans 6.5 , i've tryed to edite the text of the JButoon , and i've entred something like <b>my text</b> but it doesen't work .
the display is <b>my text</b>.
also i've tryed to ented <html><body><b>my text</b> , but also it doesn't work .
This code works for me
String str = "<html><font color=green>Hello<sup>2</sup></font></html>";
JButton button = new JButton(str);
ok , now it's ok .....
thank you very much ,
The JButoon is ok, but the JTextfield won't to be formatted ....
The problem was with the body tag <body>.....
i have another question , can i use css in my application form's so it will be faster to change the design of my application after a time ????
I know this possibilty is in QT-jambi but not in Swing :rolleyes:.
Originally Posted by wassim
thanks for the reply,
i think i have to download a additional packages or plug ins to the netbeans to use QT-jambi !!!!