FAQ

From JavaWIDE

Jump to: navigation, search

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 is not allowed.
  • Network connections are not allowed.
  • File input is done through URLs (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).

How do I write to files?

Writing to a file is not possible using JavaWIDE because that would be a security risk. 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.

How do I load images, audio, and other media?

There are two answers to this question:

  1. 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.
  2. 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 Wiki 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 is not allowed to use File I/O due to security restrictions.

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.





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter