Answers for "how to use OptionPane.showConfirmDialog()"

0

how to use OptionPane.showConfirmDialog()

package com.mkyong.confirmDialog;

import javax.swing.JOptionPane;

public class ConfirmDialog2a {

    public static void main(String[] args) {

        int input = JOptionPane.showConfirmDialog(null, 
                "Click ok if you are ok", "Be ok!", JOptionPane.DEFAULT_OPTION);
        // 0=ok
        System.out.println(input);

    }
}
Posted by: Guest on April-30-2022
0

how to use OptionPane.showConfirmDialog()

package com.mkyong.confirmDialog;

import javax.swing.JOptionPane;

public class ConfirmDialog3 {

    public static void main(String[] args) {

        int input = JOptionPane.showConfirmDialog(null, "Do you want to proceed?", "Select an Option...",
				JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.ERROR_MESSAGE);
		
	// 0=yes, 1=no, 2=cancel
	System.out.println(input);

    }
}
Posted by: Guest on April-30-2022
0

how to use OptionPane.showConfirmDialog()

package com.mkyong.confirmDialog;

import javax.swing.JOptionPane;

public class ConfirmDialog1 {

    public static void main(String[] args) {

        int input = JOptionPane.showConfirmDialog(null, "Do you like bacon?");
        // 0=yes, 1=no, 2=cancel
        System.out.println(input);

    }
}
Posted by: Guest on April-30-2022
0

how to use OptionPane.showConfirmDialog()

package com.mkyong.confirmDialog;

import javax.swing.JOptionPane;

public class ConfirmDialog2b {

    public static void main(String[] args) {

        int input = JOptionPane.showConfirmDialog(null, 
                "Do you want to proceed?", "Select an Option...",JOptionPane.YES_NO_CANCEL_OPTION);

	// 0=yes, 1=no, 2=cancel
	System.out.println(input);

    }
}
Posted by: Guest on April-30-2022

Browse Popular Code Answers by Language