Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

create JTable

 
kalyan chowdary
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic