GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — FXML · VRR/Source-Code-from-Tutorials@eb5678b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • JavaFX/031_fxml
    • Controller.java
    • Main.java
    • sample.fxml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎JavaFX/031_fxml/Controller.java‎

Copy file name to clipboard
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package sample;
2+
3+
import javafx.fxml.Initializable;
4+
import java.net.URL;
5+
import java.util.ResourceBundle;
6+
7+
public class Controller implements Initializable {
8+
9+
@Override
10+
public void initialize(URL location, ResourceBundle resources) {
11+
System.out.println("View is now loaded!");
12+
}
13+
14+
}
Collapse file

‎JavaFX/031_fxml/Main.java‎

Copy file name to clipboard
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package sample;
2+
3+
import javafx.application.Application;
4+
import javafx.fxml.FXMLLoader;
5+
import javafx.scene.Parent;
6+
import javafx.scene.Scene;
7+
import javafx.stage.Stage;
8+
9+
public class Main extends Application {
10+
11+
public static void main(String[] args) {
12+
launch(args);
13+
}
14+
15+
@Override
16+
public void start(Stage primaryStage) throws Exception{
17+
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
18+
primaryStage.setTitle("Hello World");
19+
primaryStage.setScene(new Scene(root, 300, 275));
20+
primaryStage.show();
21+
}
22+
23+
24+
}
Collapse file

‎JavaFX/031_fxml/sample.fxml‎

Copy file name to clipboard
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?import javafx.scene.control.*?>
3+
<?import javafx.scene.layout.*?>
4+
5+
<VBox prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml"
6+
fx:controller="sample.Controller">
7+
8+
<Label text="I love bacon"/>
9+
<Button text="Submit"/>
10+
11+
</VBox>

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.