Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Binding a JCombobox using a buffered model?

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

I'm using the JGoodies Binding framework in my Swing GUI to bind bean parameters to my visual display. In particular, I've created a JCombobox that I want to bind to bean parameter. I have several other parameters already bound using binding and a buffered model (i.e. someone can type a new value in a textfield but it doesn't actually make the changes to the bean's parameters until an action is triggered, like hitting an Apply button). It may be obvious, but is there a way to do the same, ie. buffer, with a JCombobox? Right now I have the following code:



The first part (the config_tf textfield) creates a textfield buffered until the user triggers an action. But with the JCombobox I'm not sure how to do this. (the createComboBox only takes a selectionInList parameter).

Thanks for any hints.

Dave
 
David Irwin
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, I found the answer to be relatively straight forward. For everyone's benefit, I've posted the solution I found to work below:



and in my hardware object I have the following:

 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic