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();
}
});
Where f
would be your JFrame
and in
is your JTextField
.
출처 : 스택오버플로우
'WebStudy > JAVA SWING' 카테고리의 다른 글
ActionListener 에서 component의 name 가져오기 (0) | 2015.06.05 |
---|---|
Window Builder (윈도우빌더) 활용 - 1 (0) | 2015.06.01 |