• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable doesn't load on JFrame

 
Kevin Cary
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For some reason my JFrame won't show my JTable until I mouseClick where each component should be.
 
Val Dra
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kevin Cary:
For some reason my JFrame won't show my JTable until I mouseClick where each component should be.

Hi , Kevin i used JTable just now in my GUI design and i had no problems adding it to the JFrame , i had it done something like this
public class Gui extends JFrame {
public Gui() {
super("GUI");
Container c = getContentPane();
c.add(new JScrollPane(new JTable(getRows(),getCols()));
setSize(200,200);
setVisible(true);
}
public static void main(String[] args) {
new Gui();
}
}
 
Kevin Cary
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my case there seemed to be a processing time delay. My JFrame would launch before the data was avail to load into my JTable. My solution was to create a thread so data would be avail in time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic