Hey /g/ I need some help.
I'm currently working with JavaFX and am stuck on what seems to be a very basic assignment. I just need advice on one area as I prefer to do my assignment myself and learn, i just can't seem to find this anywhere.
I need to construct 3 different objects.
A display of a stickfigure hanging, like the end result of a game of hangman
a clock that points at a random time each time the program is run and has my name at a horizontal between the 9 and 3
and 4 circles in a rectangle that kinda look like fans, they have like 4 triangle shapes in each circle
anyway... my problem is i'm trying to get them all to display in one scene but I don't know how..
i've been using
getChildren().add(TopKek);
getChildren().........
but it doesn't display all of them. How do i get all of my objects to display in one scene?
Sorry if this is unclear.Thanks!
ur a faget
>>53744925
Thanks mate!
>>53744914
>but it doesn't display all of them. How do i get all of my objects to display in one scene?
What the fuck? How do you not know this? This is the kind of shit they teach you before even learning about buttons.
>>53745111
I'm not taking a JavaFX class. My teacher kinda through this assignment at us to see if we could do it.
This is my first time with JavaFX
>>53744914
You put objects in a scene.
Then you "show" a scene at the stage.import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage stage) {
Group root = new Group();
Scene scene = new Scene(root, 500, 500, Color.BLACK);
Rectangle r = new Rectangle(25,25,250,250);
r.setFill(Color.BLUE);
root.getChildren().add(r);
stage.setTitle("JavaFX Scene Graph Demo");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}