File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes SWING+JTABLE(Urgent Please) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "SWING+JTABLE(Urgent Please)" Watch "SWING+JTABLE(Urgent Please)" New topic

SWING+JTABLE(Urgent Please)

Faisal Ahmed

Joined: Aug 22, 2002
Posts: 8
Hi everybody!
Please help me to solve the problems below:
#1.I want ScrollBars in a FORM(extend JFrame) which is populated with
many Components.How can i do this.
#2.I have made JDialog opens from a FORM(extends JFrame) through
'Findbtn'.JDialog populated with JTable has been used for fetching data
from database. but the problem is how can I get text from JTable
to the textfield of Form.
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

#1. Create an extra JPanel. Instead of adding components directly to the content pane of the frame, add them to this panel. Put this panel in a JScrollPane, and then add the JScrollPane to the content pane.

#2. There are lots of ways to do this... you can extend dialog to have methods to set each field, you can have one method that takes some kind of collection (like a hashtable) that is filled out with the data, instead of a collection, you can pass the table model and the row number you want to display... etc. There is no built in way to do this, but there are several ways to do it yourself...

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: SWING+JTABLE(Urgent Please)
It's not a secret anymore!