在Java中,如果我想设置一个JLabel
的值当我点击一个JButton
,我可以这样的代码吧...设置一个Android的TextView的价值,当我点击一个按钮
JButton button = new JButton("add");
JButton label = new JLabel();
public void addListenersToButtons(){
button.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
if (src == button) {
label.setText("this is the number = " + number);
}
}
我希望能够在Android中做类似的事情,当用户点击一个按钮时,我设置了一个TextField
的值。 Android中这个适当的代码是什么?
必须在互联网上有10k个例子...... – 2012-04-17 12:35:12
必须要研究最少5-10分钟的问题。 – 2012-04-17 13:01:25