File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abstract table view in GUI

 
jesal dosa
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I hope so one can help. I am extracting information from the search method which brings back results in the form of a String[][].
There for my data model is in the form String [][]. I would like to display some of the columns with slightly better formatting at the moments its all being displayed as plain text. I know there is a method that needs to be over ridden. I have seen examples where the following as been used



but all my data has been stored as String[][]

There is some thing about using Custom Renderers, but i am not sure how do implement that. I have been looking at the swing examples on the sun website.
How would I, for example take my columns which have either y or n to be displayed as check boxes. Any ideas. If there is a tutorial explaining how to do this or if some can point me in the right direction.Or can i leave the formatting as it is? Will i lose marks on the GUI, i would preferred to implement this because it would be a good learning experience

Regards

Jes
 
jesal dosa
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

rendering example

The above link seems to have the information required. It shows how to create a render and attach it to a column

 
K. Tsang
Bartender
Pie
Posts: 3223
12
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jes, if you are storing your data in a 2-D String array, then I expect it will definitely output as String class no matter what. Since your getColumnClass() calls getAtValue() method, you can customize your getAtValue method to display accordingly.

I see 2 ways to do it:
1) create a OO version of your data and use that object to populate the table
2) do the conversion in your getAtValue() method

Oh do watch out for "null"s when generating the table. If you do, physically returning the class in your getColumnClass will do the trick.

Does your find method really return a "2D array"?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic