implemented view upload and main fxml
This commit is contained in:
parent
80f1275f63
commit
e55658ff2e
@ -10,9 +10,9 @@ import java.io.IOException;
|
|||||||
public class App extends Application {
|
public class App extends Application {
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage stage) throws IOException {
|
public void start(Stage stage) throws IOException {
|
||||||
FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource("main.fxml"));
|
FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource("upload.fxml"));
|
||||||
Scene scene = new Scene(fxmlLoader.load(), 320, 240);
|
Scene scene = new Scene(fxmlLoader.load(), 320, 240);
|
||||||
stage.setTitle("Hello!");
|
stage.setTitle("Question Catalog");
|
||||||
stage.setScene(scene);
|
stage.setScene(scene);
|
||||||
stage.show();
|
stage.show();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,4 @@
|
|||||||
|
package at.ionas999.questioncatalog.controller;
|
||||||
|
|
||||||
|
public class MainController {
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package at.ionas999.questioncatalog.controller;
|
||||||
|
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.control.ListView;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
|
|
||||||
|
public class UploadController {
|
||||||
|
public ListView catalogListView;
|
||||||
|
public TextField newCatalogField;
|
||||||
|
public Button addCatalogButton;
|
||||||
|
public ListView catalogListViw;
|
||||||
|
public Button uploadButton;
|
||||||
|
public Label fileNameLabel;
|
||||||
|
public Button importButton;
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package at.ionas999.questioncatalog.controller;
|
||||||
|
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.ListView;
|
||||||
|
import javafx.scene.control.TextArea;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
|
|
||||||
|
public class ViewController{
|
||||||
|
public Button editButton;
|
||||||
|
public Button deleteButton;
|
||||||
|
public TextField answerField;
|
||||||
|
public ListView questionListView;
|
||||||
|
public TextField questionField;
|
||||||
|
}
|
||||||
@ -2,7 +2,7 @@ module at.ionas999.questioncatalog {
|
|||||||
requires javafx.controls;
|
requires javafx.controls;
|
||||||
requires javafx.fxml;
|
requires javafx.fxml;
|
||||||
|
|
||||||
|
|
||||||
opens at.ionas999.questioncatalog to javafx.fxml;
|
opens at.ionas999.questioncatalog to javafx.fxml;
|
||||||
|
opens at.ionas999.questioncatalog.controller to javafx.fxml; // Add this line
|
||||||
exports at.ionas999.questioncatalog;
|
exports at.ionas999.questioncatalog;
|
||||||
}
|
}
|
||||||
@ -1,16 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import javafx.geometry.Insets?>
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.control.Label?>
|
<?import javafx.scene.control.Label?>
|
||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
|
||||||
<?import javafx.scene.control.Button?>
|
|
||||||
<VBox alignment="CENTER" spacing="20.0" xmlns:fx="http://javafx.com/fxml">
|
<VBox alignment="CENTER" spacing="20.0" xmlns:fx="http://javafx.com/fxml">
|
||||||
|
<Label text="Question Catalog" style="-fx-font-size: 24px; -fx-font-weight: bold;" />
|
||||||
<padding>
|
<VBox spacing="10.0" alignment="CENTER">
|
||||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/>
|
<Button text="Add New" prefWidth="150" />
|
||||||
</padding>
|
<Button text="View" prefWidth="149" />
|
||||||
|
<Button text="Learn" prefWidth="150" />
|
||||||
<Label fx:id="welcomeText"/>
|
<Button text="Test" prefWidth="150" />
|
||||||
<Button text="Hello!"/>
|
</VBox>
|
||||||
</VBox>
|
</VBox>
|
||||||
44
src/main/resources/at/ionas999/questioncatalog/upload.fxml
Normal file
44
src/main/resources/at/ionas999/questioncatalog/upload.fxml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
|
<BorderPane xmlns="http://javafx.com/javafx"
|
||||||
|
xmlns:fx="http://javafx.com/fxml"
|
||||||
|
fx:controller="at.ionas999.questioncatalog.controller.UploadController"
|
||||||
|
prefHeight="400.0" prefWidth="600.0">
|
||||||
|
|
||||||
|
<top>
|
||||||
|
<Label text="Upload Questions" style="-fx-font-size: 20; -fx-padding: 10;">
|
||||||
|
<BorderPane.margin>
|
||||||
|
<Insets bottom="10"/>
|
||||||
|
</BorderPane.margin>
|
||||||
|
</Label>
|
||||||
|
</top>
|
||||||
|
|
||||||
|
<left>
|
||||||
|
<VBox spacing="10" prefWidth="200">
|
||||||
|
<padding>
|
||||||
|
<Insets top="10" right="10" bottom="10" left="10"/>
|
||||||
|
</padding>
|
||||||
|
<Label text="Select Catalog:"/>
|
||||||
|
<ListView fx:id="catalogListViw" VBox.vgrow="ALWAYS"/>
|
||||||
|
<HBox spacing="5">
|
||||||
|
<TextField fx:id="newCatalogField" promptText="New Catalog Name" HBox.hgrow="ALWAYS"/>
|
||||||
|
<Button fx:id="addCatalogButton" text="+"/>
|
||||||
|
</HBox>
|
||||||
|
</VBox>
|
||||||
|
</left>
|
||||||
|
|
||||||
|
<center>
|
||||||
|
<VBox spacing="10" alignment="TOP_CENTER">
|
||||||
|
<padding>
|
||||||
|
<Insets top="10" right="10" bottom="10" left="10"/>
|
||||||
|
</padding>
|
||||||
|
<Label text="Upload CSV File"/>
|
||||||
|
<Button fx:id="uploadButton" text="Choose File"/>
|
||||||
|
<Label fx:id="fileNameLabel" text="No file selected"/>
|
||||||
|
<Button fx:id="importButton" text="Import Questions" disable="true"/>
|
||||||
|
</VBox>
|
||||||
|
</center>
|
||||||
|
</BorderPane>
|
||||||
28
src/main/resources/at/ionas999/questioncatalog/view.fxml
Normal file
28
src/main/resources/at/ionas999/questioncatalog/view.fxml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
|
<BorderPane xmlns="http://javafx.com/javafx"
|
||||||
|
xmlns:fx="http://javafx.com/fxml"
|
||||||
|
fx:controller="at.ionas999.questioncatalog.controller.ViewController"
|
||||||
|
prefHeight="400.0" prefWidth="600.0">
|
||||||
|
|
||||||
|
<left>
|
||||||
|
<ListView fx:id="questionListView" prefWidth="200.0" />
|
||||||
|
</left>
|
||||||
|
|
||||||
|
<center>
|
||||||
|
<VBox spacing="10.0">
|
||||||
|
<padding>
|
||||||
|
<Insets top="10.0" right="10.0" bottom="10.0" left="10.0"/>
|
||||||
|
</padding>
|
||||||
|
<TextField fx:id="questionField" editable="false" />
|
||||||
|
<TextField fx:id="answerField" promptText="Answer" editable="false" />
|
||||||
|
<HBox spacing="10.0" alignment="BOTTOM_RIGHT">
|
||||||
|
<Button fx:id="deleteButton" text="Delete" />
|
||||||
|
<Button fx:id="editButton" text="Edit" />
|
||||||
|
</HBox>
|
||||||
|
</VBox>
|
||||||
|
</center>
|
||||||
|
|
||||||
|
</BorderPane>
|
||||||
Loading…
Reference in New Issue
Block a user