• Post Reply Bookmark Topic Watch Topic
  • New Topic

getting a table to show after filling it with data

 
Mark Freeman
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there. I am practicing creating various programs while I study for my certification. I'm writing a little jdbc client, which is VERY simple at the moment. However, I can't seem to get the results of the query to show in the table (or get the table to show rather). Any suggestions are welcome. Here's the program so far. Basically the top of the screen is a big gray box and stays that way, even after adding the table.


[ June 15, 2008: Message edited by: Mark Freeman ]
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JScrollPane's work a little different than most other Containers. Instead of directly adding to it, you can either:
a) get a reference to the viewport (getViewport) and add to that
b) use setViewportView

Furthermore, you can drop all references to "table". All you do with it is create it and add it to the scrollpane. Why would you want to show an empty table that you will remove moments later?
 
Mark Freeman
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried a ton of variations. dropping the added table was a last minute change. I'll try your suggestions tonight, thanks!
 
Mark Freeman
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that did it. thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!