Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Reference Applet from Dialog

 
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created an instance of a Frame from an an applet,
and then created a Dialog from the Frame, but how do I access variables that are in the main applet class from the Dialog?
Since the Applet was not really instantiated with "new", what is the syntax to reference it from the Dialog?
Thanks!
Drew
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can pass "this" to your Frame!!!
class TheApplet extends Applet
{
public int xxxx;
Frame fm = new Frame(this, ...);
}

class Frame
{
Frame( TheApplet myApplet)
{
myApplet.xxxx =5
}
}
 
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic