Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help for button

 
Max Horstmann
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I need help to give life for a button. Could you tell me how could I call the reset method in the interface class where I replaced the question marks. I tried everything but couldn't make that button work thanks.

interface.java




Board.java
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried there and what happened? If all the variables are in scope it should be as simple as shouldn't it?
 
Max Horstmann
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply but that didn't work. Didn't I need a field first to call method in different class? Such as;

Board reset;

Board.reset(reset);

Something like this.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you pass the Board object to the interface constructor, so that you can save it for when the code needs it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic