Need HELP setting colors in GUI

hi iam trying to write a program that allows you to check the color red green or blue once you selected your color and click the button i created its suppose to display the color what i have done so far gives a problem i think its simple but i just cant seem to find it thats why its so frustrating but when i select a color and press show it only gives me black regardless of what color is choosen if anyone can take a look at my code and give me some kind of feedback that would be great thanks
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
public class colorFrame extends JFrame
     implements ActionListener{
          //check boxes
          private JCheckBox jRed = new JCheckBox("RED");
          private JCheckBox jGreen = new JCheckBox("GREEN");
          private JCheckBox jBlue = new JCheckBox("BLUE");
          //Radio buttons
          private JRadioButton jLight = new JRadioButton("Light");
          private JRadioButton jNormal = new JRadioButton("Normal");
          private JRadioButton jDark  = new JRadioButton("Dark");
          //Buttons     
          private JButton  jShow = new JButton("Show");
          //Display area
          private JPanel JColor = new JPanel();
          float blue, green, red;
     //Main Method
     public static void main(String[] args){
          colorFrame frame = new colorFrame();
          frame.setTitle("Color Frame");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(600,400);
          frame.setVisible(true);
     public colorFrame(){
          //get the content pane of the frame
          Container container = getContentPane();
          //set flowlayout
          container.setLayout(new BorderLayout());
          //create panel check set grid
          JPanel check = new JPanel();
          check.setLayout(new GridLayout(1,3)) ;
          //add check boxes
          check.add(jRed);
          check.add(jGreen);
          check.add(jBlue);
          //Create panel radio set grid
          JPanel radio = new JPanel();
          radio.setLayout (new GridLayout(1,3));
          //Add radio buttons
          radio.add(jLight);
          radio.add(jNormal);
          radio.add(jDark);
          //Create panel button
          JPanel button = new JPanel();
          button.setLayout (new GridLayout());
          //add button
          button.add(jShow);
          //Create panel to show color
          JColor.setLayout (new GridLayout());
          Dimension d = new Dimension(400,300);
          JColor.setPreferredSize(d);
          //Test panel
          JPanel p5 = new JPanel();
          p5.setLayout (new GridLayout(2,3));
          //add registers
          jShow.addActionListener(this);
          jRed.addActionListener(this);
          jBlue.addActionListener(this);
          jGreen.addActionListener(this);
          jNormal.addActionListener(this);
          jDark.addActionListener(this);
          jLight.addActionListener(this);
          //add panels
          p5.add (check, BorderLayout.SOUTH);
          p5.add (radio, BorderLayout.SOUTH);
          //p5.add(button, BorderLayout.EAST);
          //Add panels to frame
          //container.add(check,  BorderLayout.SOUTH);
          //container.add(radio, BorderLayout.SOUTH);
          container.add(button, BorderLayout.EAST);
          container.add(JColor, BorderLayout.NORTH);
          container.add(p5, BorderLayout.SOUTH);
     public void actionPerformed(ActionEvent e) {
          if(e.getSource() == jShow){
               if (e.getSource() == jRed){
               jRed.isSelected();
                    red = 1.0f;
                    green = 0.0f;
                    blue = 0.0f;
               if (e.getSource() == jGreen){
                    jBlue.isSelected();
                    red = 0.0f;
                    green = 1.0f;
                    blue = 0.0f;
               if (e.getSource() == jBlue){
                    jBlue.isSelected();
                    red = 0.0f;
                    green = 0.0f;
                    blue = 1.0f;
                         Color newColor = new Color(red, green, blue);
                    JColor.setBackground(newColor);                                     
     }

Okay here's some feedback first of all your
explanation of what you are trying to do and what
happens is hardly readable because you don't use
sentences and people will prolly just skim over it
just for that reason and right they are to continue
you should be congratulated for using code tags that
does help a lot now your code would be a lot more
readable if you followed standard conventions like
not starting class names with lowercase and not
starting variable names like fields with an uppercase
such as JColor and finally you should not have your
frame be its own actionlistener you should create a
separate (anonymous inner class) instance of a
listener for each component when you have done all
this (and your problem isn't fixed yet) please come
back you're welcome.well im sorry u had a hard time reading it next time i will type slower for you OK i asked for help not your stupid comments and i would like to say thank you KAJ moving the ifs out worked thank you

Similar Messages

  • Need help setting up TV equiptment

    I have been very ill and I need help setting up my TV, DVR, Receiver, Surround sound systems. I'm afraid if I try to work on all the equiptment, I'll drop my HDTV or other componets because I'm still weak. Can anyone help me? I've called a few places and they want $100.00 to set it up. Give me a break! I know about inputs and outputs and other cables, I just don't have the strength to move the equiptment around. I am willing to pay. Please call me at 813-{edited for privacy}. Thanks, Teresa {edited for privacy}

    blondeinneed wrote:
    I have been very ill and I need help setting up my TV, DVR, Receiver, Surround sound systems. I'm afraid if I try to work on all the equiptment, I'll drop my HDTV or other componets because I'm still weak. Can anyone help me? I've called a few places and they want $100.00 to set it up. Give me a break! I know about inputs and outputs and other cables, I just don't have the strength to move the equiptment around. I am willing to pay. Please call me at 813-{edited for privacy}. Thanks, Teresa {edited for privacy}
    Teresa,
    I think the best way for someone to volunteer to help you would be for them to send you a Private Message (PM) here on the forums. You should see a small envelope in the upper right corner of the screen, when it changes color you will know you have a PM to view.
    I would be happy to help, but since I am in North Texas I don't think that is a viable option Sorry....
    Justin
    FiOS TV, Internet, and phone user
    QIP7232, QIP7100-P2, IMG 1.9A
    Keller, TX 76248

  • HOW TO?: Need help setting up 3 different iCloud accounts for my kids (so each has own iMessanger)using same Apple ID (mine) ....they don't have their own separate email addresses to work from...how do I do this?

    Need help setting up 3 different iCloud accounts for my kids (so each has own iMessanger)using same Apple ID (mine) ....they don't have their own separate email addresses to work from...how do I do this?

    Any devices connected to the same icloud account can sync all the data on that account.  For this reason an icloud account is really for a single user.
    On a mac, if each user has their own account, then the itunes for that mac account should be set up to connect to that user's icloud account (System preferences>icloud).

  • I need help with color pallette in iPhoto 11. I have created a book and would like to use a different color background than those given in "background." I have found the color palettes but can't seem to incorporate them into my backgrounds palette.

    I need help with color pallette in iPhoto 11. I have created a book and would like to use a different color background than those given in "background." I have found the color palettes but can't seem to incorporate them into my backgrounds palette.

    That is not a feature of iPhoto - suggest to Apple - iPhoto Menu ==> provide iPhoto feedback.
    Additionally I have no idea what you are saying here
    I have found the color palettes but can't seem to incorporate them into my backgrounds palette.
    And it always helps for you to dientify the version of iPhoto that you are using
    LN

  • Need help setting up and configuring rsync

    Hello
    I need help setting up, or rather configuring rsync to sync data between my brand new iMac and my Macbook Air.
    Here is what I would like to:
    - I want all of the files on both machines to be an exact mirror or copy of each other. Basically I have an iMac for at home, and then a Macbook Air for the road.
    - The main folder on both Macs is called 'Sara' and I want the contents (mainly the 'movies' folder, 'music' folder, 'documents' folder and 'pictures' folder) to immediately sync up with each other when both of them are on my home network.
    - this means if I'm working on a file at home on my Macbook, it will immediately write to the same directory on my iMac and vice versa (if I'm working on file(s) on my iMac, it will immediately save the contents to my Macbook). This way, if I'm working on last minute project my iMac, and then have to head out the door to the airport, the file is immediately saved to my Macbook (no usb for USB transfer).
    - hopefully this makes sense??
    Any help is greatly appreciated!
    Thanks

    It's a lofty but unrealistic goal.  Rsync does not run automatically.  There is no realistic method of instantaneously synching two computers over the internet or even on a LAN.
    I would suggest you might try using Synk Pro which, in theory, can keep two devices in sync when they are both on the same network (and both have shared and mounted drives.)
    If you must do this with rsync then I suggest a Google search for rsync tutorials.

  • I need help setting up an apple id for my sons phone. It seems his email address has been taken and/or we cant get the password.

    I need help setting up an apple id for my son's phone. It seems his email address has been taken and/or we cant get the password.

    Two different things
    If you forgot the password
    If you forgot your Apple ID password - Apple Support
    If the email ID you want to use is in use by someone else - then you may need a new one
    The iCloud ID's are usually unique and may be of help if you set one up

  • Need help Setting up Multiple Static Ip , 1 for each port of the fios router

    Need help Setting up multiple Static Ip on my fios router
    I have been trying to figure out how to set up multiple ip in my fios router.
    However I kind of managed how to set up multiple static ip However the way I want it is for each port of my router to have an external ip signed to it. ( like 4 different modem in 1 )
    Verizon gave me 5 static ip but they can not help me how to set it up.
    Have anyone here done more then one static ip on different ports? I assume that the process will be the after the second static ip.

    You want to set up Static Nat. You will not assign the IP to a port, but rather to a local machine. Figure out what machines you want your IP's to go to. Under the firewall section you will see static nat. Pick the machine you want and enter one of the IP's you were assigned.

  • Need help setting up FCE 4   PLEASE

    OK, I'm NOT a professional, just need help setting up.
    Just purchased FCE 4. Need to set up my Sony HDR SR11. I've already recorded most of my stuff in HD SP. Can someone Please help me set up?
    thanks

    Thanks for the info.
    I updated and did a search in my manual for Log and transfer which didn't go to anything I can figure out. Sorry, I don't have time to read 1152 pages.
    Can anyone just tell me how to get this going? There should be a simple set up correct?

  • My email is not working in lightroom. Need help setting that up.

    Need help setting up my email in lightroom. For some reason it's not connecting.

    Try posting in the Lightroom forum.  People there are more tuned in to the detail working of the application:
    http://forums.adobe.com/community/lightroom?view=discussions

  • I have a Steinberg MI4 and a Roland Fantom X7, and am trying to use my Fantom in Logic to record audio. Need help setting it all up using MIDI cables. Please help !

    I have a Steinberg MI4 and a Roland Fantom X7, and am trying to use my Fantom in Logic to record audio. Need help setting it all up using MIDI cables. Please help !

    Encryption wouldn't matter except for Wifi.
    While 10.2 might help, there's not much you can do on the Internet these days with less than 10.4.11
    Tiger Requirements...
    To use Mac OS X 10.4 Tiger, your Macintosh needs:
        * A PowerPC G3, G4, or G5 processor
        * Built-in FireWire
        * At least 256 MB of RAM (I recommend 1GB minimum)
        * DVD drive (DVD-ROM), Combo (CD-RW/DVD-ROM) or SuperDrive (DVD-R) for installation
        * At least 3 GB of free disk space; 4 GB if you install the XCode 2 Developer Tools  (I recommend 20GB minimum)
    http://support.apple.com/kb/HT1514
    http://www.ebay.com/sch/i.html?_nkw=mac+os+x+tiger+retail+10.4
    See Tom's, (Texas Mac Man), great info on where/how to find/get Tiger...
    https://discussions.apple.com/message/15305521#15305521
    Or Ali Brown's great info on where/how to find/get Tiger...
    http://discussions.apple.com/thread.jspa?messageID=10381710#10381710
    As far as Memory, that's sort of easy, find your eMac here...
    http://eshop.macsales.com/MyOWC/Models.cfm?Family=emac&sType=Memory
    As far as Hard Drive, it's not easy to replace the Internal drive, I'd maybe suggest an external Firewire drive to boot from...
    http://eshop.macsales.com/item/Other%20World%20Computing/MAU4S7500G16/

  • Need help setting up outlook mail on ipad2

    downloaded the outlook app, need help setting it up.

    Is it actually called Outlook, or is it called Outlook Mail Pro or Outlook Mail Complete or something like that? Those apps are actually by separate companies (ie, not Microsoft), and I don't personally have experience with them, but here are links to their support sites which should have the information you need (or an email address you can write to):
    Outlook Mail Pro: http://support.codebeforedawn.com/customer/portal/topics/38871-outlook-mail-pro
    Outlook Mail Complete: http://www.ikonicapps.com/outlook/
    hope that helps...
    Matt

  • Deperately need help setting up external midi devices

    I need help setting up external midi devices.....Motu828...Midi express...RolandXV3080....Motif rack.......HELP

    Theres not really much to setup. Assuming your synths are connected to the MIDI Express already..
    In Logic, make a new MIDI track. On the left hand side in the track inspector, among the parameters you'll see an option for MIDI Port and Channel. Just pick which port the track is going to, set the channel and device id and play (And be glad you never had to deal with setting up the old Environment window in Logic 5 and below).
    If you really wanna get into it and have all your MIDI ports named after the synth thats connected to it, open up Audio Midi Setup, create a device icon for each synth you have and draw the cables from each device to whatever port its connected to on the midi interface's icon.
    Then in Logic everytime you pick your MIDI port on your track, instead of MIDI Port 1, MIDI Port 2, etc.,
    it would be labelled XV-3080, Motif Rack, and so on.. I dont think theres anyway to do this within Logic itself (you can change the labels on your audio ins and outs, but not MIDI as far as I can recall)..
    If youre talking about having access to patch names and whatnot like Digital Performer and Cubase let you do, Logic doesnt use the xml patch lists everyone else does. The above steps are pretty much all there is to be done as far as MIDI.
    Heres my Audio Midi Setup window for reference.
    Now when I select MIDI Port 1 in Logic its named MWXT, port 2 is SR-16, etc..

  • HT5538 I dont really get this i need help setting some things up on my Ipod.Can you help?

    I need help setting up my Imessage and FaceTime.I have tryed and its not working.

    iOS: Using FaceTime
    iOS: About Messages
    iOS: Troubleshooting FaceTime and iMessage activation
    iOS: Troubleshooting Messages
    iOS: Troubleshooting FaceTime

  • Need help setting up color scanning through Adobe 9 pro

    Unable to set-up the color scanning through adobe 9 pro,   need help!

    Obviously, FireWire is a fast connection, but for changing metadata, USB is plenty fast. Why it takes so long is anyones guess. Is it a USB 2.0 drive? Using external drives can be tricky. My father uses them for his gigantic library of almost 80,000 songs. When you have it setup properly, it works fine, but if you say forgot to have the external drive mounted when you launch iTunes, iTunes defaults the library back to your Music folder, then when you start importing, it puts in on the internal drive, then you have to go back and reset it, etc. Problem, with iTunes alone, you can only set one library, so if you want to use two drives, you will have to have one set at any given time.
    So you could set the music one first, add to the library, then set it for movies, then add those to the library. Then keep the library set to the one you use most frequently, so you don't have to always switch. Once you import all media, and iTunes "knows" where to find the files, you can play them with no problems with two drives.
    For wireless, you have a couple choices. If you have two Macs, you could keep one connected to the two drives, then with the other computer, just connect to the network and share the iTunes library so your other computer has access. If you want the music stored on a drive accessible wireless, you'll probably have to look to NAS, or some form of wireless storage. If you do that, their may even be a better third party software solution other than iTunes for managing multiple libraries.
    This is something iTunes really needs. As libraries grow, one drive just isn't enough often.
    Bryan

  • CR 9 - Need HELP Setting Line Graph colors in the Chart Expert

    Post Author: desselle
    CA Forum: Charts and Graphs
    Hello,
    I created a Crystal Report (CR) based off an existing Trend Analysis report. I have created a VB6 application that calls the .RPT file I created for the report in CR.  The VB6 app sets the report recordset via code that corresponds to the .TTX file, and the parameters .  The report contains a Line graph that plots five pieces of data.  The report & graph work good.  The Problem: CR determines the color of each line on the graph.  However, I need to set the color for each line to correspond to the colors used on our existing reports.  The users are accustom to a certain color representing a certain set of data on the existing reports.   I have tried everything I can think of and from all documentation I can find, and nothing changes the line colors.   I have tried all of the following:
    1.) From the Chart Expert, Option tab, I click the Format button next to Color and setup conditional color settings per each piece of data.   However, when I run the report these conditional color settings are not reflected on the CR graph.     I am using formula fields (based off database fields in the recordset) to produce the report.  However, I only see the database fields to use in the conditional color formatting screen and not the formula fields.    I thought this would possibly be the cause why the colors wonu2019t change on the CR, but I canu2019t find a way to make the formula fields show up in the list.
    2.)Also, I tried right clicking the individual lines of the graph and change the selected item color, but this didnu2019t change the color either.  I do this in Design mode and Preview mode and neither one changes the color of the lines on the graph.
    3.)I have also looked into the CR object model to see if I can change the line colors of the graph via code and it doesn't look like I am given this flexibility.
    Do you know what I am doing wrong here?   I just want to be able to set the color of each line on the CR graph to the color I want instead of using the default colors.  Are there some Hot Fixes that I need to apply to my copy of CR?
    Thanks

    Post Author: desselle
    CA Forum: Charts and Graphs
    Hello,
    I got the problem fixed w/ the line graph not making the data lines the same color on the report as on the frmPlot graph.   Compare the two screen shots below.   The problem was as follows:  When I created the graph (in the Chart Expert) the field u201CReadingDateu201D was not one of the Report Fields, and all the other fields were Report Fields (Reading, LowAlarm, UpperAlarm, LowerLimit, & UpperLimit). See the 3rd screen shot below.  ReadingDate does show up as a Report Field now but it wasnu2019t at first.   Originally, this field was only available in the Chart Expert as a recordset field.  When I changed this field to be a Report Field, the graph then allowed me to change the data series line colors.   This was not obvious at all.   From the beginning when I setup the graph and passed in the recordset from VB it graphed all of the data series fine.   The colors that the Chart Expert chose for each line just didnu2019t match what was on the frmPlot graph.   Anyway, it is working now.     I can at least say I learned (somethingu2019s to-do and somethingu2019s not to-do) a good bit about Crystal Reports in the process.
    Thanks

Maybe you are looking for

  • Strange behaviour of iPad Photos app/My Photo Stream with iOS 8.1 and Yosemite

    My requirement is surely simple and commonplace, yet is proving impossible to achieve thanks to Apple's weird design of the Photos app and the way My Photo Stream works.  I'm very technically savvy, but I'm quite prepared to admit I'm being stupid if

  • How do I get rid of an extra blank tab page that opens with each email

    Since the last update - whenever I open an email - it opens the email - plus a new tab - it defaults to the new tab. In the new tab are the favorites icons - I have to close this in order to see the email How do I turn this tab off so just the email

  • Grid calculations

    I am developing report using hyperion financial reporting. I have taken 2 dimension in rows(dept and account) and 9 dimension(Time, office, currency etc) in column. I have to prepare report using "jan" from time dimension. Then keeping all the other

  • View past network traffic?

    Hello, We've been having a problem in our studio where someone has been using machines after hours (and possible during work hours) to do downloading. Is it possible to check individual machines (logs, perhaps?) to see network traffic/the amount of f

  • Help with zen to

    recently i had a problem with my player. i instaled new drivers , but when i was installing the new firmware, it stoped and blocked my pc.now when i turn on my zen touch, there?s a firmware problem message and the player shows version 0.0.0.0! i thin