Compilation Problem with DefaultComboBoxModel
Created by: wsmithjr
After commit "Implement proper closing and main fix" I am not able to compile the nbFoldingLoader project.
In class SwitchContextDropdown this statement
dropdown.setModel(new DefaultComboBoxModel<String>(new String[]{
FoldingDataEditorSupport.EXPRESSION,
FoldingDataEditorSupport.STATEMENTS,
FoldingDataEditorSupport.CLASS, "TODO-regular"}));
gives the error:
type javax.swing.DefaultComboBoxModel does not take parameters
dropdown.setModel(new DefaultComboBoxModel<String>(new String[]{
any idea?
Imported comments:
By VolkerL on 2013-08-24 19:50:45 UTC
It could be related to the generic <String> thing. I compiled against Java SE 7, if you use 6, it will not work.
Try removing the <String> part.
By wsmithjr on 2013-08-24 20:28:25 UTC
Thanks. I configure Netbeans to use JDK 1.7 (can't believe I have to update etc/conf file manually) and it does compile.
But the program has some other issues that was not shown in previous version (before "Implement proper closing and main fix").
-
When creating a new project, it complains about the project name already exists. It seems like the project is created at least twice during the action.
-
Deselect "Create Main Class" solves this problem. However, a java.io.IOException occurs when creating a new class in the default package.
-
Creating and executing a java class works, if condition 1 and 2 are not met.
By VolkerL on 2013-08-25 00:38:58 UTC
Do the errors still occur? Or does the fact you closed it mean it's fixed?
I personally do not have point 1 or 2. Are you sure you have your read/write access configured properly for the folder Netbeans tries to create the project in?
By wsmithjr on 2013-08-25 09:32:13 UTC
I still have the errors, but the main issue was solved by using JDK 1.7, so I closed this issue. I tested it on the normal NetBeans IDE, and it works normally. But yes I still have the errors mentioned in point 1 and 2.
By VolkerL on 2013-08-25 11:02:15 UTC
I will try to fix #12 (closed) now. Maybe a cleaner setup will make the source of your errors more transparent.