abdel
Posts: 11
Nickname: caram
Registered: May, 2003
|
|
Re: how can i call one applet with another??
|
Posted: May 28, 2003 1:50 AM
|
|
I've this code:
import java.awt.*; import java.applet.*; import java.net.*; import java.awt.Label;
public class PropertyChecker extends Applet { URL url1; URL url2; String str1 = "file:///C://devlopment/applet.html"; String str2 = "file:///C://devlopment/test.html";
public void init() { add( new Button( "Button" ), BorderLayout.SOUTH );
add( new Label( "system name:" + System.getProperty( "os.name" ) ) ); add( new Label( "architecture: " + System.getProperty( "os.arch" ) ) ); add( new Label( "version: " + System.getProperty ( "os.version" ) ) );
}
public boolean action( Event evt, Object arg ) { try { url1 = new URL(str1 ); getAppletContext().showDocument( url1 ); } catch( MalformedURLException e ) { System.out.println( "Error " + e ); } return true; } } I can call another applet but just wehn I click a button I want that this applet is being called automaticly otherwise a HTML page with an error
please help me!!
|
|