JComboBox留下了一条线索

时间:2015-03-26 17:06:50

标签: java jcombobox

每当我使用JComboBox时,它都会留下下拉列表

Here is what it looks like

我不确定这是不是一个错误,谢谢你的帮助!

 public String[] regLogStrings = {"Login", "Register"};
public JComboBox regLog = new JComboBox (regLogStrings);
public JLabel lblText = new JLabel ();

ublic void registerState()     {         // Graphics2D g2d =(Graphics2D)g;         //g2d.fillRect(100,100,100,100);

    JFrame frame = new JFrame ("MP3 Collector");

    regLog.setSelectedIndex (1);
    regLog.addActionListener (this);
    regLog.setBounds (100, 100, 100, 30);
    //frame.getContentPane ().add (lblText);
    frame.getContentPane ().add (regLog);

    frame.getContentPane ().add (new TestingJFrame ());
    frame.setSize (1024, 768);
    frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
    frame.setLocationRelativeTo (null);
    frame.setResizable (false);
    frame.setBackground (new Color (41, 62, 107));
    frame.setVisible (true);

0 个答案:

没有答案