Jump to content
  • 0

Source Compile Error


Question

Posted

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]

12 answers to this question

Recommended Posts

  • 0
Posted

I dont know mutch about recompile and decompile... that stuff.

But I think your problem is:

javax.swing.JComboBox does not take parameters

Hello, captain obvious :)

  • 0
Posted

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 });

  • 0
Posted

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?

  • 0
Posted

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.

  • 0
Posted

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

  • 0
Posted

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 });

  • 0
Posted

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.

  • 0
Posted

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.

  • 0
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...