I m trying to make a jcombobox that has 3 colors red, yellow and green.........its a run time error.......caus i m not getting the required output

* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
package Exp4;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.JComboBox;
import javax.swing.JFrame;
* @author Gursimran
public class combox extends JFrame implements ItemListener{
    public combox()
        JComboBox cb;
        setLayout(new GridLayout(10,10));
        cb= new JComboBox<>();
        cb.addItem("Red");
        cb.addItem("Green");
        cb.addItem("Blue");
        add(cb);
        cb.addItemListener(this);
        setVisible(true);
        setSize(400,400);
    public static void main(String[] args)
        combox obj=new combox();
    @Override
    public void itemStateChanged(ItemEvent e)
        if(e.getItemSelectable().equals(0))
                    this.getContentPane().setBackground(Color.red);
        else if(e.getItemSelectable().equals(1))
                    this.getContentPane().setBackground(Color.green);

Please post the exact error message you get.

Similar Messages

  • We encountered a problem with some client machines that use Firefox version 24ESR and IE8. Ajax requests of aspx pages from Firefox are getting the following er

    I encountered a problem with some client machines that use Firefox version 24ESR and IE8.
    Ajax requests of aspx pages from Firefox are getting the following error from the iis server (iis version 7.5):
    Bad Request - Request Too Long
    HTTP Error 400. The size of the request headers is too long.
    From analyzing the request that was sent to the server, I saw that the request consist of only the viewstate of the aspx page.
    I tried to disable the viewstate for one page and the server got the request correctly.
    I do not encounter any issues on these laptops with postback requests from Firefox or when running the same application with IE8.

    Sometimes that means that the page address sent is loo long.
    Check the link address you are using.
    I can't help you further and will send for more help.

  • I am trying to download a game that I have paid for and was deleted from my iPad.  Half way thru it says the game will download once I log into iTunes.  I have signed into iTunes at least 8 different ways and each time I attempt to re download my game it

    Help

    The message means that you should download it on your computer's iTunes and then sync it to the iPad. The message quite often appears if you are currently on 3G/4G on the iPad and the app (and it applies to other content as well) is over the maximum size allowed over cellular, which is currently 50 meg.

  • I seem to have lost the red, yellow and green dots that are in the upper left hand corner that close  or minimize the page.

    I seem to have lost the red, green, and yellow dots that are in the upper left hand corner that close or minimize the page.  How can I get them back?

    You may have to try a general OS X troubleshooting process to see if the issue goes away by doing this...
    Have you tried: starting the computer in SafeBoot mode, with shift key held down; a login screen should appear after a time, and then the regular desktop. At this point, locate Disk Utility in utilities folder, and run 'repair disk permissions' on the startup volume, usually the name given the hard disk drive as it appears on desktop. After Disk Utility is finished the permissions repair, restart the computer normally.
    ...The iTunes player has free support only through the duration of the hardware product's complementary or AppleCare extended plan coverages, so though you can download a newer version, that is not the same as free support for an issue. However, the iTunes Store or App Store has a different factor for their product.
    http://www.apple.com/support/itunes/
    There is an iTunes area in Apple Support Community discussions for more topics like this; except for when they involve a hardware product where an OS X is involved. If your computer is NOT a powerPC (an 'intel'-mac) the topic would more naturally need to be posted where that hardware and later supported OS X version topics get seen. So that is why one asks 'on what Mac running what version...' instead of writing four paragraphs in a wide angle reply. The details about your iMac and the OS X say more; without them, more questions arise.
    Good luck & happy computing!

  • Trying to make a app that transfers files over bluetooth in java

    I am trying to make a program that will send a audio file (for example test.mp3) to another device.
    This would be set up as client - server application.
    Ideally, the server would be a PC and the client a mobile device.
    Is there any source code similar to this?
    Or can anyone help make this?
    Thanks.

    "You can try the below loop it will allow you to skip Unauthorized files access error:"
    Using EnumerateFiles instead of GetFiles doesn't actually avoid the UnauthorizedAccessException that is commonly encountered then SearchOption.AllDirectories is used. There's no way to avoid this problem except by dealing with each directory individually.
    And some side notes:
    the "select new { File = file }" is completely unnecessary
    DirectoryInfo.EnumerateFiles should be used instead of Directory.EnumerateFiles. Enumerating file paths and then creating FileInfo objects is slower than enumerating FileInfo objects in the first place.
    No one said EnumerateFiles instead of GetFiles will solve the Unauthorized exception. 
    Second comment the property File is used within the loop.
    The third comment has no effect with lazy execution, and please prove that it is slower. This comment must be sent against the "GetFiles" method not there."The EnumerateFiles and GetFiles methods
    differ as follows: When you use EnumerateFiles,
    you can start enumerating the collection of names before the whole collection is returned; when you use GetFiles,
    you must wait for the whole array of names to be returned before you can access the array. Therefore, when you are working with many files and directories, EnumerateFiles can
    be more efficient."
    Reference:https://msdn.microsoft.com/en-us/library/dd383571.aspx
    Fouad Roumieh

