AHHHHHHHHHH COMMITED TO GITHUB INSTEAD OF FORGEJO FOR WEEKS

This commit is contained in:
sageTheDM 2024-12-16 20:32:46 +01:00
parent d6ef44f3d1
commit 0919005cb2
163 changed files with 3875 additions and 47 deletions

View file

@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}

View file

@ -0,0 +1,51 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>tooltips</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>13</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>13</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.6</version>
<executions>
<execution>
<!-- Default configuration for running -->
<!-- Usage: mvn clean javafx:run -->
<id>default-cli</id>
<configuration>
<mainClass>com.example.App</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,38 @@
package com.example;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
/**
* JavaFX App
*/
public class App extends Application {
private static Scene scene;
@Override
public void start(Stage stage) throws IOException {
scene = new Scene(loadFXML("primary"), 275, 250);
stage.setScene(scene);
stage.show();
}
static void setRoot(String fxml) throws IOException {
scene.setRoot(loadFXML(fxml));
}
private static Parent loadFXML(String fxml) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml"));
return fxmlLoader.load();
}
public static void main(String[] args) {
launch();
}
}

View file

@ -0,0 +1,73 @@
package com.example;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
public class PrimaryController {
double progress = 0;
@FXML
private Button buttonSend;
@FXML
private TextField emailInput;
@FXML
private TextField nachnameInput;
@FXML
private ProgressBar progressBar;
@FXML
private TextField vornameInput;
@FXML
void onTextChanged(KeyEvent event) {
if (event.getSource() == vornameInput || event.getSource() == nachnameInput
|| event.getSource() == emailInput) {
progress = 0;
if (!vornameInput.getText().trim().isEmpty()) {
progress += 1.0 / 3.0;
}
if (!nachnameInput.getText().trim().isEmpty()) {
progress += 1.0 / 3.0;
}
if (!emailInput.getText().trim().isEmpty()) {
progress += 1.0 / 3.0;
}
progressBar.setProgress(progress);
}
}
@FXML
void sendForm(ActionEvent event) {
if ((int) progress == 1) {
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
alert.setTitle("Confirmation Dialog");
alert.setHeaderText(null);
alert.setContentText("Are you sure you want to send?");
alert.showAndWait();
if (alert.getResult() == ButtonType.OK) {
vornameInput.clear();
nachnameInput.clear();
emailInput.clear();
progressBar.setProgress(0);
}
} else {
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("Incomplete Data Warning");
alert.setHeaderText("Incomplete Data");
alert.setContentText("Please fill in all required fields before proceeding.");
alert.showAndWait();
}
}
}

View file

@ -0,0 +1,7 @@
module com.example {
requires javafx.controls;
requires javafx.fxml;
opens com.example to javafx.fxml;
exports com.example;
}

View file

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ProgressBar?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="250.0" prefWidth="275.0" spacing="10.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.PrimaryController">
<children>
<Label text="Bitte füllen Sie das Formular aus:" />
<GridPane vgap="5.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="150.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Vorname:" />
<Label text="Nachname:" GridPane.rowIndex="1" />
<Label text="E-Mail:" GridPane.rowIndex="2" />
<TextField fx:id="vornameInput" onKeyTyped="#onTextChanged" promptText="Vorname" GridPane.columnIndex="1" />
<TextField fx:id="nachnameInput" onKeyTyped="#onTextChanged" promptText="Nachname" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="emailInput" onKeyTyped="#onTextChanged" promptText="E-Mail" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="Fortschritt:" GridPane.rowIndex="3" />
<ProgressBar fx:id="progressBar" prefWidth="200.0" progress="0.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
</children>
</GridPane>
<Button fx:id="buttonSend" mnemonicParsing="false" onAction="#sendForm" text="Absenden" />
</children>
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
</VBox>

View file

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ProgressBar?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="250.0" prefWidth="275.0" spacing="10.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.PrimaryController">
<children>
<Label text="Bitte füllen Sie das Formular aus:" />
<GridPane vgap="5.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="150.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Vorname:" />
<Label text="Nachname:" GridPane.rowIndex="1" />
<Label text="E-Mail:" GridPane.rowIndex="2" />
<TextField fx:id="vornameInput" onKeyTyped="#onTextChanged" promptText="Vorname" GridPane.columnIndex="1" />
<TextField fx:id="nachnameInput" onKeyTyped="#onTextChanged" promptText="Nachname" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="emailInput" onKeyTyped="#onTextChanged" promptText="E-Mail" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="Fortschritt:" GridPane.rowIndex="3" />
<ProgressBar fx:id="progressBar" prefWidth="200.0" progress="0.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
</children>
</GridPane>
<Button fx:id="buttonSend" mnemonicParsing="false" onAction="#sendForm" text="Absenden" />
</children>
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
</VBox>