Thursday 15 August 2013

java - The type JComboBox is not generic; it cannot be parameterized with arguments -


In my java there is a code for my project and a class is shown below, but when I run this code I We will compile an error code in the square:

  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") The public-class testframe AIVSAI appraises JFrame ActionListener, logger, listener {Private stationary border THIN_BORDER = new blank border (4, 4, 4, 4); Public JComboBox & lt; Object & gt; LeftAICombo; Public JComboBox & lt; Object & gt; RightAICombo; Private JButton startTest; Private Jebton Pause Test;   

The error is with two lines public JComboBox & lt; Object & gt; LeftAICombo; and public JComboBox & lt; Object & gt; RightAICombo; And the error is:

Type JComboBox is not normal; It can not be parameter with logic & lt; Object & gt;

What's the problem?

Change the rows below

  public JComboBox & lt; Object & gt; LeftAICombo; Public JComboBox & lt; Object & gt; RightAICombo;   

to

  public JComboBox leftAICombo; Public JComboBox rights AICombo;   

Here only java7 started in JComboBox & lt; Object & gt; type parameter If you are using jdk below, then this error returns

No comments:

Post a Comment