Results 1 to 3 of 3

Thread: ComboBox Error

  1. #1
    Join Date
    Mar 2012
    Rep Power

    Default ComboBox Error

    Hey, I'm having problems when trying to put a combobox into my program. When ever I use the following code for a comboBox I just keep getting the same error as below when compiling, then a screen full of text in the cmd (nothing runs), Id I comment it out the program runs fine. Is this a general problem to do with my code or something else? Thanks.

    Java Code:
    String custAge[] = {"1","2","3","4"};
    JComboBox combo = new JComboBox(custAge);

    Note: H:\ uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.

    Tool completed successfully

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Rep Power

    Default Re: ComboBox Error

    Thats only a warning message, no error message! You are using Java 7 or?
    -> Try to use the generic way: JComboBox<String> combo = new JComboBox<String>(custAge);

  3. #3
    Join Date
    Mar 2012
    Rep Power

    Default Re: ComboBox Error

    ahhh the problem was it would compile with that warning, then you ran it but it just gave you a cmd full of text, you closed that then it ran fine :S Anyway that generic way solved it and it works fine with no warnings now, thanks!

Similar Threads

  1. Combobox
    By asai in forum New To Java
    Replies: 5
    Last Post: 02-21-2012, 07:11 PM
  2. combobox
    By dina in forum AWT / Swing
    Replies: 7
    Last Post: 05-11-2011, 05:31 PM
  3. combobox
    By leader in forum New To Java
    Replies: 2
    Last Post: 02-12-2011, 09:30 PM
  4. Need Help combobox
    By kwink in forum AWT / Swing
    Replies: 3
    Last Post: 03-21-2009, 10:05 AM
  5. combobox
    By chandu.v in forum New To Java
    Replies: 2
    Last Post: 07-02-2008, 08:36 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