Forums Register Login

Trying to run applet in JEditor

+Pie Number of slices to send: Send
I'm attempting to place an open source applet that displays an SSH terminal (very nice piece of software called JTA) into my application. However, when I run my program I simply get an empty gray box where the internal editor frame is.

Here is my JInternalFrame:



Here is my Applet.class. I noticed it seems to have it's own init(), start(), stop(), etc., so I'm thinking if I can just call it correctly I don't need to init() or start() in my JInternalFrame, which is why I left them out.



Anyone have an idea about why my InternalJFrame isn't showing my applet?
+Pie Number of slices to send: Send
I'm confused. Is de.mud.jta.Applet your class, or the one you found elsewhere? If you found it elsewhere it should come with its own methods that you should leave alone. If it's your class, then which class are you trying to run?

http://www.acme.com/resources/classes/Acme/MainFrame.java can help you run an applet as part of an application.
+Pie Number of slices to send: Send
de.mud.jta.Applet is part of the JTA .jar. My understanding of it is that de.mud.jta.Applet does a lot of the stuff you would need to do yourself in your JFrame otherwise.

I'm trying to call Applet.class which will run numerous other classes once it's been correctly called.

The .jar is included in the build, libraries, and all that by the way.
+Pie Number of slices to send: Send
What you posted does not look like a functional applet - it doesn't have operational start, stop and init methods, nor a constructor. Where does that code come from, and what does it have to do with the problem at hand?
+Pie Number of slices to send: Send
I think I see what I'm doing wrong. Applet.class has methods. Just because I'm making an instance of the class doesn't mean I'm callng the methods.

So, adding init(); and start(); to JInternal Frame, I get a NullPointerException here:

+Pie Number of slices to send: Send
OK, OK! So posting all of this has gotten me thinking. (I'm pretty new to this, can you tell?) I have a JTA jar and a JTA developer's JAR, and looking at Applet.java it's VERY different than Applet.class! Perhaps I need to include the developer jar in my libraries and build and call this instead?

+Pie Number of slices to send: Send
 

Anthony Schmitt wrote:Perhaps I need to include the developer jar in my libraries and build and call this instead?



Yup. That's what the jar is for. Just put it in your application's classpath and use its classes as you see fit.
+Pie Number of slices to send: Send
I still recommend you look at the link I posted. Even if you end up not using that class, it will give you an idea of how to embed an applet in an application (like, from where and when to call the applet lifecycle methods).
+Pie Number of slices to send: Send
So I include BOTH the basic JTA and JTA-SOURCE Jars in my build?

I took out JTA and replaced it with the source jar, now import can't find de.mud.jta.*;
+Pie Number of slices to send: Send
 

Anthony Schmitt wrote:So I include BOTH the basic JTA and JTA-SOURCE Jars in my build?



My guess, based solely on the names of the jars, is that JTA-SOURCE contains the source code and that JTA contains the compiled classes.

I took out JTA and replaced it with the source jar, now import can't find de.mud.jta.*;



Which confirms my guess.
+Pie Number of slices to send: Send
You are correct, Paul.

Sadly, I'm still not any closer to getting the applet to run in my JInternalFrame.
+Pie Number of slices to send: Send
I think this is failing because it's trying to get info from a config file... this is where I get the nullpointer:

Your mother is a hamster and your father smells of tiny ads!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1443 times.
Similar Threads
Problem in Opening JPopupMenu
JMenuBar on the move
Menu applet refresh problem - please help
haveing trouble with applet animation plz help
tree in frame, frame in applet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:02:25.