Client-Side Development Section Index | Page 3
What are the main differences between applets and applications?
Applets are created to be embedded within a browser. As such, they have methods that are automatically called by the browser at certain times: init() when first loaded, start() when page loaded/en...more
How do I select a row (or rows) in a JTable?
In the Model-View-Controller (MVC) world of Swing, the JTable
is just a display mechanism. Instead of selecting rows in the table (view), you select rows in the selection model:
ListSelectionMode...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
What is a peer?
AWT uses native code (code specific to a single operating system) to display its components. Each implementation of the Jave Runtime Environment (JRE) must provide native implementations of Button...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
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 I create an image (GIF, JPEG, etc.) on the fly from a servlet?
To create an image or do image processing from Java, there are several
packages and classes available. See the Purple Servlet References for a list.
Once you have an image file in your servlet...more
How can I highlight some text in an inactive textfield?
Here is a sample for you.
import javax.swing.*;
import java.awt.*;
import javax.swing.text.*;
public class TpHighlight extends JFrame {
String tf_str="Hello this is a demo for High Lighting...more
SSN Validation Are there any guides to validating social security numbers?
The first three digits of an SSN map to the location where the number was requested. The Social Security Administration maintains a list of valid digit mappings at http://www.ssa.gov/foia/stateweb...more
Why doesn't the Windows L&F use the same Fonts as Windows?
Why doesn't the Windows L&F use the same Fonts as Windows?
Why don't they just use the SAME? I know they do try to follow the Windows settings (even more in 1.4!) But, still, the fonts (the mos...more
Ensuring that previous graphical objects do not get erased with every repaint I'm trying to create a MS-Paint Style whiteboard for collaborative work across the net.
Ensuring that previous graphical objects do not get erased with every repaint
I'm trying to create a MS-Paint Style whiteboard for collaborative work
across the net.
Any previously drawn graphical...more
Browser Page idle for 3 minutes Is it possible to find out if the browser page is idle for some time and prompt to the user?
Hi,
This is a very simple html page that after a 1 minute (set with the IDLE_TIME variable) of total inactivity, it will diplay an alert box.
The "total" inactivity is defined using the <script...more
Is it possible to trigger events as each frame of an animated GIF89A image is displayed?
It seems that you can't. The image trigers a new "onLoad()" event every time the animation restarts from the first frame, but there is no way to trap the event of a frame change.
How can an applet detect whether it's running behind a firewall or not?
There is no sure way, a problem compounded by the fact that there is no single definition of what a "firewall" is.
In many places there is no direct IP connectivity through the firewall...more
How can I detect when a user has bookmarked a site? Is there any method to trap the event?
No, it's impossible: the browsers don't notify the page when the user does the bookmark (i.e. from the menu or also with keys shortcuts), so you cannot catch the event, not even with JavaScript.more