Mark,
You need to put stuff in the environmnet prior to making any calls
that
would cause the GUI to start. In my apps I do it in the main routine,
before calling anything else.
So it should be something like:
void main()...
// set up platform UI specific stuff here...
if ( System.getProperty( "os.name" ).startsWith( "Mac OS" )) {
// Mac Java 1.3
System.setProperty( "com.apple.macos.useScreenMenuBar",
"true" );
System.setProperty
( "com.apple.mrj.application.growbox.intrudes", "true" );
System.setProperty( "com.apple.hwaccel",
"true" ); // only needed for 1.3.1 on OS X 10.2
System.setProperty
( "com.apple.mrj.application.apple.menu.about.name", "Visitour" );
// Mac Java 1.4
System.setProperty( "apple.laf.useScreenMenuBar", "true" );
System.setProperty( "apple.awt.showGrowBox", "true" );
// Mac Java 1.5
// TBD...
}
try {
String s;
if ( myProps.getPropertyB( NATIVELAF ))
s = UIManager.getSystemLookAndFeelClassName();
else
s = UIManager.getCrossPlatformLookAndFeelClassName();
if ( false )
s = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
UIManager.setLookAndFeel( s );
s = null;
} catch (Exception e) {
System.err.println( "Error Initializing Look and Feel: " + e);
e.printStackTrace();
}
Hope that works for you,
Larry