Results 1 to 2 of 2
  1. #1
    eva21 is offline Member
    Join Date
    Nov 2008
    Location
    Canada
    Posts
    1
    Rep Power
    0

    Post I need help with JComboBox

    What im trying to do is put a string array into this combo box called jComboBoxParts how do i make it show? Right now when i load it, all i see is "Item1..."Item2...etc". Here is my code.

    String[] partsString = { "oil can", "windshield", "tires", "v6 Cylinder head", "fuse"};

    JComboBox[] jComboBoxParts = new JComboBox[partsString.length];
    for(int i=0; i < partsString.length; i++)
    {
    jComboBoxParts[i] = new JComboBox(partsString[i]);
    }

    with the bolded work i get an error. Please help. :confused:

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

Similar Threads

  1. JCombobox
    By daniel50096230 in forum NetBeans
    Replies: 1
    Last Post: 09-21-2008, 12:23 PM
  2. Got some trouble with JComboBox
    By hungleon88 in forum AWT / Swing
    Replies: 16
    Last Post: 09-15-2008, 11:26 AM
  3. JComboBox
    By Fosters in forum AWT / Swing
    Replies: 0
    Last Post: 08-10-2008, 01:22 PM
  4. Help with jComboBox
    By Marcus in forum AWT / Swing
    Replies: 2
    Last Post: 07-01-2007, 11:08 PM
  5. jcombobox
    By Freddie in forum AWT / Swing
    Replies: 4
    Last Post: 05-11-2007, 12:48 AM

Posting Permissions

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