Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Trying to define visible a JTable, but failing miserably.

 
Robson Martinz
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I'm trying to make a simple table with JTable class by reading the following tutorial but when try to see my JTable my program doesn't show me nothing! What i'm doing wrong?
http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#renderer

 
Campbell Ritchie
Marshal
Posts: 52636
119
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where are you adding any of those components to a top‑level container?
 
Rob Camick
Ranch Hand
Posts: 2703
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to make a simple table with JTable class by reading the following tutorial


Then why doesn't your code look like the example code found in the tutorial?

In addition to the above comment, why doesn't your code use the SwingUtilties.invokeLater(...) to create and display the GUI. That code is used for a reason.

Take a look at the table of contents from your tutorial link and read the section on Concurrency to understand why it is important.

The point of reading tutorials is to follow the examples.
 
Space pants. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!