aspose file tools*
The moose likes Applets and the fly likes net beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "net beans" Watch "net beans" New topic
Author

net beans

neelam aggarwal
Greenhorn

Joined: Jul 18, 2011
Posts: 19
hii...m new to this forum plzzzzzzz help...

i have just installed netbeans IDE 7.0 and tried to run my project (which executes fine when i run with traditional method using command prompt) based on image processing but applet viewer says that "start: applet not initialized" whereas compiling (term 'build' in net beans) is successful..

here m attaching 2 relevant java files while whole project have 3-4 more java files for image rendering.....

thanks in advance..



Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Try running the applet in a browser - if there are problems, then some error messages should be written to the Java Console.


Ping & DNS - my free Android networking tools app
neelam aggarwal
Greenhorn

Joined: Jul 18, 2011
Posts: 19
hey....thanks for reply........... but as i am new to net beans , i dunno know how to run in browser . so please tell how to do it....

and also if we have to do any changes in setting or code when we shift to net beans... thanks again...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Create an HTML file that contains the APPLET tag that you now have at the top of the Java source code. If you don't know how to create an HTML page, just copy a simple one from an HTML tutorial. You'll find much useful material linked in the AppletsFaq, not least about how to get started.
neelam aggarwal
Greenhorn

Joined: Jul 18, 2011
Posts: 19
it says following is the error in the console:

Java Plug-in 1.6.0_26
Using JRE version 1.6.0_26-b03 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\NiKiL
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------


load: class ImageFilterDemo not found.
java.lang.ClassNotFoundException: ImageFilterDemo
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: ImageFilterDemo
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Post the APPLET tag, and tell us where ImageFilterDemo.class is relative to the HTML file.
neelam aggarwal
Greenhorn

Joined: Jul 18, 2011
Posts: 19
this is the applet tag written in html file:


and i have placed all the files in default package under source package.
neelam aggarwal
Greenhorn

Joined: Jul 18, 2011
Posts: 19
.class files are under build-classes whereas the ImageFilterDemo.html is under build.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
If the classes are not in the same directory as the HTML file then you need to use a codebase attribute; see http://download.oracle.com/javase/1.4.2/docs/guide/misc/applet.html for details.
neelam aggarwal
Greenhorn

Joined: Jul 18, 2011
Posts: 19
thank you very much for your kind cooperation.... it executed successfully..
neelam aggarwal
Greenhorn

Joined: Jul 18, 2011
Posts: 19
I wanted to know how we can call another program of jAppletform in our main program(which we run & is of same type,a JAppletform), at the click of menu item....

as such we direct to another page at the click of the menu item..

details: i have made MenuBar with a menu 'image operations' having menuItems 'Blur' , 'Sharpen' etc.
and a second menu 'Msg encoding' having menuItems 'LSB encoding' , 'DCT encoding' ..

now for image operations performed successfully .... and have a another File 'LSB' for performing LSB encoding..

Now i want at the click of menuItem 'LSB encoding' it should redirect to File 'LSB' with all previous thing cleared on screen.

How can I do this...

thanks for your reply
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
I don't understand what it would mean to "redirect to a file" - do you mean applet? or web page?

AppletContext has a method showDocument that you can use to switch to a different web page.
neelam aggarwal
Greenhorn

Joined: Jul 18, 2011
Posts: 19
both are JApplets
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Do they have to be separate applets? Have you considered having just as single applet using a CardLayout for switching between the major functional areas?
neelam aggarwal
Greenhorn

Joined: Jul 18, 2011
Posts: 19
for cardlayout i have to make changes.. i will try for that but if there is some thing that i can do in menuitem actionperformed method so that it can call another whole program.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
I already told you how to switch to a web page containing a different applet. If that is not what you want, then describe in detail what it actually *is* that you are trying to achieve.

As to having to make changes, I think avoiding having to maintain two web pages with two applets, and the associated architectural difficulties trying to share data between them, are worth quite a bit of effort to fix.
neelam aggarwal
Greenhorn

Joined: Jul 18, 2011
Posts: 19
thanks for giving the idea of CardLayout and showDocument ........
here i again have a minor problem...

i am using NetBeans 7.0 and in JApplet Form using palette I am dragging and dropping menubar but is not visible in design....

but appears when executed..

it is also not showing any properties in property window and displays 'no property'...

can you please tell me where I am lacking..
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
IDE-specific questions fit better in the IDE forum.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: net beans