I have written a Java application using Eclipse Juno on Fedora 17. I have JRE 1.7 installed, but I changed the Java build path to 1.6, I believe. Everything works fine there. I can then build a .jar file which runs on a Windows 7 virtual machine without problems. However, if I try to run it on the school computers (Windows 7
java version "1.6.0_18")
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)
it gives an exception like: java.lang.IllegalArgumentException: cannot add to layout: constraint must be a string. This is apparently something to do with CardLayout, which I believe is a standard Swing component.
I am using miglayout library and sqlite-jdbc driver if that could be related.
I would really appreciate help with this
I found the problem.
cardLayoutPanel is a JPanel
cardLayout is obvious
identifier is a String
turns out that in Java 1.6 this doesn’t really work because it should actually be:
without the second line
Java 1.7 doesn’t complain for some reason. Weird.