As a preface: I know the code is rough — I just picked up Java this past week so I could make this thing cross platform for an experiment such that even my students would OS X machines could participate in a study.
So I’ve tested it on about 10 windows machines now with no problem, but on OS X, frame3 shows up with no panels at all (e.g. just a blank frame). I’m compiling on an OS X machine now and I see the following console output:
Exception in thread "main" java.lang.IllegalArgumentException: cannot add to layout: constraint must be a string
at java.awt.CardLayout.addLayoutComponent(CardLayout.java:190)
at java.awt.Container.addImpl(Container.java:1072)
at java.awt.Container.add(Container.java:363)
at Reflexology1.<init>(Reflexology1.java:150)
at Reflexology1.main(Reflexology1.java:51)
The code is posted at http://pastebin.com/t3vqa0s6
Does anybody know what might be causing this problem under only OS X?
JVM 6 only allows non null
Stringconstraints forCardLayout.JVM 7 also allow
null-value and replaces it by the emtpyString("")You are probably using one version on one platform and the other one on the other.