Hey,
I have a problem that I've been messing with for several hours, but with no result. I have a basic textfield where I can enter some info and I have to be able to read it and save it to a static variable by both pressing "Enter" and clicking on a simple JButton.
Here is the keyboard listener, but I have no idea how to do the same stuff with mouse... thanks!
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class KastiKuulaja implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
Manguvali.kasutajaSisend = e.getActionCommand().toLowerCase();
}
}