Java Redirector



Place Java Redirector applet on a Web page to open another Web page in the browser window. You can have it open another Web page in the same window or in another browser window. You can set the size, background color, text color, font, font size, and display an images and text. The options are set in the applet tag.

How To Use:

  • Download javaRedirector.zip (16 KB)
  • Unzip with a compression utility.

    Excerpted Java Source:

    
     public void run() {
    		long t1,t2;
    		t1=getTime ();
    		boolean done=false;
         
         
        
        
        while (done==false) {
    	repaint ();
    
    	t2=getTime ();
    	if ((int) ((t2-t1)/1000) >= delay && !paramUrl.equals ("Error")) {
    	try {
    	URL url = new URL(paramUrl);
    	if (paramPage.equals ("same") || paramPage.equals ("SAME"))
    	   getAppletContext().showDocument(url, "_self"); //Redirect to the new page
    	else getAppletContext().showDocument(url, "_new");
    	} catch (MalformedURLException f) { }
    	done=true;
    	}
    	 try {
    			t.sleep (100);
    		 } catch (InterruptedException ie)  { return; }
    
        }// while true
    }// run
    

    Sample HTML Source:

    
    <APPLET CODE="redirector.class" WIDTH=500 HEIGHT=200>
    <param name="URL" value="http://www.xdebugx.net">
    <param name="PAGE" value="new">
    <param name="delay" value="0">
    <param name="IMAGE" value="asmback.gif">
    <param name="stretchimage" value = "yes">
    <param name="text" value="You are being redirected to www.xdebugx.net">
    <param name="font" value="Arial">
    <param name="fontsize" value = "20">
    <param name="backcolor" value = "yellow">
    <param name="textcolor" value = "red">
    </APPLET>
    

    Status: Free

    Author: Jeremiah McLeod

    Homepage: http://www.xdebugx.net/redirecotr/javaRedirector.html

    Upload Date:
    Jan 20, 2005

    How to Add Java Applets to Your Site

    New on the Java Boutique:

    New Review:

    Time Management Made Easy with the Quartz Enterprise Job Scheduler
    Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

    New Applet:

    Reverse Complement
    Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

    Elsewhere on internet.com:

    WebDeveloper Java
    Lots of Java information on webdeveloper.com

    WDVL Java
    Thorough Java resource at the Web Developer's Virtual Library.

    ScriptSearch Java
    Hundreds of free Java code files to download.

    jGuru: Your View of the Java Universe
    Customizable portal with online training, FAQs, regular news updates, and tutorials.