Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-24-2008, 08:58 PM
Member
 
Join Date: Aug 2008
Posts: 4
Levish2002 is on a distinguished road
Swing problem: JTable/TableModel
hello

I've got a class that implements TableModel and when loading an object of that class to a JTable I was hoping that I would see the Column Names of that table:

the following code appears in the class the implements TableMode:

private static String[] ColumnName = {"Number", "FileName", "LineNumber", "Error"};

@Override
public String getColumnName(int columnIndex) {
return CompilationErrors.ColumnName[columnIndex];
}

I've checked and this method is called as expected.

however : I don't see any column names

Anyone can help ?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-24-2008, 09:28 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,266
hardwired is on a distinguished road
Did you add the JTable to a JScrollPane?
If not you'll have to add the JTableHeader to the tables parent Container as a separate component.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-24-2008, 10:53 PM
Member
 
Join Date: Aug 2008
Posts: 4
Levish2002 is on a distinguished road
Quote:
Originally Posted by hardwired View Post
Did you add the JTable to a JScrollPane?
If not you'll have to add the JTableHeader to the tables parent Container as a separate component.
hey, thanks for the swift reply

i've added the JScrollPane and it fixed it :-)
(didn't know that Pane at all before you mentioned it)

thx again
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
JTABLE problem MaximInf AWT / Swing 4 06-21-2008 12:45 PM
JTable problem robbertds1 AWT / Swing 1 05-20-2008 08:34 PM
Jtable duplicates through Hashtable (JTable condition problem) my assignment plz help salmanpirzada1 Advanced Java 2 05-15-2008 12:15 PM
Create different instance of a tablemodel Bill AWT / Swing 6 03-27-2008 05:49 PM
Problem with JTable Felissa AWT / Swing 2 07-04-2007 11:25 AM


All times are GMT +3. The time now is 11:37 AM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org