Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Initializing JTable

 
shraddha sawant
Greenhorn
Posts: 12
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
Darryl Burke
Bartender
Posts: 5132
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check how to dynamically change scroll pane content in How to use Scroll Panes
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic