I am a novice in Swing so I need help from you... I have a situation here :
In one JFrame I have multiple JPanels.
In each JPanel I have 1 JLabel , 1 JTextfield & 1 JButton .
Now clicking on the JButton a small JFrame opens up where the user can search for a particular user.
Now if he wants to select the user , he has to select the JRadioButton against it.
Now I want here is that when he clicks the Add button then that small JFrame should be closed and the selected User ID should be populated in the respective JtextField of the JPanel.
Can anyone help me in this situation.
Note I am able to close the small JFrame by invoking JFrame.dispose(); but how should I populate the JTextField.
The whole concept highlights about selecting a User from a Popup and adding it to the Parent JTextField.
How about using JOptionPane? The "message" parameter can be anything, including entire JPanels with contents.
However, maybe a single selection JList (inside a JScrollPane) is a better option for selecting the user.
Hi Rob Sir,
But in my small JFrame (It is a Popup )
I have 3 JTextFields(User ID , First Name & Last Name) as Search Parameter and a Search JButton.
Now after providing any of the 3 values when I click on the Search Button.
I am populating a JTable with 3 columns a) User ID (JRadioButton), b) User Name & c) Email Address.
And two Jbutton "ADD"(which will add the User in the Main JFrameTextField) & "Exit" which will only close the Popup.