I had a problem.. when I call a frame which is a GUI and push a button which will be disabled.. and my problem was how should it retain the disabled button if the GUI was called again.. please help.. can you give an example..

If you want to know whether button is disabled previously or make the button disabled even after closing the frame(or running the program again) , just save the state of the button to a file.

Suppose if the button is disabled , write an integer or boolean value to a file which indicates the state of the button.


Ex- If button is disabled. (write integer value 1 to a file)
1-indicates button is previously disabled
So initially the value must be 0

So next time when you open the jframe, read the value from the file.
If the value is 1 , then button is already disabled.
If the value is 0, then button is not disabled.

Not only integer , use any value to indicate the state of the button(as your wish).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.