Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

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

Ads

 
 

Share on Google+Share on Google+

Mini Tej
Button text is not displaying properly in jre 1.6.0_22 when html tags are used in the textstring
3 Answer(s)      6 years and 8 months ago
Posted in : Java Beginners

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

Ads
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


Ads









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 -    
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... in HTML.In this example, the code elaborate you to create text area in HTML page
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... by the text next to the radio button. It is not the value attribute. Use of a Radio
html button
html button  when i click the submit button the entered data will be displayed below the submit button please help me
html tags
html tags  html tags   Java Struts HTML Tags
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... a code, which helps you in creating a textfield and a submit button. When an user enter some text in the text field User name) and clicks the submit button
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... and the browse button. The method attribute used in form must be set to post. when
HTML Post Radio Button
HTML Post Radio Button       HTML Post attribute used in method, when a user is not able.... The HTML page create a radio button, which allows the user to select any one
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... of the text as well. <html> <head> <title>Button Size<
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
PHP HTML Form Submit Button
Topic : HTML FORM SUBMIT BUTTON Part - 4 The another part which is important... in Html is used to submit form data to the page mentioned in the ACTION attribute... we just need a Html Submit button. <input type="submit" name
HTML Button Size
HTML Button Size       Button in HTML is used to submit HTML page. Understand with Example The Tutorial illustrate an example from HTML Button size. In this Tutorial we create
HTML text tag
HTML text tag   How to wrap text in HTML code without changing the text format
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
HTML
Post Radio Button HTML Post attribute used in method, when a user...; Text Area in HTML Text  Area in HTML is used to write... properly.    Password Field in HTML When
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
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
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
text formatting tag in HTML
text formatting tag in HTML  What are the various text formatting tag in HTML
Comparing XML with HTML
"invent" his tags. The tags used to mark up HTML documents... displays and focuses on how data looks. HTML is all about displaying... tags that are defined in the HTML standard (like <p>, <h1>, etc
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" %>
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>
Javascript get Date And Selected Option Text
the date and the selected option text into HTML. Example Here I am giving a simple... the value from html form using id. And at html page I will use the html tags... : When you will click on submit button then the output will be as follows
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
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
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... classified into: Form Tags: form - tag renders HTML an input form
Text Field in HTML
Text Field in HTML       The Text Field in HTML are one line areas, which enable the user... Text Field in HTML.In this Tutorial, the code create a text field in HTML page