Swing 選擇欄彈出的使用
import javax.swing.*;
public class MyJOptionPane {public static void main(String args[]) {
Object[] obj2 ={ "足球", "籃球", "乒乓球" };
String s = (String) JOptionPane.showInputDialog(null,"請選擇你的愛好:\n", "愛好", JOptionPane.PLAIN_MESSAGE, new ImageIcon("icon.png"), obj2, "足球");
}
}