  • Trying to make a page that I host members only access training videos

    I am pretty much green when it comes to building sites, but muse has helped me a lot... BUT I am trying to make a page that I host training videos on. they must be password protected and I want to automate it if possible. I read a few of your postings and it was greek to me... so here is my simple question...
    1. I have a sales page that sells the product to the client and takes then to a paypal page so as to complete the sale. (DONE)
    2. Then once sale is complete I can change the paypal thank you page to a new page where are thanked and queued to create a username and password for access...(Not Done)
    3. I will create a page with all the training videos, but it needs to be password protected so I don't lose my content...
    4. I would like it to automatically do this when the paid user logs on it sets the password to their username automatically...
    sorry so long but I am trying to describe the best I can... thanks for help!

    Hi,
    check this thread, Re: Can I create a login/password protection in Muse for a HTML5 page or two?
    You should get some idea

  • HT3529 My phone bill is paid and I can't send or receive msgs and I tried to call Rogers but that doesn't even work and if it was a bill issue I could still call Rogers think it might be software but I would like to know what to do

    My phone bill is paid and I can't send or receive msgs and I tried to call Rogers but that doesn't even work and if it was a bill issue I could still call Rogers think it might be software but I would like to know what to do

    I'm sorry to learn that you are not able to make/receive calls chelseabee! (ticket number removed) results indicate that there is no issues with the network or account provisioning. Since you have already done a hard reset http://vz.to/1gBkSJc (as per your post), I recommend exploring replacement options. If your phone is within the one year manufacturers' warranty we can provide a Certified Like New replacement http://vz.to/uyYF0o as long as no physical/liquid damage exist. If your phone has sustained physical/water damage and you have insurance, you can submit a claim to the insurance company online at this link http://bit.ly/07CrqPK
    AntonioC_VZW Follow us on Twitter at www.twitter.com/VZWSupport
    >> Edited to comply with the Verizon Wireless Terms of Service <<
    Edited by:  Verizon Moderator

  • HT202667 I am trying to make one of my secondary emails my primary and remove my current primary.

    I am trying to make one of my secondary emails my primary and remove my current primary as I am going to be closing my current primary soon to tidy up all email correspondence. The system seems to remember my secondary after I delete it and try to assign it as the primary.

