Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: How Do I Make Color Changing Buttons?

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How Do I Make Color Changing Buttons?

    I need to make several buttons that would change from red to green and back again. Can anyone give me some ideas on how to do this?
    Thanks!


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,149
    Thanks
    48
    Thanked 2,158 Times in 2,131 Posts

    Default Re: How Do I Make Color Changing Buttons?

    What have you tried? The JButton class has several set methods that could do it.

  3. #3
    Junior Member
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How Do I Make Color Changing Buttons?

    I have actully just installed the JDK software so I am starting from gound zero. I was hoping to get a nudge in the right direction. I have what I want to do in my head and I'm hoping its easy enough to do for a begginer. I also installed NetBeans. How would you do it?

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,149
    Thanks
    48
    Thanked 2,158 Times in 2,131 Posts

    Default Re: How Do I Make Color Changing Buttons?

    You need to get familiar with the API doc for the Java classes. Here is link:
    Java Platform SE 6

    How would you do it?
    I'd read the API doc for the class I was working with and find a method or methods that look like they would do what I wanted and try them to see what they did.

Similar Threads

  1. text color changer based on words/ word classification by color
    By knoxy5467 in forum Java Theory & Questions
    Replies: 25
    Last Post: June 15th, 2011, 07:52 AM
  2. Need help with changing color of JOptionPane
    By jwise95 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 22nd, 2011, 09:49 AM
  3. Changing Panel Color with a ComboBox
    By bengregg in forum AWT / Java Swing
    Replies: 7
    Last Post: March 2nd, 2011, 09:04 PM
  4. Color Problem
    By aussiemcgr in forum Java Theory & Questions
    Replies: 5
    Last Post: July 12th, 2010, 03:53 PM
  5. changing the visited links color in JEditorpane
    By nasi in forum AWT / Java Swing
    Replies: 5
    Last Post: April 18th, 2010, 08:44 AM

Tags for this Thread