File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JTable Design ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "JTable Design ??" Watch "JTable Design ??" New topic
Author

JTable Design ??

Rikard Qvarforth
Ranch Hand

Joined: Jul 10, 2001
Posts: 107
Hi folks !
I have been digging in to the javax.swing.table package latly. Im building an JTable with a column model and a tablemodel. And for each column i hava a diffrent renderer. The tablemodel is updatable with new data when the user clicks in the jtree i have. The reason why a buildt so many renderers are, that i cant have renderes based on the column class type, i need to set the different tooltips and so on for the spefic data.
But i feel like some controller logic is in the diffrent renderes and the init method who puts the hole kabang together just explode with crappy code. The hole package is static and has proceduel smell to it (maby its the writer of the code ) so i wonder if i can add a extra layer on top of the data model. Which adds the tooltips from a resource file and formats the values from the model.
And then the renderer just cast the value the the new interface and gets all the niffy piffy stuff . But how can i make the "datamapping to column" not so static ? i dont want some switch ??
Anyone out there who can this ?? feels like im lost in the dark looking for the right desing.
Many thanks !
//Rille
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JTable Design ??
 
Similar Threads
Images in a JTable
JTable
JTable + TableCellRenderer
JTable
inserting a JLabel to a JTable