我做了class a
:使用文本框输入预设值,然后打印出值
class a
int account
string first name
string last name
int balance
然后,我创建一个textfield
在class b
:
class b
textField_4 = new JTextField();
textField_4.setBounds(210, 123, 150, 30);
getContentPane().add(textField_4);
textField_4.setColumns(10);
JButton btnNewButton = new JButton("Enter");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
PrintStream diskWriter = new PrintStream("");
diskWriter.print("Account: ");
diskWriter.println(account);
我怎样写值在class a account
进入class b textfield
?
你想在哪里打印值? –
磁盘上的一些文件,我将添加后 –