Posts Tagged ‘showInputDialog’

Example Code #2 – JOptionPane JCombobox

December 21st, 2008 No comments

This code shows how to add ComboBox property to JOptionPane.showInputDialog. And the class is able to take an input from this combobox

import javax.swing.JOptionPane;

public class Options {

	public Options() {

		String smallList[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
				"Thrusday", "Friday", "Saturday" };

Read more…

VN:F [1.9.22_1171]
Rating: 7.1/10 (8 votes cast)
VN:F [1.9.22_1171]
Rating: +4 (from 4 votes)

Example Code #1 – JOptionPane and ArrayList

December 20th, 2008 No comments

Here this class takes some values using JOptionPane.showInputDialog and shows them to the user using foreach loop

import java.util.ArrayList;
import javax.swing.JOptionPane;

public class Confirm {

ArrayList fruits = new ArrayList();

String value = "";
while (true){
value = JOptionPane.showInputDialog("Which fruit to Add?");

Read more…

VN:F [1.9.22_1171]
Rating: 6.7/10 (7 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)