Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    0

    Default figuring out the current colour of my appelet

    Hi!

    I'm new to Java and I have done some regular programming as well as with applets. I was not sure how I would be able to figure out the current color of the background in the applet and just in general. :confused: To set the background, I used:

    setBackground(Color.green);

    for example. How would I figure out what the current color is...I wanted to make a button that will change the background colo to a certain other one depending on what the colour is.

    Thanks a lot in advance! :D

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,574
    Rep Power
    23

    Default

    If you'll look at where the setBackground() method is defined and then back up a few lines you'll see the get method that goes with it. That's in the API doc.

  3. #3
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    0

Similar Threads

  1. List all the files in the current jar
    By Srikanth_From_Moon in forum New To Java
    Replies: 0
    Last Post: 06-14-2008, 08:42 AM
  2. Current month
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-07-2008, 08:40 AM
  3. Getting current userís name
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-07-2007, 12:04 PM
  4. How to get the current working directory in EJB?
    By sathish_2111 in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 07-19-2007, 04:24 PM
  5. How can i get current directory?
    By Ashley in forum New To Java
    Replies: 1
    Last Post: 05-26-2007, 01:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •