Swing/ClearMnemonic のバックアップソース(No.3)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- バックアップ を表示
- Swing/ClearMnemonic へ行く。
- 1 (2012-12-13 (木) 15:43:41)
- 2 (2013-08-17 (土) 15:16:57)
- 3 (2015-10-21 (水) 16:54:04)
- 4 (2017-04-04 (火) 14:13:45)
- 5 (2017-04-20 (木) 17:47:51)
- 6 (2018-04-17 (火) 16:21:29)
- 7 (2020-04-10 (金) 21:00:21)
- 8 (2021-10-14 (木) 14:06:34)
- 9 (2025-01-03 (金) 08:57:02)
- 10 (2025-01-03 (金) 09:01:23)
- 11 (2025-01-03 (金) 09:02:38)
- 12 (2025-01-03 (金) 09:03:21)
- 13 (2025-01-03 (金) 09:04:02)
- 14 (2025-06-19 (木) 12:41:37)
- 15 (2025-06-19 (木) 12:43:47)
--- title: MnemonicをクリアしてJButtonを初期状態に戻す tags: [JButton, Mnemonic] author: aterai pubdate: 2012-01-30T16:49:29+09:00 description: JButtonに設定されたMnemonicをクリアして初期状態に戻します。 --- * 概要 [#j1e322f9] `JButton`に設定された`Mnemonic`をクリアして初期状態に戻します。 #download(https://lh4.googleusercontent.com/-VBCuKbB3hhs/TyZJM3aWNzI/AAAAAAAABIg/01Dscav-qV4/s800/ClearMnemonic.png) * サンプルコード [#x9d51d22] #code(link){{ button.setMnemonic(0); }} * 解説 [#nf8e58b1] - `setMnemonic(...)` -- `JTextField`の最初の文字を`JButton`の`Mnemonic`に設定 -- `JTextField`が空の場合は、`JButton`のラベルの先頭文字を`Mnemonic`に設定 - `clear Mnemonic` -- `Mnemonic`に`0`を設定して初期状態に戻す -- `button.setMnemonic(0);` //* 参考リンク * コメント [#o30ed92a] #comment #comment