Java JComboBox留下了一条痕迹

Java JComboBox留下了一条痕迹,java,jcombobox,Java,Jcombobox,每当我使用JComboBox时,它都会留下下拉列表的痕迹 我不确定这是否是一个错误,谢谢你的帮助 public String[] regLogStrings = {"Login", "Register"}; public JComboBox regLog = new JComboBox (regLogStrings); public JLabel lblText = new JLabel (); 公共无效注册表状态() { //Graphics2D g2d=(Graphics2D)g; /

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

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

 public String[] regLogStrings = {"Login", "Register"};
public JComboBox regLog = new JComboBox (regLogStrings);
public JLabel lblText = new JLabel ();
公共无效注册表状态() { //Graphics2D g2d=(Graphics2D)g; //g2d.fillRect(100100100100)


请将演示问题的代码发布为MCVE,我希望您知道。如果不知道,这可能是问题之一
    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);