JFrame myframe = new JFrame("My Sample Frame");
JButton mybutton = new JButton("Okay");
有人可以向我解釋這些部分。JFrame ActionListener
mybutton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
//Assuming that the content here will do something.
}
訪問(http://stackoverflow.com/questions/5335161/how-does-this-method-work) – 2011-06-14 14:33:33