• 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

Solution for JComboBox ?

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Right now i am using swing combobox and action listener to get selected item. But Now i like modeify the working of current combox by adding button in drop down so if user click twise on button then item will be added twise in cart. i searched but didn't get specific answere according to my requirement, Can anyone suggest some replacement of combobox in which i can add button in drop down ? (or can i add button in drop down, which can act as a button not as item of combobox so that i can use listener on button)

Thank
Anchit
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wouldn't add an ActionListener to the JComboBox for adding to a cart. I would provide a JSpinner alongside to set the quantity and a JButton for 'Add to cart'

If the JComboBox initially displays a prompt (like ' --- Select --- ' then I would initially disable the spinner and button and enable them only when a valid selection is made (using an ActionListener added to the combo).
 
anchit pancholi
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Darryl Burke wrote:I wouldn't add an ActionListener to the JComboBox for adding to a cart. I would provide a JSpinner alongside to set the quantity and a JButton for 'Add to cart'

If the JComboBox initially displays a prompt (like ' --- Select --- ' then I would initially disable the spinner and button and enable them only when a valid selection is made (using an ActionListener added to the combo).



Hi Darryl,

Thanks for Suggestion, but i am looking forward use button kind of think in drop down. Do you know similar kind of thing can possible in SWT,Jgoodies or SwingX?

Thanks
Anchit
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

anchit pancholi wrote:Do you know similar kind of thing can possible in SWT,Jgoodies or SwingX?


No, I don't use any of those. someone else might be able to help.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic