• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Controling the browser

Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to control the left hand side or my browser window ("mainFrame") from the applet I have embeded in the right hand frame. I wrote a simple applet before consisting of just one class and it worked fine using the following code, I had no problems;

However I am now trying to do the same thing, except that I am editing the code of a much more complicated applet. This applet is spread out over about 15 classes and is called in my web page as a .jar file.
The place where I need to use the code above is in one of these classes that the main class calls to deal with mouse movements.
It gives compilation errors -
Seems I cant use the getCodeBase() or getAppletContext().showDocument ... methods - is this because they are not in the main class where the applet is defined and set up? -The class Im trying to use them in dosnt necessarily know that the application is being run as an applet. is this the problem? and is there an obvious way around it?
Im a little out of my depth here.

Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

getCodeBase() or getAppletContext()

You're correct that those classes can only be used from the class extending Applet (see here for details). You'll need to get hold of a reference to that class
Lasagna is spaghetti flvored cake. Just like this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic