Im creating a GUI where if the user clicks a Button the button will then disable so you cannot press it anymore then I need the name of the button to be changed. For example a button is called "Press me" and then when pressed it is then called "Button pressed" anyone know how to do that??
To find the button, you need to look at your code. Somewhere in there you find where at least one jButton object is created. Look for code along the lines of:
It will take some sleuthing on your part, but only you have the source code so you'll have to look it up. Once you have the the name of the jButton variable, you'll need to look for the buttons action. This method is where you'll place your call to jButton.setEnabled(false).
If this is a bit technical for you I can only suggest you find a good swing tutorial, read and step through it. It will really help.
- Tim Manchester
Paul de Wit
posted 12 years ago
Thats all I needed to know can't believe I couldn't find it on the web anywhere it was so simple!!
machines help you to do more, but experience less. Experience this tiny ad: