AD321
02-15-2005, 11:21 AM
Hi, basically what i'm attempting to do is pass a URL string using java script to an applet, and then on the applet the string is displayed and the user clicks on a 'go to url' button and is taken to that address, currently i can get the applet to print the URL, but i clueless as to how i can go about re-directing the user to the url...if anyone can help that would be mch appriciated, i have posted my code below, thanking you in advance,
-Arthur
import java.awt.*;
import java.applet.*;
public class getname extends Applet
{
String URL;
private Button clickButton;
public void init()
{
clickButton = new Button("Go to URL");
add(clickButton);
setBackground(Color.white);
}
public void paint(Graphics g)
{
g.drawString("You have Entered" + this.URL, 15, 15);
}
}
-Arthur
import java.awt.*;
import java.applet.*;
public class getname extends Applet
{
String URL;
private Button clickButton;
public void init()
{
clickButton = new Button("Go to URL");
add(clickButton);
setBackground(Color.white);
}
public void paint(Graphics g)
{
g.drawString("You have Entered" + this.URL, 15, 15);
}
}