• 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

jcombo box and jtable

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm fairly new to Java (so please bear with me ) and am learning to use swing. I've created a simple JFrame. I have a JComboBox in the frame and below this a JTable. I have some values (a series of name) added to the JComboBox and when I select a value, such as the name 'Mary' then I want their information (grade etc) to appear in the columns of the table.

So far, I've made little or no progress. I can get the chosen value from the JComboBox to appear in a textfield, but not in the table.
Do you think I am going to right way? Any advice would be great. Thanks
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maria,
Welcome to the Ranch.

You are able to get the JComboBox selected value to reflect in the text field. That would indicate, you are successfully processing the combo box selection events.
To get the details in the table, you would need to update the table model
More information on how to properly use tables can be found here
 
brevity is the soul of wit - shakepeare. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic