I need to modify the action taken when closing a Jframe

Asked

Viewed 37 times

0

I am developing an application with persistence in Java for a college job, and I need the system to automatically save the data when closing the application (with a ready function provided by the teacher).

My question is this: is there a way to eliminate the default close button created by Netbeans, or modify the action taken by clicking the button?

Thanks in advance.

Application link

1 answer

2


If there is, in netbeans the most practical way is to click with the right button on top of your jframe and go into properties.. in the first line will already have a defaulCloseOperation... has 4 options.. also another idea is to create an event that saves your application before literally closing the program.. this you can do for example by clicking on your frame with the right button>>Events>>Window>>windowClosing>>

this event will be called at the close of the window..

Browser other questions tagged

You are not signed in. Login or sign up in order to post.