更新时间:2023-12-02 23:05:34
如果你想要你的话当你的GUI显示时,要关注 JTextField
,你可以使用它:
If you want your JTextField
to be focused when your GUI shows up, you can use this:
in = new JTextField(40);
f.addWindowListener( new WindowAdapter() {
public void windowOpened( WindowEvent e ){
in.requestFocus();
}
});
其中 f
将是你的 JFrame
和中的是您的
JTextField
。