aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable with default table model give me strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable with default table model give me strings" Watch "JTable with default table model give me strings" New topic
Author

JTable with default table model give me strings

Mohamad Samy
Ranch Hand

Joined: Apr 26, 2013
Posts: 98
here is the first topic for me in this forum and won't be the last. I've been recommended with this forum as the more helpful one from java experienced professionals.

I am facing a problem while creating a table with default table model and using the group layout to lay all the components on the frame
all the things are okay for compiling the program as I want but the problem is that all the components included in my table are displayed as strings, I want to know the reason without using other layout manager



Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2203
    
    7
Yes, by default, all data is treated as a String. Did you read the JTable API and follow the link on How to Use Tables for an explanation and examples of using a table? The section on Creating a Table Model talks about this issue. Of course you don't need to create a completely new model, you can just extend the DefaultTableModel and override the appropriate method.
 
jQuery in Action, 2nd edition
 
subject: JTable with default table model give me strings