[填空题] 下面类中,有两个下拉列表,一个可以选择月份,一个可以选择2000—2009年之间的年份。
import javax.swing.*;
public class Expiration extends JFrame
JComboBox monthBox = new JComboBox();
JComboBox yearBox = new JComboBox();
public Expiration ()
super("Expiration Date");
setSize (240,90);
setDefaultCloseOperation(JFrame.EXIT ON CLOSE);
JPanel pane = new JPanel();
JLabel exp = new JLabel ("Expiration Date:");
for ( int i = 0;i < 13;i++)
monthBox.addItem (" "+i);
for (int i = 2000;i<2010;i++)
yearBox.addItem(" "+i);
pane.add (exp);
pane.add (monthBox)
【12】 ;
setContentPane(pane);
public static void main(String[] arguments)
Expiration expiration= new Expiration();&