Skip to content
Snippets Groups Projects
Commit 96eee8ab authored by tmp1u19's avatar tmp1u19 :octopus:
Browse files

Build a GUI without functionality, only the buttons are displayed and the...

Build a GUI without functionality, only the buttons are displayed and the space fort the graphics is created.
parent 23da8ee9
Branches
No related tags found
No related merge requests found
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.Button;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Mathdoku extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
VBox menu = new VBox();
menu.setPadding(new Insets(10));
menu.setAlignment(Pos.CENTER);
HBox topButton = new HBox();
HBox bottomButton = new HBox();
topButton.setPadding(new Insets(10));
bottomButton.setPadding(new Insets(10));
bottomButton.setAlignment(Pos.CENTER);
Button undo = new Button("Undo");
Button redo = new Button("Redo");
Button help = new Button("Help");
Button clear = new Button("Clear");
Button fileLoad = new Button("Load from file");
Button textLoad = new Button("Load from text");
Button submit = new Button("Submit");
topButton.getChildren().addAll(undo, redo, help);
bottomButton.getChildren().addAll(clear, fileLoad, textLoad, submit);
Canvas c = new Canvas();
GraphicsContext gc = c.getGraphicsContext2D();
c.setHeight(400);
c.setWidth(400);
menu.getChildren().addAll(topButton, c, bottomButton);
Scene scene = new Scene(menu);
primaryStage.setScene(scene);
primaryStage.show();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment