I have code for my Java project, and one of the classes is shown below, but when I want to run this code, I will get a compilation error in this class, one piece of code:
package othello.view; import java.awt.BorderLayout; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; import othello.ai.ReversiAI; import othello.controller.AIControllerSinglePlay; import othello.controller.AIList; import othello.model.Board; import othello.model.Listener; @SuppressWarnings("serial") public class TestFrameAIVSAI extends JFrame implements ActionListener, Logger, Listener { private static Border THIN_BORDER = new EmptyBorder(4, 4, 4, 4); public JComboBox<Object> leftAICombo; public JComboBox<Object> rightAICombo; private JButton startTest; private JButton pauseTest;
The error comes from two lines public JComboBox<Object> leftAICombo; and public JComboBox<Object> rightAICombo; , and error:
The type JComboBox is not generic; it cannot be parameterized with arguments <Object>
What is the problem?
source share