[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
JavaFX Help
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 6
Thread images: 1
File: JavaFX.png (4 KB, 200x87) Image search: [Google]
JavaFX.png
4 KB, 200x87
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);
}
}
Thread replies: 6
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.