The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
July 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Boutton

Posted by Mahmoud Zeid on August 14, 2000 at 5:15 PM

Hi

1-I am new in java programming for that I would like some sources code for when I click the mouse (click button will be load new page document html.)

2- button for next and review

3- whey my code doesn't working
Thank you,
Best regard
Mahmoud Zeid

E-mail mmiz@usa.net


import java.applet.*;
import java.awt.*;
import java.net.URL;
import java.net.MalformedURLException;

public class lesson extends Applet {
URL myURL= null;

public void init() {
Button button = new Button("Start");
add(button);
validate();

try {
myURL= new URL(getDocumentBase(), "mypage.html");
} catch (MalformedURLException e) {}

}

public boolean action(Event event, Object o) {
getAppletContext().showDocument(myURL, "html");
return true;
}
}



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us