Skip to content
Snippets Groups Projects
Commit 1f51991f authored by vaolinxt's avatar vaolinxt
Browse files

jar ja build.xml

parent 1a75fd9e
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create_run_jar" name="Create Runnable Jar for Project testi">
<!--this file was created by Eclipse Runnable JAR Export Wizard-->
<!--ANT 1.7 is required -->
<!--define folder properties-->
<property name="dir.buildfile" value="."/>
<property name="dir.workspace" value="/root/eclipse-workspace"/>
<property name="dir.jarfile" value="${dir.buildfile}"/>
<target name="create_run_jar">
<jar destfile="${dir.jarfile}/varastorekisteri.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="testi.Main"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${dir.workspace}/testi/bin"/>
<zipfileset excludes="META-INF/*.SF" src="/home/defaultuser/Downloads/puhtaanapito/javafx/javafx-sdk-21.0.2/lib/javafx.base.jar"/>
<zipfileset excludes="META-INF/*.SF" src="/home/defaultuser/Downloads/puhtaanapito/javafx/javafx-sdk-21.0.2/lib/javafx.controls.jar"/>
<zipfileset excludes="META-INF/*.SF" src="/home/defaultuser/Downloads/puhtaanapito/javafx/javafx-sdk-21.0.2/lib/javafx.fxml.jar"/>
<zipfileset excludes="META-INF/*.SF" src="/home/defaultuser/Downloads/puhtaanapito/javafx/javafx-sdk-21.0.2/lib/javafx.graphics.jar"/>
<zipfileset excludes="META-INF/*.SF" src="/home/defaultuser/Downloads/puhtaanapito/javafx/javafx-sdk-21.0.2/lib/javafx.media.jar"/>
<zipfileset excludes="META-INF/*.SF" src="/home/defaultuser/Downloads/puhtaanapito/javafx/javafx-sdk-21.0.2/lib/javafx.swing.jar"/>
<zipfileset excludes="META-INF/*.SF" src="/home/defaultuser/Downloads/puhtaanapito/javafx/javafx-sdk-21.0.2/lib/javafx.web.jar"/>
<zipfileset excludes="META-INF/*.SF" src="/home/defaultuser/Downloads/puhtaanapito/javafx/javafx-sdk-21.0.2/lib/javafx-swt.jar"/>
</jar>
</target>
</project>
package testi;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
// Make sure the path is correct
Parent root = FXMLLoader.load(getClass().getResource("./main_fxml.fxml"));
primaryStage.setTitle("Varastorekisteri");
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
\ No newline at end of file
package testi;
import java.io.IOException;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ListView;
import javafx.stage.Modality;
import javafx.stage.Stage;
public class MainController {
@FXML
private ListView<String> lista; // Make sure fx:id matches
@FXML
private Button plus_painike; // Make sure fx:id matches
@FXML
private Button hampurilais_painike; // Make sure fx:id matches
@FXML
private void showEditDialog() {
try {
// Load the FXML file
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("./popup_fxml.fxml"));
Scene scene = new Scene(fxmlLoader.load());
// Create a new stage (window)
Stage stage = new Stage();
stage.setTitle("Rekisterimerkintä");
stage.setScene(scene);
// Show the modal dialog and wait until it's closed
stage.initModality(Modality.APPLICATION_MODAL);
stage.showAndWait();
} catch (IOException e) {
e.printStackTrace();
}
}
@FXML
public void initialize() {
// Initialization code here
lista.getItems().addAll("Verkkokaapelit", "Langaton reitititin", "asennuslevyjä");
// Example: addProductButton event handler
plus_painike.setOnAction(event -> {
// Code to handle adding a new product
System.out.println("plus");
showEditDialog();
});
// Example: hamburgerButton event handler
hampurilais_painike.setOnAction(event -> {
// Code to open the menu
System.out.println("testi");
});
}
}
package testi;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
public class PopupController {
@FXML
private TextField popup_tuotteennimi;
@FXML
private TextField popup_kappalemaara;
@FXML
private TextField popup_vientistatus;
@FXML
private TextField popup_hyllynnro;
@FXML
private TextField popup_sijaintihyllyssa;
@FXML
private Button popup_tallenna;
@FXML
private void initialize() {
// Initialize your controller here if needed
}
@FXML
private void handleTallennaAction() {
// Here, implement the action to take when the "Tallenna" button is clicked
// For example, capturing text field inputs and closing the dialog
String tuotteennimi = popup_tuotteennimi.getText();
String kappalemaara = popup_kappalemaara.getText();
String vientistatus = popup_vientistatus.getText();
String hyllynnro = popup_hyllynnro.getText();
String sijaintihyllyssa = popup_sijaintihyllyssa.getText();
// Use the captured inputs as needed...
// Close the dialog
Stage stage = (Stage) popup_tallenna.getScene().getWindow();
stage.close();
}
// Consider adding public methods to set initial values for the text fields
// if you're editing an existing item rather than creating a new one
}
<?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.ListView?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<VBox prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/21" fx:controller="testi.MainController" xmlns:fx="http://javafx.com/fxml/1">
<children>
<MenuBar VBox.vgrow="NEVER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="New" />
<MenuItem mnemonicParsing="false" text="Open…" />
<Menu mnemonicParsing="false" text="Open Recent" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Close" />
<MenuItem mnemonicParsing="false" text="Save" />
<MenuItem mnemonicParsing="false" text="Save As…" />
<MenuItem mnemonicParsing="false" text="Revert" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Preferences…" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Quit" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Undo" />
<MenuItem mnemonicParsing="false" text="Redo" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Cut" />
<MenuItem mnemonicParsing="false" text="Copy" />
<MenuItem mnemonicParsing="false" text="Paste" />
<MenuItem mnemonicParsing="false" text="Delete" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Select All" />
<MenuItem mnemonicParsing="false" text="Unselect All" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About MyHelloApp" />
</items>
</Menu>
</menus>
</MenuBar>
<AnchorPane maxHeight="-1.0" maxWidth="-1.0" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS">
<children>
<Label alignment="CENTER" layoutX="155.0" layoutY="177.0" style="&#10;" text="Drag components from Library here…" textAlignment="CENTER" textFill="#9f9f9f" wrapText="false">
<font>
<Font size="18.0" />
</font>
</Label>
<VBox alignment="TOP_CENTER" layoutX="106.0" prefHeight="374.0" prefWidth="450.0" spacing="30.0">
<children>
<Button fx:id="hampurilais_painike" mnemonicParsing="false" text="☰">
<font>
<Font size="20.0" />
</font>
</Button>
<ListView fx:id="lista" prefHeight="125.0" prefWidth="450.0" />
<Button fx:id="plus_painike" alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" style="-fx-background-radius: 100;" text="+">
<font>
<Font size="31.0" />
</font>
</Button>
</children>
<padding>
<Insets bottom="20.0" top="20.0" />
</padding>
</VBox>
</children>
</AnchorPane>
</children>
</VBox>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<VBox prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/21" fx:controller="testi.PopupController" xmlns:fx="http://javafx.com/fxml/1">
<children>
<AnchorPane maxHeight="-1.0" maxWidth="-1.0" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS">
<children>
<VBox layoutX="27.0" layoutY="27.0" prefHeight="354.0" prefWidth="583.0" spacing="10.0">
<children>
<HBox prefHeight="41.0" prefWidth="583.0" spacing="10.0">
<children>
<Label text="Tuotteen nimi">
<font>
<Font size="18.0" />
</font>
</Label>
<TextField fx:id="popup_tuotteennimi">
<font>
<Font size="16.0" />
</font>
</TextField>
</children>
</HBox>
<HBox prefHeight="41.0" prefWidth="583.0" spacing="10.0">
<children>
<Label text="Kappalemäärä">
<font>
<Font size="18.0" />
</font>
</Label>
<TextField fx:id="popup_kappalemaara">
<font>
<Font size="16.0" />
</font>
</TextField>
</children>
</HBox>
<HBox prefHeight="41.0" prefWidth="583.0" spacing="10.0">
<children>
<Label text="Vientistatus">
<font>
<Font size="18.0" />
</font>
</Label>
<TextField fx:id="popup_vientistatus">
<font>
<Font size="16.0" />
</font>
</TextField>
</children>
</HBox>
<HBox prefHeight="41.0" prefWidth="583.0" spacing="10.0">
<children>
<Label text="hyllyn nro">
<font>
<Font size="18.0" />
</font>
</Label>
<TextField fx:id="popup_hyllynnro">
<font>
<Font size="16.0" />
</font>
</TextField>
</children>
</HBox>
<HBox prefHeight="41.0" prefWidth="583.0" spacing="10.0">
<children>
<Label text="sijainti hyllyssä">
<font>
<Font size="18.0" />
</font>
</Label>
<TextField fx:id="popup_sijaintihyllyssa">
<font>
<Font size="16.0" />
</font>
</TextField>
</children>
</HBox>
<Button fx:id="popup_tallenna" mnemonicParsing="false" text="Tallenna">
<font>
<Font size="18.0" />
</font>
</Button>
</children>
</VBox>
</children>
</AnchorPane>
</children>
</VBox>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment