Tag: ArrayList
Example Code #1 – JOptionPane and ArrayList
by Samet Kilictas on Dec.20, 2008, under Java, Programming
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();
Confirm(){
String value = "";
while (true){
value = JOptionPane.showInputDialog("Which fruit to Add?");

Thanks for dropping by! Feel free to join the discussion by leaving comments, and stay updated by subscribing to the 