[Solved] How to handle JTextField value retainment without add it into a Dialog? [closed]


To solve the problem declare the textfield as static:

//JTextField Declaration and Initialization 
static JTextField NODES_TEXT_FIELD = new JTextField();

After that catch the value of the TextField:

int  nodes = Integer.valueOf(NODES_TEXT_FIELD.getText());

In my case was an int value, switch yourself; After that clear the value of the textfield cos it will be stored since the component is static, if you dont do this after dispose the dialog and open again you will see the last value used.

NODES_TEXT_FIELD.setText("");

Special thanks to @kleopatra

1

solved How to handle JTextField value retainment without add it into a Dialog? [closed]