Client-Side Development Section Index | Page 85
Can I use the Java2D capabilities with the 1.1 Java runtime environment?
The short answer is no. The libraries are part of the standard Java 2 platform release (starting with version 1.2). Since they modify core classes in the java.awt.* libraries, you can not pull the...more
How do I extend permissions to an applet without editing the policy file manually?
A: Short answer: Forget about Java 2 security (i.e. the policy file) when creating applets. No major web browser currently supports that security model. Instead, place the applet in ...more
How do I get the native window pointer to an AWT Window?
This capability is currently not supported.
How do I increase the number of applets I can have loaded before Netscape starts pruning them?
By default, Netscape limits the number of applets loaded to 10. when that limit is exceeded, older ones will become elligible for garbage collection. To increase the limit, you would call the setA...more
How do I let my Swing text component support undo/redo?
The Swing text components come with built in support for undoing and redoing text operations. All you have to do is associate an UndoManager to the Document of the text component:
JTextField textF...more
What is the syntax of the <APPLET> tag?
<APPLET
// Required
CODE = appletClass or
OBJECT = serializedApplet
HEIGHT = pixels
WIDTH = pixels
// Options
CODEBASE = codebaseURL
ARCHIVE = archiveList...more
Where can I get the Netscape capabilities classes so I can compile programs that use Netscape's Capabilities API?
Besides pulling the classes out of the browser directory, you can download a zip file of the classes from http://developer.netscape.com/docs/manuals/signedobj/capsapi_classes.zip.more
What's the deal with the different Swing package names?
History
When Swing first came out, Sun wanted to make it available for JDK 1.1.x, but have it be part of the core Java class libraries for the Java 2 platform (then known as JDK 1.2).
This presen...more
How do I get rid of the Unsigned Java Applet Window message at the bottom of windows/frames I create in my applet?
This is a security feature to prevent untrusted applets from displaying what appear like trusted windows. If you sign your applet and the user trusts you, the message will go away.
How can I setup a JTextField to only accept valid dates?
It depends what you mean by 'accept'.
You can validate the choice at three times:
As the user types characters
After the user is done with the field
After the user is done with the GUI
...more
How do I display a multi-line tooltip?
Check out the tooltip example from the Swing samples application that ships with the JDK. You can use embedded html tags in the text of the tooltip to produce the desired result in a platform inde...more
How do I download a (binary, text, executable) file from a servlet or JSP?
Solution 1: Just use HTTP! This has nothing to do with servlets per se. Make sure the file is on your web server. Then you can either embed a link for your user to click, as
<a href="run...more
When do I use adapter classes vs. interfaces in "new" expressions for event handling?
When you register an event handler, you must pass it an instance of some class that implements its listener interface.
Simple Event Handler
Start with a simple example. Suppose we want to print "...more
How do I open and redirect to a popup window from a servlet? (Under certain circumstances I want my servlet to bust out of the frames and redirect to another servlet or page.)
You can't do this directly but it is easy to do indirectly using JavaScript.
Essentially you return a page that has as its onLoad event code that opens a page and gets your new data.
Your servle...more
How do we build a TabbedPane component using AWT?
Swing provides a component called JTabbedPane that is rather good.
If you cannot (or don't want to) use Swing for some reason, there are several ways to do this.
The most common one is to create...more