Java tutorial
import javax.swing.JFrame; import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { JFrame frame; Object[] options = { "A", "B", "C", "D" }; int choice = JOptionPane.showOptionDialog(null, "Nuovo Prodotto", "Scegli il prodotto", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]); if (choice == 0) { System.out.println("0 selected"); } else { System.out.println("Something else selected"); } } }