我有我的項目在Java中的代碼,其中一個類如下所示,但是當我想運行此代碼時,我將在此類中得到編譯錯誤代碼的一部分是:JComboBox類型不是通用的;它不能被參數化參數<Object>
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;
的錯誤是由兩條線public JComboBox<Object> leftAICombo;
和public JComboBox<Object> rightAICombo;
和錯誤是:
The type JComboBox is not generic; it cannot be parameterized with arguments <Object>
問題是什麼?