看板 java 關於我們 聯絡資訊
因為我有用FocusListener事件的getOppositeComponent來取得相對元件 不過只有用滑鼠點擊Button的時候才有功用 假如我點Button1後再點擊Button2,此時焦點就跑倒Button2,而用 getOppositeComponent就能夠得到元件Button1。 但是我想用鍵盤輸入的同時,相對應的按鈕能focus在上面 例如按數字鍵5,此時相對應的Button就被focus。 請板上大大幫個忙吧! 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.122.128.156
howdou:button.requestFocus() 03/07 12:27
s35300792001:多謝樓上大大! 03/07 19:54