Does Java natively support html tags in text fields, or does the programmer
have to specify a string type in order for html tags to be treated as tags
rather than text? I ask this because I support an application at work that
allows me to enter text fields that will appear as modals to our users.
Today I discovered that I can use html tags to format the modal. For
instance I can use "<b>xxxx</b" to bold some text, "<center>xxxx</center>"
to center it, "<br>" for a line break, etc. I'm wondering if the programmer
has to specify some sort of string type in order for html tags to be treated
as tags by Java, instead of plain text. To put it another way, does the
programmer have to do something special for html tags to be treated as tags
by Java during runtime?
Jeff Higgins - 26 Jun 2007 01:48 GMT
> Does Java natively support html tags in text fields, or does the
> programmer have to specify a string type in order for html tags to be
[quoted text clipped - 7 lines]
> To put it another way, does the programmer have to do something special
> for html tags to be treated as tags by Java during runtime?
<http://java.sun.com/docs/books/tutorial/uiswing/components/html.html>
hiwa - 26 Jun 2007 01:50 GMT
> Does Java natively support html tags in text fields, or does the programmer
> have to specify a string type in order for html tags to be treated as tags
[quoted text clipped - 7 lines]
> programmer have to do something special for html tags to be treated as tags
> by Java during runtime?
See: http://java.sun.com/docs/books/tutorial/uiswing/components/html.html
JLabel, JButton, JToolTip, JEditorPane, JTextPane, JTabbedPane and
some of Menu/MeunItem classes support HTML tags.
William Oertell - 26 Jun 2007 06:15 GMT
>> Does Java natively support html tags in text fields, or does the
>> programmer
[quoted text clipped - 18 lines]
> JLabel, JButton, JToolTip, JEditorPane, JTextPane, JTabbedPane and
> some of Menu/MeunItem classes support HTML tags.
This isn't quite was I was talking about. I probably tried to be too
brief.
In our admi tool I can set up certain criteria that will cause a message
to be displayed to our techs when they start a job. Today I discovered that
I can include html tags when I set up that message. What I'm wondering is
whether or not Java normally treats html tags in a text field as tags or
just normal text depending on how the programmer tells Java to treat the
text field. IOW, does the programmer have to tell Java to treat all text in
the text field as just text, or does he have to tell Java to treat html tags
as tags?
hiwa - 26 Jun 2007 07:05 GMT
> >> Does Java natively support html tags in text fields, or does the
> >> programmer
[quoted text clipped - 30 lines]
> the text field as just text, or does he have to tell Java to treat html tags
> as tags?
No. And JTextField can't handle HTML tags as tags.
Roedy Green - 29 Jun 2007 14:37 GMT
On Mon, 25 Jun 2007 17:35:19 -0700, "William Oertell"
<oertell_NOT@pacbell.net> wrote, quoted or indirectly quoted someone
who said :
>Does Java natively support html tags in text fields, or does the programmer
>have to specify a string type in order for html tags to be treated as tags
>rather than text?
see
http://mindprod.com/jgloss/htmlrendering.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com