Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JFrame を作成すると、JFrame の上部にあるものが自動的に「選択」されます。
JFrame/JDialog の上部にあるものはすべて、JButton、JTextField など「選択」されます。マウスを使用して他の領域をクリックせずに (コードを使用して) 選択を解除するにはどうすればよいですか。
jButton1 は、JFrame の上部にあるものを意味します (Snagit を使用してキャプチャしますが、ボタンは自動的に「選択解除」されます)。
私を助けてください。感謝
を使用してJFrameを表示した後setVisible(true)。次の行を使用して、JFrame にフォーカス リクエストを設定します。
setVisible(true)
frame.requestFocus()