Hi Can anybody help me to how to increase the size of jspinner arrows as per touch screen requirements on desktop
how to increase the size of jspinner arrows as per touch screen requirements on desktop
2.1k Views Asked by Murali mohan At
3
There are 3 best solutions below
2
On
You might try one of these:
See if a large size variant is available for your chosen Look & Feel.
Change the
Spinner.arrowButtonSizeproperty using theUIManager.put()method.
0
On
change the size of JButton in spinner components like this:
spn = new JSpinner();
spn.getComponent(0).setPreferredSize(new Dimension(40,40));
JSpinner has three component. two JButton and one JTextField.
- the 1st component is nextButton
- the 2nd component is previousButton
- the 3rd component is NumberEditor
even is possible to change
a)
PreferredSizeforButtons(inAPIlimited byIcons size 8x8, have to override too)b) relayout
Buttonsin JSpinner one on theLEFT (or SOUTH)and 2nd orRIGHT (or NORTH)but for
JSpinnerI wouldn't going this waycreate
JTextField/JFormattedTextFieldwithDocumentListener, implement there all limits to theDocumentFilter(by default for JSpinner is there the same requirements too)put there two
JButtons(by usingJButton#setXxxIconto set ownIcon), forinc / des creasingvaluefor
Date/Calendaruse properJCalendarorJDatePicker