I am working on a gui and I've got a two part question. I've got a jlist and a couple of buttons to add and remove components from the list. I've got everything working except for the keyListener. When the cursor is on the jList (hasFocus I assume?) and the enter key is pressed, its supposed to do the same thing as the add button and add the text to the list from the text box. I've read a couple of articles about the keyevents but I still done get it.. where or how can I start?
And the second part, I need to save the list to a file when the program is closed and populate the list from that file when the program is launched. I know I need to serialize the jList as it is using the defaultModel. On this one I dont even know where to start. What code do I put in what class and so on.
Thanks for the help!