• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

2D Array Help

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I select a column in the array? I can select the row just fine but for my ComboBox I need to select the column as the values for the combobox.

Thanks in advance.




[ May 27, 2008: Message edited by: Joe Namdt ]
[ May 27, 2008: Message edited by: Joe Namdt ]
 
Marshal
Posts: 79471
379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am very sorry, but I moved your original post to another forum because it appeared to be more appropriate there.

The original seems to have vanished mysteriously, and I am sure I didn't send it to the wrong place. I am afraid I still think this is more of a specific Swing topic than a general beginner's topic, so I shall transfer this thread to Swing as well.
 
Sheriff
Posts: 22787
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Like you already know, getting rows is quite easy. There is no way to get a column directly though - partNumberString is not a matrix but an array, with each element being an array of Strings.

To get the second column (numbered 1), you need to create a new array:

You will need to make 100% sure that all arrays in partNumberString have the same length, or this code may fail. Fortunately, in your code that's ok.
 
You can't expect to wield supreme executive power just because
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic