Swing/DisableOnBoundaryValues のバックアップソース(No.1)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- バックアップ を表示
- Swing/DisableOnBoundaryValues へ行く。
- 1 (2018-07-09 (月) 17:25:17)
- 2 (2019-03-20 (水) 23:26:46)
- 3 (2021-01-01 (金) 17:25:29)
- 4 (2022-04-18 (月) 15:54:53)
--- category: swing folder: DisableOnBoundaryValues title: JSpinnerの値が境界値になった場合、ArrowButtonを無効にする tags: [JSpinner, ArrowButton, LookAndFeel] author: aterai pubdate: 2018-06-25T16:59:19+09:00 description: JSpinnerの値が上限または下限になった場合、対応するArrowButtonを無効にしてクリック不可にします。 image: https://drive.google.com/uc?id=17ihoEGjXqC5qVXXM1yWqjYO93QjilZQHRw --- * 概要 [#summary] `JSpinner`の値が上限または下限になった場合、対応する`ArrowButton`を無効にしてクリック不可にします。 #download(https://drive.google.com/uc?id=17ihoEGjXqC5qVXXM1yWqjYO93QjilZQHRw) * サンプルコード [#sourcecode] #code(link){{ UIManager.put("Spinner.disableOnBoundaryValues", Boolean.TRUE); }} * 解説 [#explanation] - `UIManager.put("Spinner.disableOnBoundaryValues", Boolean.FALSE)` -- 境界値になっても`ArrowButton`は有効だが、値は変更されない -- `MetalLookAndFeel`、`NimbusLookAndFeel`、`WindowsLookAndFeel`などでのデフォルト - `UIManager.put("Spinner.disableOnBoundaryValues", Boolean.TRUE)` -- 境界値になると`ArrowButton`は無効になり、クリック不可で値は変更されない -- `GTKLookAndFeel`でのデフォルト -- `MetalLookAndFeel`の場合のみ?、起動中に切替可能 * 参考リンク [#reference] - [[JSliderでマウスドラッグによる値の変更が可能な範囲を制限する>Swing/DragLimitedSlider]] * コメント [#comment] #comment #comment