This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable" Watch "JTable" New topic
Author

JTable

Richard Larocque
Greenhorn

Joined: May 10, 2001
Posts: 6
I've been trying to get a JTable to appear. Unfortunately only a blank screen appears. I have 6 records in my test database. When I checked my dataModel with getRowCount and getColumnCount, it does show my 6 records and my 6 columns. What am I missing?
Enclosed is a copy of my code.

[Added [ code ] tags and disabled smilies for clarity - Jim]

[This message has been edited by Jim Yingst (edited May 10, 2001).]
David Freels
Ranch Hand

Joined: Feb 01, 2001
Posts: 102
Try adding your JTable to a JPanel and add the JPanel to the JScrollPane.
Richard Larocque
Greenhorn

Joined: May 10, 2001
Posts: 6
Added JTable to JPanel and then JPanel to JScrollPane. Exactly the same results.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
If you want to get answers from the people that really know Swing, you should probably look in the Swing forum. I'm moving this thread there.
jeremy hull
Greenhorn

Joined: Jan 18, 2001
Posts: 10
Your table should be added directly to a JScrollPane.
jeremy hull
Greenhorn

Joined: Jan 18, 2001
Posts: 10
You did the scrollPane part right, did you try a default table model?
Richard Larocque
Greenhorn

Joined: May 10, 2001
Posts: 6
No,
I am trying to learn how to build my own Table model.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JTable