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 / September 2006

Tip: Looking for answers? Try searching our database.

JAVA TEXT AREA GUI problem

Thread view: 
KL - 24 Sep 2006 05:07 GMT
Is anybody know how to create a JAVA TEXT AREA with multiple color text

in each line?
(the setForegound seems can be used for single color for the whole
text.)
Thanks a lot.
Andrew Thompson - 24 Sep 2006 05:20 GMT
> Is anybody know how to create a JAVA TEXT AREA

That is one of ..
- Java text area (generic)
- Java TextArea (AWT)
- Java JTextArea (Swing)
..so please be specific and refrain from SHOUTING at us.

>...with multiple color text
>
> in each line?

Many Swing components are 'HTML aware',
but not JTextArea's ..  E.G.

<sscce>
import javax.swing.*;

class HTMLTextArea {
 public static void main(String[] args) {
   String content =
     "<html><body><h1>Ha!</h1><p style='color: red'>Blah...";
   JTextArea ta = new JTextArea(content);
   JOptionPane.showMessageDialog(null, ta);
   JLabel l = new JLabel(content);
   JOptionPane.showMessageDialog(null, l);
 }
}
<sscce>

Andrew T.
KL - 24 Sep 2006 05:39 GMT
Thank You.
> > Is anybody know how to create a JAVA TEXT AREA
>
[quoted text clipped - 27 lines]
>
> Andrew T.
KL - 24 Sep 2006 05:39 GMT
Thank You.
> > Is anybody know how to create a JAVA TEXT AREA
>
[quoted text clipped - 27 lines]
>
> Andrew T.
kshafi@gmail.com - 25 Sep 2006 14:33 GMT
One work around would be to create multiple "JAVA TEXT AREA"  (one for
each line) and color code them as needed.


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.