展开全部
JButton b = new JButton("Copy");
final JTextField sourceField = new JTextField();
final JTextField targetField = new JTextField();
b.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e)
{
targetField.setText(sourceField.getText().trim());
}
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询