wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes create JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "create JTable" Watch "create JTable" New topic
Author

create JTable

kalyan chowdary
Greenhorn

Joined: Jun 22, 2006
Posts: 24
Hi,

i have a screen called search screen.

I take it as a BoxLayuout.Y_AXIS for that.

I used two boxes, in top box 6 searching fields are there.

when the user enter any one of the 6 fields then he clicks search button.

When clicks the search button now i want diplay some data(coming from database) in table format in bottom box based on the search creteria.

is it possible in swings,

if yes how it is,

please tell me,

thanks in advance.
Nick Meverden
Ranch Hand

Joined: Jul 03, 2006
Posts: 59
checkout http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

JTables are very easy to work with, make sure you use a TableModel.
kalyan chowdary
Greenhorn

Joined: Jun 22, 2006
Posts: 24
thanks for reply,

Create JTable is ok,

But i want to display table in same screen,

Initially there is no table in bottom,

After click search only it will display.

How it is, which layout is the best.

Thanks in advance
Nick Meverden
Ranch Hand

Joined: Jul 03, 2006
Posts: 59
You have a ton of different options, you can create a default blank JTable and repaint it after it's been populated or add the JTable to the JComponent and repack(), it all depends what you want the user to see.
 
Consider Paul's rocket mass heater.
 
subject: create JTable
 
Similar Threads
open a new window using struts2 button
Special characters changing to %something%
form validation help
how to come back the previous screen
how to create new screen instead of dialog for GUI