关于JAVA小应用程序运行的问题

来源:百度知道 编辑:UC知道 时间:2024/06/09 14:33:46
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Example64
{
public static void main(String[] args)
{
ComboBoxDemo myComboBoxGUI=new ComboBoxDemo();
}
}
class ComboBoxDemo extends JFrame implements ActionListener,ItemListener
{
public static final int Width=350;
public static final int Height=150;
String porList[]={"踢足球","打篮球","打排球"};
JTextField text;
JComboBox comboBox;
public ComboBoxDemo()
{
setSize(Width,Height);
setTitle("组合框使用示意程序");
Container conPane=getContentPane();
conPane.setBackground(Color.BLUE);
conPane.setLayout(new FlowLayout());
comboBox=new JComboBox(porList);
comboBox.addActionListener(this);
comboBox.addItemListener(this);
comboBox.setEditable(true);
conPane.add(comboBox);
text=new JTextF

class Example64 {

public static void main(String[] args) {
ComboBoxDemo myComboBoxGUI = new ComboBoxDemo();
}
}

class ComboBoxDemo extends JFrame implements ActionListener, ItemListener {

public static final int Width = 350;
public static final int Height = 150;
String porList[] = {"踢足球", "打篮球", "打排球"};
JTextField text;
JComboBox comboBox;

public ComboBoxDemo() {
setSize(Width, Height);
setTitle("组合框使用示意程序");
Container conPane = getContentPane();
conPane.setBackground(Color.BLUE);
conPane.setLayout(new FlowLayout());
comboBox = new JComboBox(porList);
comboBox.addActionListener(this);
comboBox.addItemListener(this);
comboBox.setEditable(true);
conPane.add(comboBox);
text = new JTextFiel