I am trying to develop a sudoku solver and have developed the GUI class and i want a seperate Button class which affects the 9x9
grid in the GUI class.
How does the communication take place is it through passing arguements via methods or some other way?
If this is a GUI question, I shall move it to our GUIs forum.
posted 9 years ago
The gui as it is does what i want it to do. My problem is trying to get the New Puzzle button to communicate with the GUI
from the ButtonControl class. Paul Clapham has said it is through arguements being passed via methods, but i'm
still not sure how it is to be done.
In the Button class do i need the public ButtonControl() part or is there another way of implementing this?
Is your ButtonControl class supposed to be a separate JFrame from your main application? Why does it extend Gui?
Do you want it to instantiate a new Gui, or just to start a new game? If the former, you will have a reference to the Gui from when you instanitate it, so you can call methods on it directly. If you create your ButtonControl instance from a Gui instance, you can give your ButtonControl constructor a Gui argument, and pass "this" in the constructor call. Then have your ButtonControl store this instance as a private variable, so it can reference its "parent".
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!