try {
String vendor = System.getProperty("java.vendor", "");
String version = System.getProperty("java.version", "");
String os_name = System.getProperty("os.name", "");
try {
String vendor = System.getProperty("java.vendor", "");
String version = System.getProperty("java.version", "");
String os_name = System.getProperty("os.name", "");
String platform_class = null;
//if (os_name.startsWith("Mac OS X")) platform_class = "MacOSX";
if (vendor.startsWith("Free Software Foundation")) {
if (os_name.startsWith("Window")) platform_class = "Win32";
String platform_class = null;
//if (os_name.startsWith("Mac OS X")) platform_class = "MacOSX";
if (vendor.startsWith("Free Software Foundation")) {
if (os_name.startsWith("Window")) platform_class = "Win32";
} else if (version.startsWith("1.1") && vendor.startsWith("Netscape")) platform_class = "Netscape";
else if (version.startsWith("1.1") && vendor.startsWith("Microsoft")) platform_class = "Microsoft";
else if (version.startsWith("1.4")) platform_class = "Java14";
else if (!version.startsWith("1.0") && !version.startsWith("1.1")) platform_class = "Java12";
} else if (version.startsWith("1.1") && vendor.startsWith("Netscape")) platform_class = "Netscape";
else if (version.startsWith("1.1") && vendor.startsWith("Microsoft")) platform_class = "Microsoft";
else if (version.startsWith("1.4")) platform_class = "Java14";
else if (!version.startsWith("1.0") && !version.startsWith("1.1")) platform_class = "Java12";
if (platform_class != null) {
platform = (Platform)Class.forName("org.xwt.plat." + platform_class).newInstance();
platform.init();
if (platform_class != null) {
platform = (Platform)Class.forName("org.xwt.plat." + platform_class).newInstance();
platform.init();
if (Log.on) Log.log(Platform.class, "XWT VM detection: vendor = " + vendor);
if (Log.on) Log.log(Platform.class, " version = " + version);
if (Log.on) Log.log(Platform.class, "XWT VM detection: vendor = " + vendor);
if (Log.on) Log.log(Platform.class, " version = " + version);
if (Log.on && Main.applet != null) Log.log(Platform.class, " browser = " + Main.applet.getParameter("browser"));
if (platform_class == null) {
if (Log.on && Main.applet != null) Log.log(Platform.class, " browser = " + Main.applet.getParameter("browser"));
if (platform_class == null) {
/** displays a platform-specific "open file" dialog and returns the chosen filename, or null if the user hit cancel */
protected String _fileDialog(String suggestedFileName, boolean write) { return null; }
/** displays a platform-specific "open file" dialog and returns the chosen filename, or null if the user hit cancel */
protected String _fileDialog(String suggestedFileName, boolean write) { return null; }
- if (os.indexOf("windows 9") > -1) {
+ if (os.indexOf("windows 9") != -1 || os.indexOf("windows me") != -1) {
+ // hack -- jdk1.2/1.3 on Win32 pop open an ugly DOS box; 1.4 does not
+ if (platform.getClass().getName().endsWith("Java12")) return null;
- } else if ( (os.indexOf("nt") > -1) || (os.indexOf("windows 2000") > -1) ) {
+ } else if (os.indexOf("windows") > -1) {
+ // hack -- jdk1.2/1.3 on Win32 pop open an ugly DOS box; 1.4 does not
+ if (platform.getClass().getName().endsWith("Java12")) return null;
} catch (Exception e) {
if (Log.on) Log.log(this, "Exception while reading from environment:");
if (Log.on) Log.log(this, e);
} catch (Exception e) {
if (Log.on) Log.log(this, "Exception while reading from environment:");
if (Log.on) Log.log(this, e);
public static Surface createSurface(Box b, boolean framed, boolean refreshable) {
Surface ret = platform._createSurface(b, framed);
ret.setInvisible(b.invisible);
public static Surface createSurface(Box b, boolean framed, boolean refreshable) {
Surface ret = platform._createSurface(b, framed);
ret.setInvisible(b.invisible);
- b.set(Box.size, 0, b.size(0) == 0 ? 10 : b.size(0));
- b.set(Box.size, 1, b.size(1) == 0 ? 10 : b.size(1));
+ b.set(Box.size, 0, b.size(0) < Surface.scarPicture.getWidth() ? Surface.scarPicture.getWidth() : b.size(0));
+ b.set(Box.size, 1, b.size(1) < Surface.scarPicture.getHeight() ? Surface.scarPicture.getHeight() : b.size(1));
Object titlebar = b.get("titlebar", null, true);
if (titlebar != null) ret.setTitleBarText(titlebar.toString());
Object titlebar = b.get("titlebar", null, true);
if (titlebar != null) ret.setTitleBarText(titlebar.toString());
if (cachedProxyInfo != null) return cachedProxyInfo;
if (alreadyDetectedProxy) return null;
alreadyDetectedProxy = true;
if (Log.on) Log.log(Platform.class, "attempting environment-variable DNS proxy detection");
if (cachedProxyInfo != null) return cachedProxyInfo;
if (alreadyDetectedProxy) return null;
alreadyDetectedProxy = true;
if (Log.on) Log.log(Platform.class, "attempting environment-variable DNS proxy detection");
if (cachedProxyInfo != null) return cachedProxyInfo;
if (Log.on) Log.log(Platform.class, "attempting " + platform.getClass().getName() + " proxy detection");
cachedProxyInfo = platform._detectProxy();
if (cachedProxyInfo != null) return cachedProxyInfo;
if (cachedProxyInfo != null) return cachedProxyInfo;
if (Log.on) Log.log(Platform.class, "attempting " + platform.getClass().getName() + " proxy detection");
cachedProxyInfo = platform._detectProxy();
if (cachedProxyInfo != null) return cachedProxyInfo;