Here you can find the source of optionWindow(String message, String title, String[] options)
Parameter | Description |
---|---|
message | message to be displayed |
title | title of window |
options | array of options |
public static int optionWindow(String message, String title, String[] options)
//package com.java2s; //License from project: Open Source License import javax.swing.*; public class Main { /**/*from w w w .j a v a2 s . c o m*/ * This method will display an option dialog box * to get an index value of a given array of * options * * @param message message to be displayed * @param title title of window * @param options array of options * @return index of option chosen */ public static int optionWindow(String message, String title, String[] options) { return JOptionPane.showOptionDialog(null, message, title, JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, 0); } }