I was working on a simple GUI program to send short messages to a remote device.. The title of the messages are saved on a list after the messages are sent such that the user can select to view previously sent messages.
I have got the first part working perfectly but my program doesn't remember anything after each run. The list will be empty after running the program each time. Here is my code. I used Netbeans IDE to design the interface but I did the event handling part. Adding items to the list starts from line no. 96.
There is too much code for us to go through. In line 121, you appear to add something to listModel. Where do you store that for future runs? What does the new List using listModel as a constructor parameter do? Is it created before or after you add to listModel?
You are going to have to do some debugging, using the NetBeans debugger, or adding print instructions, to see what you have in the list model and the list as you execute your application.
subject: My program forgets about previously stored elements