ksodari
ksodari

Reputation: 67

Making a editable form in java netbeans

How can I design a editable form as in detail of a person by clicking edit button and edit the respective fields of person's details and save it on the same place where they are shown.

eg.

Full Name : JTextField1
Address: JTextField2
and so on...

Now What I want is to save those values on respective places and when I want to edit them then show editable textfield with same values displayed. Are there any API's or plugins to do it or should I just have to do as setVisible(true/false) for necessary action to perform??

Upvotes: 2

Views: 448

Answers (1)

user4979686
user4979686

Reputation:

If you are using JavaFX, you can use setEditable(boolean), which will disable or enable the field for editing. You can also use setDisabled(boolean) to disable the field for anything other than viewing.

If you are using Swing/AWT, you can use setEditable(boolean) as well as setEnabled(boolean) to do the same as JavaFX.

Since you are using Swing/Awt, use setEditable to disable or enable the fields when you press the Edit button. :)

Upvotes: 1

Related Questions