This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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: 2372
    
    8
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.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: JTable with default table model give me strings
 
It's not a secret anymore!