Problem is, whenever I run this I only get the title and then a grey square, none of my GUI shows at all. I don't know where I am going wrong with this, if I run my CopyBinarySearchTreeDisplay.Java from within Eclipse IDE it shows perfectly in the applet viewer.
Can anyone help me out with this? Is it a setting on my PC, although other htmls which Eclipse generated for me work its just Eclipse no longer generates.
I also created my GUI via netbeans as a form and then had to convert it to an applet and copy the code to Eclipse - would this have any bearing on the problem?
Yeah, I created it in the same directory as the class file, which is C:\workspace\CopyofBinaryTreeSearch.
Not sure what your question means I've afraid? I don't know whar a package directive is, where would I look for this?
In the directory, if it helps, I have the following files listed:
.classpath
.project
CopyBinaryTreeAction.class and .java
CopyBinaryTreeDisplay.class and .java
CopyBinaryTreeDisplay.html
CopyTreeNode.class and .java
java.policy.applet
Also include in this in the applet tag
CODEBASE = "."
If there is, say a first line in your code like:
package project;
Then your class file should be in the directory 'project' under the directory where
your html file is and the tags class spec should be
code = "project.SomeClass.class"
But first you should check if your class file is found, the status bar should indicate
that. If your applet bugs out during the initiation process, it will say something like
"applet xxxx not initiated' you can check that by bringing up the java console, in IE
thats: Tools -> Sun Java Console
I have checked and my class has no project listed at the top.
When I run the html, it runs an applet and says done in the bottom left - so it looks as though it is working - although not picking up my clas file presumably, hence no display of buttons etc.. just a grey box?
Did you mean to go to Tools -> Sun Java Console from within Internet Explorer..? If so, I couldn't find this.
public void init()
{
btd = new CopyBinaryTreeAction();
btd.generateTree(); // call generateTree method from BinaryTreeAction to setup tree ready for paint
I put the html in top directory and made a devx1 directory under that for
the class files.
If you omit the package directive then just put the class files in same
folder as the html and leave out the dev1. prefix of the class file name in
the applet tag.
I need to get the html to work at college as I want to check the size of the screen - to see if its OK for the pooled computers resolution.
If I take all the files I sent you to college and then run the html from there - in theory should this work? And then if not, I could try your suggestion on package setting?
Thanks very much for your patience and help with this!
If it doesn't work on your computer it must be that you have not set IE properly.
Click Tools->internet options and select the "advanced" tab. Search the list of
selections and select "Use Sun JRE", "Enable java Console" and "JIT compiler"
If that does not work then download and install the JRE from SUN
NOTE: Your class file name was wrong in your html
IF you try loading the URL i posted on one of your school's pcs it had better work
Bookmarks