Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How to get the reference of the caller Dialog insiede a SelectionAdapter

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i've this situation




Once pressed the button i need to pass to the controller the reference of the Dialog that fired the event. How i can do that considering that i can't use "this" ?
 
Marshal
Posts: 64667
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean MyDialog.this?

But why do you need to pass the reference? Why would a method need a reference to a JDialog?
 
Luk Cora
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Do you mean MyDialog.this?

But why do you need to pass the reference? Why would a method need a reference to a JDialog?


Into the dialog i have a form and once it is submitted, i need to render the data plus additional information inside a table contained in the same Dialog. This addiotional information are returned from a controller (another class)
So: i compile the form into the dialog (view). I send the inserted data to the controller that performs some additional operations. The controller should call the method updateTable(parameters to set) contained in the Dialog class. But if i've not the reference to this Dialog how i can call the method?
 
Campbell Ritchie
Marshal
Posts: 64667
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said, try MyDialog.this
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!