Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Binding a JCombobox using a buffered model?  RSS feed

 
David Irwin
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • 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
  • 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:

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!