2011-03-16 6 views

답변

21

EventHandling, ActionListener을 찾고 계십니까?

또는 코드?

JButton b = new JButton("Clear"); 
b.addActionListener(new ActionListener(){ 
    public void actionPerformed(ActionEvent e){ 
     textfield.setText(""); 
     //textfield.setText(null); //or use this 
    } 
}); 

또한 이전의 코멘트에 링크 된 질문에 대한 대답에서
How to Use Buttons

+0

고맙습니다. – Monte