Hello,
I'm writing a game that has an Advert class. At the start of the game, an ArrayList<Advert> will be deserialized from file, containing all the adverts. I'm also writing an Advert Editor to create/edit an ArrayList<Advert> and serialize it to file. The Editor looks like this :
The problem I'm having : when you push the "Previous", "Next" or "New Advert" button, everything goes fine except the values in the fields are only updated when they are related to a
String (Title & Description). The fields related to an int (Bonus, Penalty, Minimum Viewers, ...) or boolean (XRated Mandatory & Forbidden) always keep their value. My guess is that I must be overlooking something in the following 2 methods that are called from the button's actionlisteners. The first one updates the text of the Swing components using the getters of the active advert in the ArrayList. The second one does just the opposite : it calls the setters of the active advert in the ArrayList with the values from the Swing components.
Anyone who could give me a hint what I might be doing wrong ?
[ October 25, 2008: Message edited by: Bert Deville ]