[JavaFX][Dynamic Programing: Largest Sub Matrix O(n 2 ) time][Suggestions?] Usin
ID: 670203 • Letter: #
Question
[JavaFX][Dynamic Programing: Largest Sub Matrix O(n2) time][Suggestions?]
Using JavaFX, We are supposed to:
-Create a 10x10 matrix of TextFields, each containing 0 or 1.
-A reset button allows a new random generation of 0s and 1s.(The user is also allowed to change the TextFields manually).
-Add a "Find largest sub matrix" button that when clicked will highlight the LARGEST SQUARE MATRIX THAT CONSISTS OF 1s ONLY.
I've reviewed codes that perform what I need but only in the NetBeans output, however having trouble since that was using Integers and not TextFields.
Can someone please give me a detailed outline on how I should approach this problem using JavaFX? (Subclasses? How i should handle the actionevents of buttons reset and find largest sub matrix?)
My code so far:
-Uses a TextField[][] in the Stage and creates the 10x10 matrix of Textfields containing 0s and 1s randomly
-Implemented buttons, but now sure how to handle
-Will highlight Textfields that contains 0s (was just a test to see how to highlight a textbox, used txtfield[][].setStyle(-fx-background-color: red)
^ I do not understand how I would go about highlight boxes if I had methods outside of Stage though.
Book Example of what output should be :
Refresh Find Largest Block Refresh Find Largest BlockExplanation / Answer
findlargetBlockButton.setOnAction(new EventHandler() { @Override public void handle(ActionEvent e) { //Here find the largest square matrix of 1's //Now highlight the respective entries //txtfield[][].setStyle(-fx-background-color: red) } }); rereshButton.setOnAction(new EventHandler() { @Override public void handle(ActionEvent e) { //clear all the text fields // and regenrate 0s and 1s randomely and assign the text field as in your initalization method. } });Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.