    If you don't have access to your rescue email account (you won't be able to change it until you can answer your questions) then you will have to contact Support in your country to get the questions reset.
    Contacting Apple about account security : Contact Apple for help with Apple ID account security
    If your country isn't on that page then try this form to contact Support : https://www.apple.com/emea/support/itunes/contact.html
    When they've been reset you can then update your rescue email address to an account that you have access to for potential future use : Manage your Apple ID primary, rescue, alternate, and notification email addresses

  • When trying to download or sync podcasts, I get an error code "you do not have the privilege to make changes". Please help!

    When trying to download or sync podcasts, I get an error code "you do not have the privilege to make changes". Please help! I tried uninstalling iTunes and reinstalling, but that did not work. Also, I rebooted and that didn't work, either.

    I tried to use an external hard drive from my windows computer that was formatted in NTFS Windows format.  Mac Pro sees that hard drive as "read only".  Itunes works on existing media on the hard drive to play music or movies, but when you try to purchase from itunes store and download you get the above message.  You need to move your library to a library that is formatted in exFAT format (which can be used both by "windows" and mac computers. 

  • I am creating a form on LiveCycle Designer and I am trying to create a form that has a e-mail submit button.  When the butten is utilized it attaches the form to the e-mail in an plain text .xml format rather than the pdf format.  Is there a quick fix?

    I am creating a form on LiveCycle Designer and I am trying to create a form that has a e-mail submit button.  When the button is utilized it attaches the form to the e-mail in an plain text .xml format rather than the pdf format.  Is there a quick fix?

    Hi,
    You have the choice between xml or pdf, in later versions of designer you can choose with a dropdown on the email button Object palette, the "Submit As";
    In earlier version you had to edit the XML Source and change the format from xml to pdf (or vice-versa);
    Regards
    Bruce

  • So i just got a new mac, and i am trying to sync my songs that i bought on itunes, and some of the worked, but a huge selection of them have a little exclamation mark beside it and it says it can't be downloaded, why?

    so i just got a new mac, and i am trying to sync my songs that i bought on itunes, and some of the worked, but a huge selection of them have a little exclamation mark beside it and it says it can't be downloaded, why?

    Hello Pork Chop 2,
    Congratulations on your new Mac!  It sounds like your purchased songs are not playing completely after you downloaded them.  I recommend to following steps for an issue like this:
    Symptoms
    Occasionally, if a song purchased from the iTunes Store on a Mac or PC was not downloaded completely, the song may not play back fully. The song may abruptly stop during playback, and iTunes may start playing the next song in your library or playlist.
    Resolution
    If iTunes in the Cloud is available in your country, try the following steps to resolve the issue:
    Delete the purchased song that is exhibiting the problem from your iTunes library.
    Click on the Purchased link in the iTunes Store to view your previously purchased music.
    Download your previously purchased song from this list.
    You can find the full article here:
    Songs in iTunes may not play back completely
    http://support.apple.com/kb/TS4357
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • I am trying to install itunes on my computer which is running windows 7, sp1, 64 bit. i get the message 'THIS INSTALLATION PACKAGE COULD NOT BE OPENED.VERIFY THAT THIS PACKAGE EXISTS, ETC'. any ideas how to fix?thanks jake

    i am trying to install itunes on my computer which is running windows 7, sp1, 64 bit. i get the message 'THIS INSTALLATION PACKAGE COULD NOT BE OPENED.VERIFY THAT THIS PACKAGE EXISTS, ETC'. any ideas how to fix?
    thanks jake

    Hello tcampbell1549,
    Thank you for using Apple Support Communities.
    For more information, take a look at:
    Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/ht1926
    Have a nice day,
    Mario

  • I am trying to import standard midi file that I created in Band in a Box into Logic Pro 9.  I can not get all the track to play with internal instrument sounds... only the piano track.  how can I get the others to play... drums, bass etc????   Help

    I am trying to import standard midi file that I created in Band in a Box into Logic Pro 9.  I can not get all the track to play with internal instrument sounds... only the piano track.  how can I get the others to play... drums, bass etc????   Help

    Don't drag the midi into an open Logic project. The tracks won't set up correctly.
    'Open' the midi file with Logic as if it were a Logic project. Then all the tracks will be set up so you can start editing them and applying better saved sounds and instruments, but you'll be at a starting place where you can hear what's going on.

  • How do I open a pdf book cover file using Acrobat XI into Indesign CC?  Everytime I try, it says I am trying to open a file that has been saved wrong.

    How do I open a pdf book cover file using Acrobat XI into Indesign CC?  Everytime I try, it says I am trying to open a file that has been saved wrong.

    PDF files cannot be natively opened in InDesign. They can only be placed as graphics.

  • HT204382 i have an OS X Lion and am trying to download a format that allows me to open and view videos in QuiteTime player. Which one would be best for me out of all the options that I have above?

    I have an OS X Lion and am trying to download a format that allows me to open and view QuickTime player.  Which format would be best for me?

    VLC will play any format.
    Quicktime format is MP4.

Maybe you are looking for

  • Display Out Questions

    So I really can't figure out what is going on. I have a mini display to hdmi chord which will put my computer screen onto my tv. Also I have a mini display to vga adapter with a vga chord to plug into that and then plug into the back of my tv. the hd

  • Digital signature on purchase order print output

    Dear Experts, Currently we are taking PO print and it is then sign by authorized person,naw we want to maintain digital signatures of authorized person on PO print such that when we take Print of PO it would be with signature of authorized person. Pl

  • How do I get ipod on new computor?

    My old computer died, how can I get my new computer to work with my old ipod? I do not want to loose the music that is the ipod.

  • Is Adobe Reader now a Trojan for installing unwanted software?

    Adobe Reader update message popped up today.  Started install of update and noticed that some McAfee Scan garbage was also being installed.  Nothing in the update invitation mentioned that I would be installing anything other than a Reader update.  I

  • ICal URL on .Mac

    I'm feeling stupid today. . . I created a calendar group in Cal and sent the subscribe message to the people I wanted to subscribe to it. However, in doing so, I deleted the portion of the subscribe message that gives the calendar's URL on my .Mac ac