• Post Reply Bookmark Topic Watch Topic
  • New Topic

jcombo box and jtable

 
Maria Flaherty
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!