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 / GUI / June 2006

Tip: Looking for answers? Try searching our database.

Can I use different font-styles within the same TextArea?

Thread view: 
Christian - 23 Jun 2006 11:41 GMT
Hi folks!

I just wondered if I can have different colors for the text within the
same TextArea. Drawing a string offers the opportunity to use differen
colors for the font one draws. I just tried to display some lines of
green and some lines of red text within a TextArea and this seems to be
a complete different thing. So I'd like to ask the ones that know if
that is possible in general. It does not seem so. Am I right or do I
just not know how to cope with TextAreas?

Christian
andrewthommo@gmail.com - 23 Jun 2006 13:17 GMT
..
> I just wondered if I can have different colors for the text within the
> same TextArea.

No.  Why are you using AWT components?

> ..So I'd like to ask the ones that know if
> that is possible in general.

Sure. In a JEditorPane or JTextPane.
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JEditorPane.html

Andrew T.


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.