简体   繁体   中英

How to do custom Binding on JAVA (Netbeans IDE)

I want to find out how to do custom binding on java, I've searching on google but not found any. It's simple problem, I have two jSpinner , jSpin1 and jSpin2 . jSpin2 value is half from jSpin1 .

when I do binding, there is

Binding source : jSpin1
Binding expression : ${value} 

so the value in jSpin2 exactly the same with jSpin1 . then how could I make its value half from jSpin1 ?

thank you.

As I Understand you use NetBeans GUI Builder. You can do it by the next steps:

- do right click on jSpin2 (in design view) and select 'Properties'

- select 'Binding' at the top of dialog

- click on '...' button on 'value' property

- select 'jSpin1' from 'Binding Source'

- select 'value' from 'Binding Expression'

- edit 'Binding Expression' to '${value/2}'

(Also you can put 'jSpin1[${value/2}]' in 'value' property)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM