Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Unable to run the setTest method import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.layout.BorderPane; import javafx.concurrent.Task; import javafx.event.EventHandler; import

Unable to run the setTest method

import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.layout.BorderPane; import javafx.concurrent.Task; import javafx.event.EventHandler; import javafx.event.ActionEvent;

public class TootAndOtto extends Application implements EventHandler{ private static TootAndOtto theObject; private int row = 6; private int col = 6; private Button[][] button = new Button[row][col]; private boolean nextT = false; private boolean clickMade = true; private boolean won = true; private boolean filled = false;

@Override public void start(Stage primaryStage) { theObject = this; GridPane gridPane = new GridPane(); Button[][] button = new Button[row][col]; for(col = 0; col

} public void handle(ActionEvent e) { Button b = (Button)e.getSource(); int c = findCol(b); int r = findRow(b); setText(b); System.out.println(c); System.out.println(r);

} public int findCol(Button b) { int c = GridPane.getRowIndex(b); return c; } public int findRow(Button b) { int r = GridPane.getColumnIndex(b); return r; } public void setText(Button b) { int c = GridPane.getRowIndex(b); int r = GridPane.getColumnIndex(b); button[r][c].setText("x"); } public static void main(String[] args) { Application.launch(args); }

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions

Question

Write the prime factorization of each number. 1. 25 2. 16 3. 105

Answered: 1 week ago