When the user clicks a button, I want to show a popup form that should have at least two JTextFields and two JLabels, so using JOptionPane.showInputDialog is not a possibility.
When the user clicks a button, I want to show a popup form that
Share
You should at least consider one of the
JOptionPanemethods such asshowInputDialog()orshowMessageDialog().Addendum: The choice to use
JOptionPanehinges more on the suitability of modality, rather than on the number of components shown. See also How to Make Dialogs.Addendum: As noted in a comment by @camickr, you can set the focus to a particular component using the approach discussed in Dialog Focus, cited here.