Article View: borland.public.jbuilder.java.language
Article #15432Newbie question - can't instantiate ...
From: Peter VanCaeseele
Date: Thu, 10 Jun 1999 00:00
Date: Thu, 10 Jun 1999 00:00
118 lines
3100 bytes
3100 bytes
I have built the simplest of applets, just a blank form (JBuilder 2.01 Pro).
When I run it in the IDE, I get a blank form.
I have used the Deploy wizard on this applet, trying both "No Archive" and
"Jar" options.
When I fire up the HTML file, IE5 says "load: test.test can't be
instantiated".
If I delete everything from the deploy directory, except the HTML file, IE5
says "load: test.test not found", so I'm assuming its not a <CODEBASE> or
<ARCHIVE> problem.
What am I doing wrong?
Thanks,
Peter
HTML file:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>
HTML Test Page
</TITLE>
</HEAD>
<BODY>
test.Test will appear below in a Java enabled browser.<BR>
<APPLET
CODEBASE = "."
CODE = "test.Test.class"
NAME = "TestApplet"
WIDTH = 400
HEIGHT = 300
HSPACE = 0
VSPACE = 0
ALIGN = middle
>
</APPLET>
</BODY>
</HTML>
Java file:
package test;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import borland.jbcl.layout.*;
import borland.jbcl.control.*;
file://import com.sun.java.swing.UIManager;
public class Test extends Applet {
XYLayout xYLayout1 = new XYLayout();
boolean isStandalone = false;
file://Construct the applet
public Test() {
}
file://Initialize the applet
public void init() {
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
file://static {
// try
// file://UIManager.setLookAndFeel(new
com.sun.java.swing.plaf.metal.MetalLookAndFeel());
// file://UIManager.setLookAndFeel(new
com.sun.java.swing.plaf.motif.MotifLookAndFeel());
// UIManager.setLookAndFeel(new
com.sun.java.swing.plaf.windows.WindowsLookAndFeel());
// }
// catch (Exception e) {}
file://}
file://Component initialization
private void jbInit() throws Exception {
xYLayout1.setWidth(400);
xYLayout1.setHeight(300);
this.setLayout(xYLayout1);
}
file://Start the applet
public void start() {
}
file://Stop the applet
public void stop() {
}
file://Destroy the applet
public void destroy() {
}
file://Get Applet information
public String getAppletInfo() {
return "Applet Information";
}
file://Get parameter info
public String[][] getParameterInfo() {
return null;
}
}
Technical Details
Message-ID:
<375ff7cd@news.nucleus.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,fead4e2ce6cee65d,start X-Google-Attributes: gidf74b3,public From: "Peter VanCaeseele" <peterv@nascor_nospam.com> Subject: Newbie question - can't instantiate ... Date: 1999/06/10 Message-ID: <375ff7cd@news.nucleus.com> X-Deja-AN: 487991518 X-Original-NNTP-Posting-Host: 207.34.64.200 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: abuse@tac.net X-Trace: iceman.tac.net 929036437 26488 199.45.65.8 (10 Jun 1999 17:40:37 GMT) Organization: Nucleus (Send spam complaints to abuse@nucleus.com) NNTP-Posting-Date: 10 Jun 1999 17:40:37 GMT Newsgroups: borland.public.jbuilder.java.language