Write Twice, Run Anywhere
Subject:   Write Twice, Run Anywhere
Date:   2002-09-22 18:50:11
From:   anonymous2
Your Java instruction in every case has been very helpful and I always look forward to your next tutorial. I created the Write Twice, Run Anywhere program in Project Builder on the Mac and wanted to comment on a few things.

1) When I compiled and ran the program in your first example (e.g. before the Arrrg!), the menu was not on the frame itself, it was where it was supposed to be (Arrrg - not!)???

2) I realized that creating a New Group in Project Builder does not create a new directory folder. However, I was able to create folders in the directory (MacGUI, WindowsGUI, commonGUI) and then use Show Info to change the classpath.

3) Although the program compiles, I haven't been able to build the application and I'm wondering if the following method could be the culprit (needs an " if "??). The log is referenced below. Thanks again for the tutorial instruction.

private JMenuBar getCorrectMenuBar(){
return new MacJMenuBar();
} else return new WindowsJMenuBar();

[LaunchRunner Error] MainFrame.main(String[]) threw an exception:
java.lang.NoClassDefFoundError: commonGUI/OpenMenuItem
at MacGUI.MacJMenuBar.<init>(
at MainFrame.getCorrectMenuBar(
at MainFrame.<init>(
at MainFrame.main(
at java.lang.reflect.Method.invoke(Native Method)

1 to 1 of 1
  1. Daniel H. Steinberg photo Code correction --
    2002-09-23 09:51:41  Daniel H. Steinberg | O'Reilly AuthorO'Reilly Blogger [View]

1 to 1 of 1