JOptionPane with drop down list java
package com.mkyong.inputDialog;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
public class InputDialog6a {
public static void main(String[] args) {
String[] options = {"I adore turtles", "Yes", "Maybe", "Urm...", "No", "Hate them"};
ImageIcon icon = new ImageIcon("src/images/turtle32.png");
String n = (String)JOptionPane.showInputDialog(null, "Do you like turtles??",
"I like turtles", JOptionPane.QUESTION_MESSAGE, icon, options, options[2]);
System.out.println(n);
}
}
Copy
Also in Java:
- java type casting
- how to compare two maps in java
- how to change actionbar color in android programmatically
- set java
- get raondom from array java
- how to limit double decimal places java
- output statement java
- JOptionPane with drop down list java
- java infinitew recursion
- java check if directory exists
- compile java
- Unrecognized option: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
- string a int java
- get value textfield java
- java nextpermutation
- append to arraylist by index java
- java find if element of list in present in another list
- Java use Base64
- query java persistence
- cordova cannot find symbol import com.google.firebase.iid.FirebaseMessagingService;
- add certificate to java truststore
- sum of arraylist java 8
- android java add new record to Firebase Firestore
- javafx fill tableview with data