• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable doesn't load on JFrame

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For some reason my JFrame won't show my JTable until I mouseClick where each component should be.
 
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
There is no "i" in denial. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic