File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Issue with Applet and setting Applet Stub? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Issue with Applet and setting Applet Stub?" Watch "Issue with Applet and setting Applet Stub?" New topic
Author

Issue with Applet and setting Applet Stub?

Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Okay so I'm using Netbeans IDE with Java FX and an applet.... My applet worked completely fine until I threw it into the FX package to include a graph.


When I run the project it gives me this error




When I do a Test project it will run only after I've ran the main project. Any changes I have done after I will have to rerun and then test again. My Applet normally didn't have a main method, so I would run it through a random class I made called Delta. With the FX Package it will only run the Delta class.

For some reason I remember having an error wiht the image icon class so I changed all of my images and it worked when running the project, but now I get the applet sub issue....

This happens when I have Browser or Web Start selected in the properties.


Also I updated my Netbeans and downloaded the EE version and such. For some reason it runs via Glassfish folder, so I'm not sure if that has anything to do with it..

This is what happens when I use "Standalone" in the properties....



It now stops at run, and wont do anything after that......


The main class I use is.




Edit: Now I got an error about accessing another class and after getting rid of that(since I took the code and put it into my applet) it's giving me the stub issue........





MY stub is set to null....

THoughts? .


[Thumbnail for code problem..png]

Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

The method setStub() requires permission to execute, and the applet is not granted such permission by default.
I don't understand why you need to call that method? As it is done automatically by the system.


PM Me If You Want to get Urgent Help on Java Programming
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Nam Ha Minh wrote:The method setStub() requires permission to execute, and the applet is not granted such permission by default.
I don't understand why you need to call that method? As it is done automatically by the system.



This is why I'm confused.... it's set to null by the system, and the Netbeans GUI form.... Since you are saying it requires permission maybe I'm not doing something correctly... My key should be auto-signed as well...



EDIT: Correctly my self-signer was off....


Howerver now when I try to Run/Test my project it will do everything, then it will say:



This is when I do standalone. Now when I do it webstart it gives me this error.




Test doesn't work in standalone either.... It's weird because test was working completely fine until yesterday....

Now this is saying I don't have the absolute layer set up.... Normally that's set up when I use a gui form, and I took my gui form and placed it into the FX Package to get my FX Code. Maybe the Absolute Layer and netbeans code doesn't work for WebStart? Which shouldn't be correct since it worked before. Maybe it's because I'm not in a gui form class? But why would it work standalone and not webstart?
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498


EDIT: Correctly my self-signer was off....


yeah, sign the applet will solve the permission problem.

Maybe the Absolute Layer and netbeans code doesn't work for WebStart?


The absolute layout comes with NetBeans (not with JDK), so you have to put that library along with the applet's jar file also.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Nam Ha Minh wrote:
EDIT: Correctly my self-signer was off....


yeah, sign the applet will solve the permission problem.

Maybe the Absolute Layer and netbeans code doesn't work for WebStart?


The absolute layout comes with NetBeans (not with JDK), so you have to put that library along with the applet's jar file also.



Yeah thanks, I was thinking abut that, and then when you said about permissions it clicked about the signer...

I basically created an Applet Form in a normal Java Package, then moved everything to the FX Package. I imported the SWing Extensions Jar and a couple others, maybe I didn't get the Absolute One..... I'll check into that;).



Also why does Standalone do NOTHING? The only thing that Webstart does different is it says "Executing (Filepath)"

The absolute layout is already in my Libraries, as well s the clas sbeing there.....


[Thumbnail for Codepoo.png]

Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

Also why does Standalone do NOTHING? The only thing that Webstart does different is it says "Executing (Filepath)"


Standalone requires main() method to execute. Do you have main() method inside the applet?

The absolute layout is already in my Libraries

Did you specify this library when using <applet> tag?
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Nam Ha Minh wrote:
Also why does Standalone do NOTHING? The only thing that Webstart does different is it says "Executing (Filepath)"


Standalone requires main() method to execute. Do you have main() method inside the applet?

The absolute layout is already in my Libraries

Did you specify this library when using <applet> tag?


Yeah I have a main as posted above, sometimes it's on, sometimes off depending.

Where do I specify it in the applet tag? The code is all generated for me.


Apparently it now works when I created a new FX-in-Swing package in the new 7.3 Beta 2.

Only Browser works(which is what I need) Webstart doesn't appear, it will run through everything, even the console is up, but it wont show my applet.

IT works in Browser with or without a main method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue with Applet and setting Applet Stub?