Hi my first language is German so bear with my English i am new to programming so kindly help me
I have login form which has 4 textfields username ,password, unit code ,unit code name after writing user name and password when i focus on unit code textfield another form pop up i have used Jlist and populate it with unit codes values from database and i have select button at the button of list it works fine according to my requirement
next step is when select unitcode in jlist and hit the select button it select the jlist value and fetch the unit name from database table and it should close the jlist pop up form and go back to login form and set the 4th textfield from unit name which retrieves from the previous form i hope i make you understand the code for the button is
one logic is this.close(); but it how to set value in unit name textfield in login form?
i cant use new login().setVisible(true); it create new form and i want to go back to my previous form
In the login form i have 4text field username password unit code when focus on unit table jlist form open just like pop up window the purpose for this jlisf form is to select unit code number so that when user select unit code 4th field populates automatic with unit name hope it makes sense
In the login form i have 4text field username password unit code when focus on unit code textfield jlist form open just like pop up window the purpose for this jlist form is to select unit code number then query runs fetch unitcode name from where unit code match and then jlist form close and redirect to login form and set value of unit code in unit code text field and unit name in unitname textfield
Just tell me how to go back to previous form(login)
Can't you get the reference of your original login form object inside your jButton1ActionPerformed method code ? If you get that you can easily call setVisible(true) on that object after calling this.setVisible(false) inside jButton1ActionPerformed method.
Yes i can use reference of login but it open new login form and username and password field become empty user has to enter username and password again.
In the login form if i enter username and password then focus on third field jlist form open
If i use reference like
Login log= new login();
Login.setvisible(true);
Then it open new login form but i want to go back to previous login form where username and password already set in the text field