• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

JTable Design ??

Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !
We're all out of roofs. But we still have tiny ads:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic