Button text is not displaying properly in jre 1.6.0_22 when html tags are used in the textstring

Button text is not displaying properly in jre 1.6.0_22 when html tags are used in the textstring

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");

View Answers

November 24, 2010 at 2:57 PM

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


November 25, 2010 at 11:00 AM

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


November 25, 2010 at 11:01 AM

Hi,

Thanks for the responce.I got the solution.

ParserDelegator parserDelegator= new ParserDelegator();

Thanks









Related Tutorials/Questions & Answers:
Button text is not displaying properly in jre 1.6.0_22 when html tags are used in the textstring
Button text is not displaying properly in jre 1.6.0_22 when html tags are used in the textstring  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
Style Tags Used in HTML
Style Tags Used in HTML       The Style Tags in HTML is used to give specific format to the HTML page. The lists of Style Tags used in HTML page are as follow -  ADS
Advertisements
List the names of classes used to create button and text box in Java.
List the names of classes used to create button and text box in Java.  List the names of classes used to create button and text box in Java
Text Area in HTML
Text Area in HTML       Text  Area in HTML is used to write unlimited number of text... is used to create a text area in HTML page.  ADS_TO_REPLACE_2  
html tags
html tags  html tags   Java Struts HTML Tags
Radio Button in HTML
Radio Button in HTML is a type of input form that allows a user to select one button from a group of button. When a user clicks on a radio button, it becomes... is written by the text next to the radio button. It is not the value attribute
html button
html button  when i click the submit button the entered data will be displayed below the submit button please help me
Formatting text in HTML
Formatting text in HTML  What are the tags in HTML to format text
Action Submit Html
;  Action Submit in Html is used to submit a form, When a user... button. When an user enter some text in the text field User name) and clicks... the form doesn't confuse the button with the other fields. 2)value :This is used
HTML File Upload
; HTML File Upload is used to show the list of all file, when a user click on browse button A form in an HTML (web page) contain an input element... with a text box and the browse button. The method attribute used in form must be set
HTML
and how they are used in HTML. You will learn about the basic tags of a HTML... Text  Area in HTML is used to write unlimited number of text... in HTML Checkbox is used in html when a users want to select more than one
HTML Post Radio Button
HTML Post Radio Button       HTML Post attribute used in method, when a user is not able... Button.HTML page. The HTML page create a radio button, which allows the user
Struts 2 UI Tags
your action/value stack or from Data Tags. These tags are used to display the data on the HTML page. The UI tags are driven by templates and themes. Struts 2... Tags are further classified into: Form Tags: form - tag renders HTML
Button Size HTML
HTML Button Size can be changed according to programmer use. HTML button... of a HTML button. First we create a HTML page. Then we display a HTML Button..., color of the text as well. <html> <head> <title>Button
PHP HTML Form Submit Button
. The Submit button in Html is used to submit form data to the page mentioned...Topic : HTML FORM SUBMIT BUTTON Part - 4 The another part which is important... the information inputted by the user we just need a Html Submit button. <input
HTML Button Size
HTML Button Size       Button in HTML is used to submit HTML page. Understand with Example ADS_TO_REPLACE_1 The Tutorial illustrate an example from HTML Button size. In this Tutorial
HTML text tag
HTML text tag   How to wrap text in HTML code without changing the text format
Javascript get Date And Selected Option Text
the date and the selected option text into HTML. ExampleADS_TO_REPLACE_1 Here I am... the html tags for taking date and select and option tags for providing... will get the output as follows : When you will click on submit button
Using Core Tags, Html Tags
: These tags represent html components like text fields, buttons, form. Html tags can...Using Core Tags, Html Tags   ..._TO_REPLACE_1 2. JSF Html Tags Library Even a very simple page uses tags from both
JSP JSTL c:when tag
the jstl when tag in jsp. Basically, the choose, when, and otherwise tags can be used to construct an if statement. The choose tag embedded the subtag when which evaluates the test condition. If none of the test conditions of when tags
Displaying java.util.Calendar using JSP struts tags
Displaying java.util.Calendar using JSP struts tags  My question is in regard to displaying a date whose source is java.util.Calendar...; where s refers to: <%@ taglib prefix="s" uri="/struts-tags" %>
JSF HTML Tag Reference
; In this section, you will learn more about html tags provided in JSF. JSF HTML tags are used for design the page by using server side code. This tag.../jsf/htmlADS_TO_REPLACE_1 This is the uri for the JSF html tags. And for the prefix
text formatting tag in HTML
text formatting tag in HTML  What are the various text formatting tag in HTML
facebook login button html
facebook login button html  facebook login button html i have a facebook login button code ..but not sure how to use it. Can any one please explain? Here is the facebook login button code in html <fb:login-button
Hide text by clicking button
: hide and show .The "hide " button is used to hide text and "show button " is used to show text. These actions are fired when "...Hide text by clicking button In this tutorial, we will discuss about hide/show
struts html tags - Struts
struts html tags  creating horizontal scroll-bar in struts HTML
HTML - Text Size
HTML - Text Size Description : The size is a attributes of font tag of html. It specifies the size of text. Syntax: <font size="4"> Bharat singh</font> Code : <!DOCTYPE html PUBLIC "-//W3C//DTD
Generic Tags
Generic Tags When pages are being rendered Generic Tags control the execution flow. Struts 2 Generic tags are also used for data extraction. Struts 2 Tags... tags. Control Tags: if: tag could be used by itself else-if: tag
html text linking
html text linking  How to link a text in HTM?   Link text for example... <a href="http://www.roseindia.net/">RoseIndia Tutorials</a>
Version of commons-jelly-tags-html>commons-jelly-tags-html dependency
List of Version of commons-jelly-tags-html>commons-jelly-tags-html dependency
HTML file upload example
file" option. We have also used Reset button and Save button. We have used Reset button that resets all fields to blank and we have used Save button... "Text Field", Reset button and last one is Save button. ExampleADS
Change Button Text iPhone
Change Button Text iPhone In a UINavigationController based application, most.... But luckily we can change the button text in iPhone app. Find the given code that will change the text on the back button. You can also give it a Title of your
Text Field in HTML
Text Field in HTML       The Text Field in HTML are one line areas, which enable the user... field in HTML page. <form action> is used to specify  the page
Comparing XML with HTML
are not predefined. User must "invent" his tags. The tags used to mark... of HTML documents can only use tags that are defined in the HTML standard (like... and document structure.ADS_TO_REPLACE_3 XML Tags are Case Sensitive Unlike HTML, XML
Struts HTML Tags
with the provided content as the button text.  <html:reset>... with the provided content as the button text.  <html:errors/>... Struts HTML Tags      
Displaying html code in pdf with itext - Java Beginners
Displaying html code in pdf with itext   Hi , I am geeting data which was enterd from fck editor. same data is stored... the pdf . i am using HTMLWorker to convert the html data . but styles
Radio Buttons in HTML
;  The Radio Button in HTML are type of input form, which allows... must specify the name of radio button properly.  Understand with ExampleADS... element in  html page, when it is clicked. The  Output result is sent
HTML Login Page Code
. In this example, we have displayed one text field, Password, Reset button and Login button. We have used Reset button that resets all fields to blank. We have used... are used. Text field is used to accept username and password text field
html code for student registration form
, radio button, Reset button and Submit Form button. We have used Reset button... it with JavaScript. JavaScript is used to validate the HTML page in web...html code for student registration form Here is an example of html code
HTML Button onclick get ID of Button
HTML Button onclick get ID of Button  How i can get the ID of HTML Button on click?? I wanted to do it using JavaScript function. Thanks
centre text html
centre text html  centre text HTML - How to centre any field in HTML Page   <!DOCTYPE html> <html lang="de"> <head>...; html, body { height: 100%; margin: 0; padding
Create an HTML file AddCookies.html which contains four text boxes
Create an HTML file AddCookies.html which contains four text boxes  Create an HTML file AddCookies.html which contains four text boxes .When user enters the values in these text boxes and press the submit button, the values
Struts + HTML:Button not workin - Struts
Struts + HTML:Button not workin  Hi, I am new to struts. So pls... displays "null"; I have defined button_clicked in bean class. I thought when i... needs to be corrected. OR Should i use 2 HTML TAG BUTTON's here instead of 2
how to remove spell check in flex when button is clicked
how to remove spell check in flex when button is clicked  how to remove spell check when button is clicked in rich text editor control
problen in displaying the text and image in gallery using Android
problen in displaying the text and image in gallery using Android   public void onCreate(Bundle savedInstanceState) { super.onCreate...(), "You have selected picture " + (position+1) + " TEXT
create a button in html
create a button in html  How do I create a button which acts like a link
Artifacts of commons-jelly-tags-html
List of Artifacts of commons-jelly-tags-html maven depenency
Use of Text Field
Use of Text Field, Text box, Text Area, Checkbox,Dropdownlist and Radio Button in HTML      ..._TO_REPLACE_3 Radio button: Radiobutton is used to allow the user to select one
how html tags are extracted using java?
how html tags are extracted using java?  I would like to need the java code for extracting html tags
how html tags are extracted using java?
how html tags are extracted using java?  I would like to need the java code for extracting html tags

Ads