aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Problems with JTable & JComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Problems with JTable & JComboBox" Watch "Problems with JTable & JComboBox" New topic
Author

Problems with JTable & JComboBox

Andreas Rutvik
Greenhorn

Joined: Jul 18, 2005
Posts: 7
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

Joined: Jul 18, 2005
Posts: 7
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 :

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Problems with JTable & JComboBox
 
Similar Threads
JTable ........
JTable
jtable
JTable and combobox as the cellEditor
Problem in adding/deleting rows from Jtable