I have built many many GUI:s and I don't like to have dependencies to libraries so I end up doing much of the basics myself. One thing that I end up doing over and over again is mapping primitives to GUI components.
For example if it is a boolean
I often use JCombobox
with two options ("true"
, "false"
) and if it is int
I use a JTextField
. Much of the work is to go from and to text...
Some example mappings:
int
or Integer
=> JTextField
or JSpinner
boolean
=> JTextField
, JComboBox
or JCheckBox
int[]
=> JList
(with "add" field and "remove" buttons)Set<Byte>
=> probably the same as arraysSo, to the questions:
there are 2 binding libraries i've had some experience with:
and why primitives? im assumming you store your model (the set of all values being displayed/edited by the gui) in one or more Objects no? if so, you could rely on autoboxing and work with object wrappers in the gui.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With