user786
user786

Reputation: 15

Keeping data in window after closing it. Netbeans

this maybe a stupid question but I'm having an issue on how I can keep the information I've entered saved into Netbeans. I have a system that book groups into rooms and the user of the system will input a lot of information into it. Every time the user closes the window at the end, all information is lost and they have to enter all the information in again.

Is there a way in which I can leave data stored in Netbeans, so every time the user opens the window it's still available for the user to change?

Thanks.

Upvotes: 0

Views: 420

Answers (1)

npinti
npinti

Reputation: 52185

What you could do would be to make your application persistent. In Java, the 2 main approaches to this is to either:

  • Make your application use a database (through JDBC) or
  • Make your application use a file system with serialization methodologies such as XStream

The most standard way is to provide a Save button which explicitly stores the information upon the user's request.

Another option would be to capture the closing event which the window throws just before closing. This previous SO post should point you in the right direction.

Upvotes: 1

Related Questions