Ok, so from my point of view, my code is pretty decent to get the grades passing, but I am having trouble adding a simple refresh / shuffle button. DO NOT USE JOptionPane Aids. Eclipse doesn't seem to recognize that I created a button that doesn't make sense to me at all, because it tells me something about Node, which Button is actually Node, and it's created. But when I switch to another class and add another button with an example of 3 lines, it just works. But when I go to my home program, it just gives me an error in the add method, which breaks the whole program! He speaks
"The add (Node) method in the type list is not applicable for arguments (Button)"
Can anyone shed some light on where I might be wrong in my code? It should be something like a Node to convert strings or something that I just can't understand. Wanting to take any hints provided to me, but please DO NOT SOLVE THE PROBLEM FOR ME.
Here is the question from the book mainly. "Write a program that allows the user to click the refresh button to display four cards from a deck of 54 cards."
I just need help on this button. I literally rest.
Here is my code. I left the import because there are too many of them.
import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.stage.Stage; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import java.awt.Button; import java.io.File; import java.util.ArrayList; public class Cards extends Application { public void start(Stage primaryStage) { ArrayList<String> cards = new ArrayList<>();
source share