aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Initializing 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 "Initializing JTable" Watch "Initializing JTable" New topic
Author

Initializing JTable

shraddha sawant
Greenhorn

Joined: Sep 06, 2011
Posts: 12

Hi, I have a JScrollPane and JTable in it.
I want to initialize that table at run time. using following code.
But it is not updating frame.
I think i am missing some method like repaint() for JFrame.
Please tell me a code using which i can refresh the JFrame and other mistakes in the following code.
below is the code:



shraddhasav
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

shraddha , since your problem is not the same as the one in the nearly 3 year old thread you posted in, I've moved it to a thread of its own.

To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

edit: Before that, read the API for JScrollPane and follow the link to the tutorial on How to Use Scroll Panes where you will learn how to correctly show a JTable or other component in a JScrollPane.


luck, db
There are no new questions, but there may be new answers.
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Check how to dynamically change scroll pane content in How to use Scroll Panes
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Initializing JTable