• 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

Problems with JTable & JComboBox

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.

I'm having a small problem with my GUI. I have my JTable with all the flights available. When I click on a row in the JTable another JTable appears together with a JComboBox (for choosing how many seats the user wants to book ) next to the "Book" button. The problems I have are 2 :

1. I can't see the column names for this 2:nd JTable
2. I can't see the available seats option in my JComboBox.

Here is how the GUI looks like when a row is selected in main JTable



Here is my code (important pieces ):





Of course, don't care about the fact that I've hardcoded some code etc. etc. This is just for testing purposes :=)

Best regards
/Andreas

Ps. Maybe it's easier to help if a paste in all code for my GUI ? It's just feels as it is a bit to much Ds.
 
Andreas Rutvik
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem was that the 2:nd JTable was NOT embedded in a JScrollPane and therefore automatically the JTableHeader is not visible. I solved this easily by adding the following lines :

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic