6 import java.applet.Applet;
11 StringBuffer sb =
new StringBuffer();
13 public void run(String arg) {
15 sb.append(
"Java properties applets can read:\n");
22 show(
"file.separator");
23 show(
"path.separator");
25 String s = System.getProperty(
"line.separator");
40 sb.append(
" line.separator: " + str1 + str2+
"\n");
45 sb.append(
" code base: "+applet.getCodeBase()+
"\n");
46 sb.append(
" document base: "+applet.getDocumentBase()+
"\n");
52 sb.append(
"Java properties only applications can read:\n");
57 show(
"file.encoding");
59 show(
"java.compiler");
60 show(
"java.class.path");
61 show(
"java.ext.dirs");
62 show(
"java.io.tmpdir");
65 sb.append(
"Other properties:\n");
66 String userDir = System.getProperty(
"user.dir");
67 String userHome = System.getProperty(
"user.home");
68 String osName = System.getProperty(
"os.name");
69 String prefsDir = osName.indexOf(
"Windows",0)>-1?userDir:userHome;
70 if (
IJ.
isMacOSX()) prefsDir = prefsDir +
"/Library/Preferences";
72 sb.append(
" java 2: "+
IJ.isJava2()+
"\n");
73 sb.append(
" java 1.4: "+
IJ.isJava14()+
"\n");
74 sb.append(
" prefs dir: "+prefsDir+
"\n");
77 Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
78 sb.append(
" screen size: " + d.width +
"x" + d.height+
"\n");
79 sb.append(
" memory in use: "+
IJ.freeMemory()+
"\n");
85 void show(String property) {
86 String p = System.getProperty(property);
88 sb.append(
" " + property +
": " + p+
"\n");
93 sb.append(
"All Properties:\n");
94 Properties props = System.getProperties();
95 for (Enumeration en=props.keys(); en.hasMoreElements();) {
96 String key = (String)en.nextElement();
97 sb.append(
" "+key+
": "+(String)props.get(key)+
"\n");