advertisement

Article:
  Write Twice, Run Anywhere
Subject:   Code correction --
Date:   2002-09-23 09:51:41
From:   dsteinberg
Response to: Write Twice, Run Anywhere

Thanks for your note. Although I like a lot of what Apple has done, I am not a fan of Project Builder for Java development and don't use it. I'm guessing from your first issue that you created a new Java Swing project using Project Builder. When you do this, properties are set for you and the MRJ class files are linked without you knowing where they are.


As for item (2), that's one of the things I don't like about PB. I want there to be a correspondence between the directory structure and the packages. I agree with your comment, but wish it didn't require extra steps. The file management is almost like the iApps where you have playlists on iTunes and Albums in iPhoto. Again, if you like PB for Java programming, that's great. It is free and provides everything you really need.


I'm sorry for the error that led to your question (3). There is an entire line missing from the code. The original version of the code was this.



private JMenuBar getCorrectMenuBar(){
if (System.getProperty("mrj.version")!=null){
return new MacJMenuBar();
} else return new WindowsJMenuBar();
}

The corrected version of the code should have just inserted a line into this code -- I'm sorry for the mistake. Here's the corrected code.



private JMenuBar getCorrectMenuBar(){
if (System.getProperty("mrj.version")!=null){
System.setProperty (
"com.apple.macos.useScreenMenuBar","true");
return new MacJMenuBar();
} else return new WindowsJMenuBar();
}

The only addition is the System.setProperty() method call. Thanks again for catching this error. Sorry for the inconvenience.


Daniel


1 to 1 of 1
  1. Daniel H. Steinberg photo Code correction -- article has been fixed
    2002-09-24 11:20:47  Daniel H. Steinberg | O'Reilly AuthorO'Reilly Blogger [View]

1 to 1 of 1