Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

Swing Table problem

Thread view: 
Colin - 04 Apr 2007 21:35 GMT
I am using Sun's Swing Tutorial, and the page about the JTable seems
to indicate that if I define a class that extends AbstractTableModel,
I can then just write "JTable table = new JTable(new myTableModel());"
and the table should be displayed when I add it to a panel or frame.
I have done this, and for some reason my table has no column names at
the top.  My class that extends AbstractTableModel implements the
getColumnName(int) function.  The data cells are fine, I just need to
display the column headers.

Thanks,
Colin
Colin - 04 Apr 2007 22:33 GMT
I discovered the problem.  I was not using a scroll panel for the
table, so I needed to explicitly add the table header as a component.

Thanks,
Colin


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.