FAQ
From JavaWIDE
Contents |
How can I write a program on this wiki?
Unless you are writing a program in the sandbox, you need an account to create your own programs. The JavaWIDE developers will host a limited number of school sites as we develop and test JavaWIDE. If you would like to become a participating school, email us at admin@javawide.org.
How is writing an application on JavaWIDE different from writing an application on my own computer?
Most everything is exactly the same. You can use System.out, System.in, and System.err in the console window just as you would on your own computer. The most apparent differences are:
- File output does not go directly to the server since this would be a security risk. Instead file output is redirected to a console window. For this reason, only text output files are possible.
- Network connections are not allowed.
- File input reads the file directly from the server if it is available, otherwise you can enter the contents of the file when you run the program. This also includes an option of uploading the file to the server (requires an account). For an example, see 'How do I read from files?'.
- When printing exceptions, you must explicitly print them to System.err. For example, use e.printStackTrace(System.err) instead of the empty parameter call to e.printStackTrace()
In general, writing an application on JavaWIDE does not allow you to violate any of the Applet security restrictions.
How do I read from files?
Take a look at this sample program. You just use a URL to get an InputStream given the name of a file as a String. From there you are able to read the file using a Scanner or by other means. A URL is needed instead of a File to avoid security restrictions placed upon applets (applets can't read from files on the client computers, only from URLs on the server).
Code on this wiki uses a flat file structure (directories are ignored).
How do I write to files?
Writing a file directly to the server is not possible using JavaWIDE because that would be a security risk. JavaWIDE redirects all file output to a console window that displays the contents of the file. These contents can be copied into your own text editor. Take a look at this sample program.
While you can upload files to the wiki, you cannot programmatically write files using the wiki because this would allow anyone to write anything to our server. For example, anyone would be able to write a virus to the server and bring down this entire website. In the future we may enable logged in users to write to files, but for now, that is not possible due to the security risk.
Code on this wiki uses a flat file structure (directories are ignored).
How do I load images, audio, and other media?
There are two answers to this question:
- Loading media to the wiki: just click on the Upload file link in the toolbox in the menu on the left. You have to be logged in to upload files.
- Loading media in a Java program: see Sample Applet. This program loads an image in an applet. The basic way you do this is to use the class to get the URL to the media, and use the URL much in the same way you would use a File in an application. Code on this wiki uses a flat file structure (directories are ignored).
How does it work?
The Java Wiki Integrated Development Environment works by integrating and customizing many technologies including MediaWiki, jEdit, Apache, PHP, Javascript, CSS, AJAX, and Sun's Java SE Development Kit. The developers are currently in pursuit of funding so that we can have the time to document, develop and distribute JavaWIDE (including the source code) to others for free under a GPL license.
- Privacy policy
- About JavaWIDE
- Disclaimers
- Powered by MediaWiki!









