hello,
How can I type info into a JTextField, then when I click a button pass the info. to another method ?
so far I have :
middlePanel.add(new JLabel("LastName"
);
JTextField LastName = new JTextField();
middlePanel.add(LastName);
JButton Add = new JButton("Add Patron"
;
middlePanel.add(Add);
Add.setSize(20,10);
Add.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
DO I NEED TO PASS LASTNAME here to the METHOD ??
System.out.println("Add button pressed"
;
}
});
thanks for any hints.
How can I type info into a JTextField, then when I click a button pass the info. to another method ?
so far I have :
middlePanel.add(new JLabel("LastName"
JTextField LastName = new JTextField();
middlePanel.add(LastName);
JButton Add = new JButton("Add Patron"
middlePanel.add(Add);
Add.setSize(20,10);
Add.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
DO I NEED TO PASS LASTNAME here to the METHOD ??
System.out.println("Add button pressed"
}
});
thanks for any hints.