• 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

getting a table to show after filling it with data

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that did it. thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic