started gui

This commit is contained in:
Patrice Matz 2018-07-30 17:33:21 +02:00
parent a21f1e01a2
commit 0db36e9cf9
2 changed files with 102 additions and 1 deletions

View File

@ -1,12 +1,26 @@
package com.company;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.awt.*;
import java.util.ArrayList;
public class Main {
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 300, 275));
primaryStage.show();
}
public static void main(String[] args) throws IOException {

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import com.gluonhq.charm.glisten.control.ProgressBar?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.TextFlow?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1">
<center>
<HBox fillHeight="false" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="800.0" BorderPane.alignment="CENTER">
<children>
<ImageView fitHeight="400.0" fitWidth="400.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="400.0" fitWidth="400.0" pickOnBounds="true" preserveRatio="true" />
</children>
</HBox>
</center>
<bottom>
<HBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="200.0" prefWidth="800.0" BorderPane.alignment="CENTER">
<children>
<VBox prefHeight="200.0" prefWidth="150.0">
<children>
<Button mnemonicParsing="false" prefHeight="31.0" prefWidth="105.0" text="picture">
<VBox.margin>
<Insets left="20.0" top="5.0" />
</VBox.margin>
</Button>
<Button maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" prefHeight="31.0" prefWidth="105.0" text="replacement">
<VBox.margin>
<Insets left="20.0" top="5.0" />
</VBox.margin>
</Button>
</children>
</VBox>
<VBox prefHeight="200.0" prefWidth="150.0">
<children>
<TextField prefHeight="31.0" prefWidth="87.0" promptText="Rows">
<VBox.margin>
<Insets top="5.0" />
</VBox.margin>
</TextField>
<TextField promptText="Columns">
<VBox.margin>
<Insets top="5.0" />
</VBox.margin>
</TextField>
</children>
</VBox>
<VBox prefHeight="200.0" prefWidth="200.0">
<children>
<ProgressBar minHeight="-Infinity" minWidth="-Infinity" prefHeight="31.0" prefWidth="180.0" progress="0.0">
<VBox.margin>
<Insets top="5.0" />
</VBox.margin>
<padding>
<Insets left="20.0" />
</padding>
</ProgressBar>
<Button mnemonicParsing="false" prefHeight="32.0" prefWidth="160.0" text="Run replacement">
<VBox.margin>
<Insets left="20.0" top="5.0" />
</VBox.margin>
</Button>
<Button mnemonicParsing="false" prefHeight="32.0" prefWidth="160.0" text="Save File">
<VBox.margin>
<Insets left="20.0" top="5.0" />
</VBox.margin>
</Button>
</children>
</VBox>
<TextFlow prefHeight="200.0" prefWidth="200.0">
<opaqueInsets>
<Insets />
</opaqueInsets>
<HBox.margin>
<Insets left="85.0" />
</HBox.margin>
</TextFlow>
</children>
</HBox>
</bottom>
</BorderPane>