simpler call to JSObject.eval

This commit is contained in:
beard%netscape.com 1999-04-11 23:41:38 +00:00
parent 9d40543f13
commit 9b0d85dbd9

View File

@ -32,13 +32,17 @@ class AboutBox extends Frame {
// Annoying use of flow layout managers.
Panel labelPanel = new Panel();
Panel buttonPanel = new Panel();
Panel fieldPanel = new Panel();
labelPanel.add(new Label("This applet's about box..."));
buttonPanel.add(okButton);
fieldPanel.add(new TextField(20));
fieldPanel.add(new TextField(20));
add(labelPanel, "North");
add(buttonPanel, "Center");
add(new TextField(), "South");
add(fieldPanel, "South");
// test menu bar stuff.
MenuBar menuBar = new MenuBar();
@ -106,7 +110,10 @@ public class TrivialApplet extends Applet {
URL location = new URL(urlField.getText());
System.out.println("going to URL: " + location);
JSObject window = JSObject.getWindow(TrivialApplet.this);
window.eval("alert('going to location " + location + "');");
if (window != null) {
//window.eval("alert('going to location " + location + "');");
window.eval("println(" + location + ")");
}
getAppletContext().showDocument(location, "_new");
} catch (MalformedURLException mfue) {
}