Jump to content
  • 0

Source Compile Error


jinbobo

Question

I get this kind of error when I compile the launcher from source with maven.

[ERROR] .../TechnicPack-Spoutcraft-Launcher-d0dbc6f/src/main/java/org/spoutcraft/launcher/gui/LoginForm.java:[130,24] type javax.swing.JComboBox does not take parameters

Using:


  • [li]maven 3.0.4[/li]
    [li]mac os x 10.6/10.7[/li]
    [li]JDK 6[/li]

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Full error log


[ERROR] .../src/main/java/org/spoutcraft/launcher/gui/LoginForm.java:[130,24] type javax.swing.JComboBox does not take parameters

[ERROR] .../src/main/java/org/spoutcraft/launcher/Util.java:[42,53] type javax.swing.JComboBox does not take parameters

[ERROR] .../src/main/java/org/spoutcraft/launcher/Util.java:[50,53] type javax.swing.JComboBox does not take parameters

[ERROR] .../src/main/java/org/spoutcraft/launcher/Util.java:[58,48] type javax.swing.JComboBox does not take parameters

[ERROR] .../src/main/java/org/spoutcraft/launcher/gui/LoginForm.java:[180,29] type javax.swing.JComboBox does not take parameters

[ERROR] .../src/main/java/org/spoutcraft/launcher/gui/widget/CheckBoxNodeTreeSample.java:[146,7] type javax.swing.JList does not take parameters

[ERROR] .../src/main/java/org/spoutcraft/launcher/gui/widget/CheckBoxNodeTreeSample.java:[146,31] type javax.swing.JList does not take parameters

Source


0042 public static void setSelectedComboByLabel(JComboBox<ComboItem> combobox, String label)

0050 public static void setSelectedComboByValue(JComboBox<ComboItem> combobox, String value)

0058 public static String getSelectedValue(JComboBox<ComboItem> combobox)


0130 private final JComboBox<String> modpackList;

0180 modpackList = new JComboBox<String>(items.toArray(itemArray));


0146 JList<Image> list = new JList<Image>(new Image[] { im, im });

Link to comment
Share on other sites

  • 0

Sorry, can't really help. I just wondered if there was something obvious that had been done in the code, but without poking through the whole thing, I can't say...

Where did you get the source from anyway?

Thanks anyway, I dug through the documentation for Class JComboBox<E> but nothing resolved my problem.

Link to comment
Share on other sites

  • 0

I hate to be one of those people who just say "I had exactly the same issue, and i still can't figure it out"... but... but... well, yeah...

I had exactly the same issue, and i still can't figure it out

--EDIT--

Nevermind, found a solution, Really simple... just fix the syntax errors and get rid of the parameters in front of jComboBox (litterly just remove the <E> part)

everything compiles fine after that

Link to comment
Share on other sites

  • 0

Thanks

== Edit ==

Fix:


0045 From: public static void setSelectedComboByLabel(JComboBox<ComboItem> combobox, String label) {

0045 To: public static void setSelectedComboByLabel(JComboBox combobox, String label) {

..

0047 From: if ((combobox.getItemAt(i)).getLabel().equalsIgnoreCase(label)) {

0047 To: if (((ComboItem) combobox.getItemAt(i)).getLabel().equalsIgnoreCase(label)) {

..

0054 From: public static void setSelectedComboByValue(JComboBox<ComboItem> combobox, String value) {

0054 To: public static void setSelectedComboByValue(JComboBox combobox, String value) {

..

0055 From: if ((combobox.getItemAt(i)).getValue().equalsIgnoreCase(value)) {

0055 To: if (((ComboItem) combobox.getItemAt(i)).getValue().equalsIgnoreCase(value)) {

..

0061 From: public static String getSelectedValue(JComboBox<ComboItem> combobox) {

0061 To: public static String getSelectedValue(JComboBox combobox) {


0129 From: private final JComboBox<String> modpackList;

0129 To: private final JComboBox modpackList;

..

0179 From: modpackList = new JComboBox<String>(items.toArray(itemArray));

0179 To: modpackList = new JComboBox(items.toArray(itemArray));


0146 From: JList<Image> list = new JList<Image>(new Image[] { im, im });

0146 To: JList list = new JList(new Image[] { im, im });

Link to comment
Share on other sites

  • 0

This is because the Launcher was written against Java 7.

In Java 7 a lot of the Swing elements require parametrization If you want to solve this without removing the parameters and therefore maintain type safety install the java 7 jdk.

Link to comment
Share on other sites

  • 0

This is because the Launcher was written against Java 7.

In Java 7 a lot of the Swing elements require parametrization If you want to solve this without removing the parameters and therefore maintain type safety install the java 7 jdk.

Well, there is no JDK 7 release for mac, but there is a DP version which I don't intend to install.

Link to comment
Share on other sites

  • 0

Well, there is no JDK 7 release for mac, but there is a DP version which I don't intend to install.

Ok, if you don't want to install that the fix you have already found is fine, just thought I would mention the cause and an alternative fix.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...