Hi Can anybody help me to how to increase the size of jspinner arrows as per touch screen requirements on desktop
-
2I think you can't directly modify that size without changing L&F properties. – Heisenbug Oct 12 '12 at 09:17
3 Answers
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
- 3,105
- 6
- 23
- 55
help me to how to increase the size of jspinner arrows as per touch screen requirements on desktop
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 way
create
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
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.
- 203,806
- 29
- 246
- 1,045
-
Please elaborate the second option. Property arrowButtonSize can't be found. – code_poetry Nov 20 '17 at 06:27
-
The key is `"Spinner.arrowButtonSize"`, for [example](http://nadeausoftware.com/articles/2008/11/all_ui_defaults_names_common_java_look_and_feels_windows_mac_os_x_and_linux), but not all L&Fs support it. – trashgod Nov 20 '17 at 19:47