Closed GoogleCodeExporter closed 8 years ago
Actually ComboBox already has a value property. However it is in its superclass
ComboBoxProperty. Anyway, it supports <==> operator. To prove it, run this code:
{{{
package scalafx
import beans.property._
import Includes._
import scene.control._
object scalafx {
val stringProp = StringProperty("gama") //> stringProp : scalafx.beans.property.StringProperty = [SFX]StringProperty [v
//| alue: gama]
val comboBox: ComboBoxBase[String] = new ComboBox[String](List("alpha", "beta", "gama", "delta")) {
value <==> stringProp
} //> comboBox : scalafx.scene.control.ComboBoxBase[String] = [SFX]ComboBox@21994
//| 57f[styleClass=combo-box-base combo-box]
def showValues {
println("Combo: " + comboBox.value.value)
println("strProp: " + stringProp.value)
} //> showValues: => Unit
showValues //> Combo: gama
//| strProp: gama
comboBox.value = "alpha"
showValues //> Combo: alpha
//| strProp: alpha
stringProp.value = "beta"
showValues //> Combo: beta
//| strProp: beta
comboBox.value = "omega"
showValues //> Combo: omega
//| strProp: omega
stringProp.value = "psi"
showValues //> Combo: psi
//| strProp: psi
}
}}}
Original comment by rafael.a...@gmail.com
on 10 Feb 2013 at 2:10
Original issue reported on code.google.com by
jbiver...@gmail.com
on 5 Nov 2012 at 12:48