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 / August 2007

Tip: Looking for answers? Try searching our database.

set rgb color  (Java)

Thread view: 
Eitan M - 09 Aug 2007 15:43 GMT
Hello.
How can I in Java :
set the rgb color (background color - what command) of JTextArea, i.e.
(I want light-yellow, i.e).

Thanks :)
kcwong - 09 Aug 2007 16:47 GMT
> Hello.
> How can I in Java :
> set the rgb color (background color - what command) of JTextArea, i.e.
> (I want light-yellow, i.e).
>
> Thanks :)

The Java API documentation would be a nice place to start looking.

http://java.sun.com/javase/6/docs/api/javax/swing/JTextArea.html

Load the page, then bring up the search function of your browser, and
search for the text "background".
Eitan M - 09 Aug 2007 19:33 GMT
there is setBackground - that's I know,
but I am looking for the function which does the conversion of RGB -> color.

Thanks :)

>> Hello.
>> How can I in Java :
[quoted text clipped - 9 lines]
> Load the page, then bring up the search function of your browser, and
> search for the text "background".
Roedy Green - 09 Aug 2007 19:43 GMT
>but I am looking for the function which does the conversion of RGB -> color.
setBackground wants a Color object. See the docs on the Color class
for the various ways to create one.  See
http://mindprod.com/jgloss/colour.html
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Thomas Fritsch - 09 Aug 2007 21:57 GMT
> there is setBackground - that's I know,
> but I am looking for the function which does the conversion of RGB -> color.
The Color constructors do this conversion, for example:
  Color background = new Color(255, 255, 128);
  yourTextArea.setBackground(background);

Signature

Thomas

Roedy Green - 09 Aug 2007 19:40 GMT
>How can I in Java :
>set the rgb color (background color - what command) of JTextArea, i.e.
>(I want light-yellow, i.e).
see http://mindprod.com/jgloss/jtextarea.html
for  sample code using the common methods.
Signature

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



©2009 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.