I went to the this java site -> http://www.doc.ic.ac.uk/~jnm/book/bo...aneBridge.html and loaded the files in a new project in netbeans 6.8 . I removed the package declaration and put them in the default package of the project. I tried to compile it by right clicking and selecting run(Shift + F6) on the SingleLaneBridge.java file. This program compiled without errors.
This is what I got :
see [pqh3k.jpg (18.6 KB)]
Then I tried another method, which included copying the java files to a folder and compiled them manually using commandLine. Then made an html file and put the reference to the SingleLaneBridge.class file. Still I got a similar grey screen with the buttons. Then I tried again by downloading the pictures and the sound file (Note: All this time images and the sound file were called from the website):
1)Red car
2)Blue car
3)Bridge
4)Crash sound file
Then I put the images in the folder where the notepad files were. The image and sound path(s) was set appropriately in the BridgeCanvas.java file so dont worry about that.
After this I tried it out in Eclipse as well. But the same gray applet window with buttons showed up.
Re: Cannot see the gui for the SingleLaneBridge java applet example
Originally Posted by Norm
Where Do you have the 3 images and the sound file for the applet?
Well when I tried in netbeans 6.8 and Eclipse also as you know already:
1) Netbeans 6.8 - it was in the src folder (this src folder is inside the SingleLaneBridge folder)
2) Eclipse - I put it in the SingleLaneBridge folder not the src folder
I have tried programs which use images before (i mean java application programs). So far I have developed only java applications not applets. In those application programs the image things work.
SideNote: Someone from another forum suggested to put the same images in all the folders and see if it appears. I did this too but it failed.
------------------------------------------------------------------------------------------------------------------------------
OK SINCE YOU ASKED I NOW I TRIED IN ECLIPSE PUTTING THE IMAGES IN EACH FOLDER AND GUESS WHAT
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.