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
posted 11 years ago
The above link seems to have the information required. It shows how to create a render and attach it to a column
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"?
K. Tsang CEng MBCS PMP PMI-ACP OCPJEA OCPJP
expectation is the root of all heartache - shakespeare. tiny ad:
Devious Experiments for a Truly Passive Greenhouse!