The title says it all :-)
My scenario is operated purely by clicking the Act-button, the Run-button is never used.
But I need buttons e.g. to start and stop music playing. I tried the following in my Button-class:
But this leads to a Stackoverflow-error.
Is there any other solution in sight?
Thanks in advance!
1 2 3 4 5 6 7 8 9 10 11 | public Button() { this .waitForButtonClicked(); } private void waitForButtonClicked() { while (!Greenfoot.mouseClicked( this )) { this .waitForButtonClicked(); } System.out.println( "Button was clicked" ); this .waitForButtonClicked(); } |