• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable in JComboBox

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to create a Date Control similar to Microsoft's Date/Time Picker, but I can't seem to get the table to show when I click on the Drop Down arrow on the ComboBox. I'm not sure if I should be using a calendar (JTable) as the Renderer or the Editor. Has anyone tried doing this before?
Any help is appreciated,
Jeremy
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is it right, that you want the items displayed as table inside the _poped up_ combobox? I just consulted the API and as i understand it, the renderer (which would have been the one to use) and the editor both are only applied to the ComboBoxField. that is, i'd say, the field you see any time (a JTextField as it seems).
if you just want to display more than one value in one row without the looks of a JTable then you should implement this feature in your ComboBoxModel.
if you want to really have a jtable inside a combobox (and not just one tablerow after another) then you will have to take a closer look at the ComboBoxUI and its subclasses. look for the popup of the combobox (something like createPopup()).
have fun
chantal
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic