Article View: borland.public.jbuilder.java.swing
Article #10538Re: Multiline text on JButtons?
From: Lois Neo
Date: Mon, 06 Sep 1999 00:00
Date: Mon, 06 Sep 1999 00:00
40 lines
2156 bytes
2156 bytes
I've tried, but can't work still. Even the HtmlDemo.java downloaded from the website mentioned also can't work. I wonder if its the version of Swing that's giving the problem? What is the version of Swing in JDK1.2.1 or JBuilder3? -- Thanks for any help given Lois > > ======================= > HTML Text in Components > ======================= > > Although this release is largely a bug fix update, it adds one > new feature of note: many components can now contain HTML text. > These components include instances of JButton and JLabel (whose > HTML support was added in Swing 1.1.1 Beta 1), JMenuItem, JMenu, > JCheckBoxMenuItem, JRadioButtonMenuItem, JTabbedPane, and > JToolTip (whose HTML support was added in Swing 1.1.1 Beta 2) -- > but not yet JCheckBox or JRadioButton. > > If the text property of an HTML-supporting component is a string that > begins with "<html>", the rest of the string is used to create a > lightweight HTML docuemnt and the text is rendered by the full > Swing styled-text engine. For example, the following code creates > a JLabel that displays multiple lines of text in different fonts > and colors: > > String htmlText = > "<html>A JLabel with <i>various <font color=blue>text styles<br>" + > "And a new line!</font></i>"; > JLabel myLabel = new JLabel(htmlText); > > Look for more information about this feature in The Java Tutorial, in > how-to pages such as the label page: > > http://java.sun.com/docs/books/tutorial/uiswing/components/label.html >
Technical Details
Message-ID:
<7qv476$or55@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7qg0re$8316@forums.borland.com> <37CC51AE.BF0F0A96@cassiopeia.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,87e3da07743645f8 X-Google-Attributes: gid111d45,public From: "Lois Neo" <slneo@cybergal.com> Subject: Re: Multiline text on JButtons? Date: 1999/09/06 Message-ID: <7qv476$or55@forums.borland.com> X-Deja-AN: 521498199 References: <7qg0re$8316@forums.borland.com> <37CC51AE.BF0F0A96@cassiopeia.de> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Reply-To: "Lois Neo" <slneo@cybergal.com> Newsgroups: borland.public.jbuilder.java.swing