Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

HTML Tags in Text Fields

Thread view: 
William Oertell - 26 Jun 2007 01:35 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
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.