codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  java button problem  dnew at 15:31 on Tuesday, February 15, 2005
 

Im not sure if htis is the right forum, so i'll apologise in advance;
Basically, i have an html page, i have created a html form containing a text box which takes a url and a button which passes this url to an applet (on the same page) and then displays this url on the applet.
Currently this is all my applet does-display the URL from the form ,however i have added a button to the applet and i want to be able to click on this button and open the URL in the same window.
Does anyone know how to do this?

This is my code do far:

HTML:
<form name="f1">
<b>Enter a website:p>
<input type="text" size="50" name="inurl">
<input type="button" value="Request URL" id="suburl" onClick="return validurl();">
</form>

<applet codebase="." code="javacode.class"
<param name="inurl" value="">
</applet>



JAVA:
public class javacode extends Applet
{
private Button clickButton;
String URL;

public void init()
{
URL = getParameter("inurl");

clickButton = new Button("Show URL");

}


public void updateURL(String newURL)
{
URL = newURL;
repaint();
}

public void paint(Graphics g)
{
g.drawString(URL,50 ,50);
}








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Print and print preview file on the website without using the File - Print on the IE
•  Re: ASP.NET web controls
•  Re: JavaSript Problem In Mac Safari Browser
•  Re: DHTML div positionning Problem
•  Convert script to NS6 compatible - Please Help!
•  Print .doc file from the website using System.Diagnostics.Process
•  Re: Fullscreen code
•  Re: iframe targeting
•  Excel n ASP


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005