• Post Reply Bookmark Topic Watch Topic
  • New Topic

trouble acessing changeing the value of an outer class from an inner one  RSS feed

 
charlie fisher
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All , I'm hoping you can help me . I am trying to change a boolean value in my outer class from false to true using the code below when a button is pressed. its pretty much working BUT the trouble I am having is with this MyGridPanel.this.setOperatorUsed(true) ; what I am trying to get to happen is the second time the button is pushed the boolean should now be true and the else part of the if statement run . what actually happens is the boolean retains its original false value . I'm obviously missing something fundamental about scope between inner and outer classes here and would be very grateful if any one can give me a kick in the right direction to understanding why my code below is not changing the value to true, and how i can start finding a solution to sort it out.

its really begining to hurt my head now LOL

Thank you in advance for your help

Charlie


 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try changing your MyGridPanel class like thisI presume that your buttonHandler is an inner class in MyGridPanel?

And welcome to JavaRanch
 
charlie fisher
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:I presume that your buttonHandler is an inner class in MyGridPanel?

And welcome to JavaRanch


Hi Campbell yes that's right its an inner class in My Grid Panel thank you I will give that a try now

Charlie
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!