How can I validate parameters without creating a separate dialog?

I'm going to make an application (in Swing) that uses a tree to visualize a data structure (JTree). A tree will be on the left side of a window. The user will be able to browse a tree. The parameters of every tree node will be displayed on the right side of the window. The example windows will be looking like this

===========================
| tree panel | data panel |
|            |            |
|            |            |
|            |            |
---------------------------

The problem arises when a user wants to change that data. when should I validate them ? The easy approach is to open a new modal dialog (JDialog) and let the user to change this data in it. Validation of data would take place in an "ok" button listener method but this is a little clunky. I would like to allow the user to edit those data right in the data panel. In that case when should I validate them?

Is there a pattern of such solution in Swing?

Or any online tutorial how to do it?

Thanks in advance.

Answers


Dialogs are bad.

Immediately discard any complete nonsense input immediately. For instance, typing a letter in the numerical field (use Document filters). Don't beep. Don't require any particular commit step. You may have retain partially entered data.


Need Your Help

Should summed effective addresses 'wrap' in PowerPC? If so, how?

assembly powerpc

For example, the PowerPC book I, section 3.3.2, defines the lbz instruction as:

Issues with reset hard

git

I have been working on my repository for a while but recently received a strange status on one of my files which I will name file.py (I will also name the current branch as my_branch). I am not sur...