We would like to know how to control JOptionPane showInputDialog position.
import javax.swing.JDialog; import javax.swing.JOptionPane; // www . java2 s. c o m public class Main { public static void main(String... args) { JOptionPane optionPane = new JOptionPane("Its me", JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, null, "Please ENTER your NAME here"); optionPane.setWantsInput(true); JDialog dialog = optionPane.createDialog(null, "TEST"); dialog.setLocation(10, 20); dialog.setVisible(true); System.out.println(optionPane.getInputValue()); } }