• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trying to run applet in JEditor

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Saloon Keeper
Posts: 7590
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Anthony Schmitt
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Tim Moores
Saloon Keeper
Posts: 7590
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Anthony Schmitt
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

 
Anthony Schmitt
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Tim Moores
Saloon Keeper
Posts: 7590
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Anthony Schmitt
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.*;
 
Paul Clapham
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Anthony Schmitt
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are correct, Paul.

Sadly, I'm still not any closer to getting the applet to run in my JInternalFrame.
 
Anthony Schmitt
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this is failing because it's trying to get info from a config file... this is where I get the nullpointer:

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic