StringArrayOptionPopups.java Source code

Java tutorial

Introduction

Here is the source code for StringArrayOptionPopups.java

Source

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

public class StringArrayOptionPopups {

    public static void main(String[] a) {
        JFrame frame = new JFrame();

        Icon blueIcon = new ImageIcon("yourFile.gif");
        Object stringArray[] = { "Do It", "No Way" };
        JOptionPane.showOptionDialog(frame, "Continue printing?", "Select an Option", JOptionPane.YES_NO_OPTION,
                JOptionPane.QUESTION_MESSAGE, blueIcon, stringArray, stringArray[0]);
    }

}