import javax.swing.JFrame;Output
import javax.swing.JOptionPane;
public class Inputdialog {
public static void main(String[] args) {
JFrame frame = new JFrame("");
String return = JOptionPane.showInputDialog(
frame, "名前を入力してください","ダイアログ",
JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
import javax.swing.JFrame;Execution:
import javax.swing.JOptionPane;
public class Inputdialog {
public static void main(String[] args) {
JFrame frame = new JFrame("");
オブジェクト[] selection = {1,2,3,4,5,6};
String return = (String) JOptionPane.showInputDialog(
frame, "インデックスの選択",
"ダイアログ",
JOptionPane.QUESTION_MESSAGE,
null, selection, selection[0]);
System.exit(0);
}
}
ImageIcon icon = new ImageIcon("question.png");Execution:
Object[] selection = {1,2,3,4,5,6};
String back = (String) JOptionPane.showInputDialog(frame, "インデックスの選択",
"ダイアログ",JOptionPane.QUESTION_MESSAGE,
icon, selection, selection[0]);
Please disable your ad blocker and refresh the window to use this website.