
using html string to jbutton text is not working in Java 1.6.0_22 when browser is using the existing java console
this.setText(""+value+"" );
print("code sample");

Hi Friend,
Try the following code:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class ButtonExample extends JButton{
ButtonExample(){
JFrame f=new JFrame();
f.setLayout(null);
String st="<html><b><font color='red'>Hello</font></b></html>";
this.setText(st);
f.add(this);
this.setBounds(10,10,100,20);
f.setVisible(true);
f.setSize(300,100);
}
public static void main(String[] args){
new ButtonExample();
}
}
Thanks

Hi,
Thanks for the reply.I got the solution for my pbm.
ParserDelegator parserDelegator= new ParserDelegator();
Adding this in my code solved the problem.
Thanks

Hi,
Thanks for the responce.I got the solution.
ParserDelegator parserDelegator= new ParserDelegator();
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.