Hey guys. I've recently started learning about GUI's, action events, and that whole shindig... I've been doing exercises out of my textbook. I recently got an exercise where I have to make a GUI with a text field and two buttons, one called upper case and one called lower case. When I press the upper case one it's supposed to make whatever I type in the text field turn upper case, and vice versa for the lower version. What I'm confused about is how exactly to write these two action listeners.
Every example that I've seen in the book embeds the action listener in the client program. However I don't see how I'd have an actionPerformed method for both the upper and lower case buttons inside the client program so I'd probably have to make two separate classes.
Now what confuses me about that is that the actionPerformed method, as far as I understand, is supposed to have something like textField.setText(textField.getField().toUpperCase ()) or vice versa for the lower case one. How would I be able to edit the textField from the client program through the separate action listener though??
Also, another question: one of the answer solutions to one of the exercises uses an action listener that is a private class that is INSIDE the public class that creates the GUI. How do these private classes work and what are their strengths/limitations? I never even knew these existed and the book never spoke of them.
Thanks a lot - knowing how to do use multiple action listeners to edit the components' fields will make the rest of the exercises a lot easier.