
Computer Architecture Simulation & Visualisation
Using the clipboard with JavaHASE applets
Purpose
JavaHASE applets contain full HASE simulation models of computer
systems which allow a user's own code and data to be loaded into
memory (modelled as ARRAYS). This can be done by editting the
existing contents of the various ARRAYS, but it is much more
convenient to be able to cut text from an edit window or a
Webpage and paste it into the ARRAY editing window.
To communicate data among applications with the copy & paste facility,
the system (Linux, Window, ...) uses the clipboard. To prevent
malicious applets from spying on information which goes to the
clipboard, standard security managers for applets do not allow access
to the clipboard. Happily, the security manager can be configured
manually, on the computer which launchs the Java Virtual Machine(JVM)
(appletviewer or Browser). This page explains how to configure the
security manager to be able to use the clipboard.
Principle
Basically, any java user can configure HIS OWN Security Manager with a
security policy file (See
complete information from Sun). On linux, each user who wants to
configure the JVM will launch from his/her account has to create or
modify the file ~/.java.policy to modify security manager properties.
On Windows, the simplest way is to modify the C:\Program
files\JavaSoft\JRE\1.3.1\lib\security\java.policy file. The
information in red may depends on the JVM release being used (1.3.1 or
other) and on the path in which the JVM has been installed. To check
the JVM installation path, go the windows 'Control Panel'(start
menu/Settings), click on the icon related to the JVM being used (Java
plug-in 1.3.1), go to the 'Advanced' bookmark, click on the 'Use Java
plug-in Default' list box and read the path into which your plug-in is
installed.
How to modify the java policy file
If the file already exists, add the following lines at the end of the
file. Otherwise, just create a file which contains these lines :
grant codeBase
"http://www.icsa.inf.ed.ac.uk/research/groups/hase/javahase/applets/*"
{
permission java.awt.AWTPermission "accessClipboard";
};
This means, to give a permission to access the Clipboard to any
applets the url of which starts with
http://www.icsa.inf.ed.ac.uk/research/groups/hase/javahase/
How to copy & paste
Copy any text from standard applications (Netscape, emacs, ...) using
the copy menu item from the edit menu. Then paste it into the edit
window with either CTRL+V or mouse middle button.
Return
to previous page
HASE Project
Institute for Computing Systems Architecture, School of Informatics,
University of Edinburgh
Last change 7/07/2003
Please contact our
webadmin with any comments or changes.
Unless explicitly stated otherwise, all material is
copyright © The University of Edinburgh.