• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable Design ??  RSS feed

Rikard Qvarforth
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!