Membuat Shortcut, Bug Fix UI, UI Prototype Form Bayar, Logic UI Nomor Kartu
* Shortcut F8: Checkout * Bug Fix: Minimum height di FormUtama menyebabkan scroll horizontal tidak muncul * Logic UI nomor kartu: * Hanya bisa menginputkan integegr * Maksimum 4 * Jika input sudah berisi 4 digit, otomatis tab ke nomor berikutnyapull/1/head
parent
b527d9cb77
commit
49f0683a20
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package id.amigogroup.posterminal.bayar;
|
||||||
|
|
||||||
|
import id.amigogroup.posterminal.util.Fucout;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
import javafx.beans.value.ChangeListener;
|
||||||
|
import javafx.beans.value.ObservableValue;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.fxml.Initializable;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
|
import javafx.scene.input.KeyCode;
|
||||||
|
import javafx.scene.input.KeyEvent;
|
||||||
|
import javafx.scene.robot.Robot;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FXML Controller class
|
||||||
|
*
|
||||||
|
* @author ronal
|
||||||
|
*/
|
||||||
|
public class FormBayarController implements Initializable {
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private TextField fldNoKartu1;
|
||||||
|
@FXML
|
||||||
|
private TextField fldNoKartu2;
|
||||||
|
@FXML
|
||||||
|
private TextField fldNoKartu3;
|
||||||
|
@FXML
|
||||||
|
private TextField fldNoKartu4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the controller class.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void initialize(URL url, ResourceBundle rb) {
|
||||||
|
initComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initComponents() {
|
||||||
|
Fucout.forceFieldInteger(fldNoKartu1, 4);
|
||||||
|
Fucout.forceFieldInteger(fldNoKartu2, 4);
|
||||||
|
Fucout.forceFieldInteger(fldNoKartu3, 4);
|
||||||
|
Fucout.forceFieldInteger(fldNoKartu4, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void fldNomorKartuOnKeyTyped(KeyEvent event) {
|
||||||
|
if (event.getSource() != null
|
||||||
|
&& event.getSource() instanceof TextField) {
|
||||||
|
TextField field = (TextField) event.getSource();
|
||||||
|
|
||||||
|
if (field.getText().length() >= 4) {
|
||||||
|
if (event.getCharacter().matches("[0-9]")) {
|
||||||
|
Robot robot = new Robot();
|
||||||
|
robot.keyType(KeyCode.TAB);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,235 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.ComboBox?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.Separator?>
|
||||||
|
<?import javafx.scene.control.TextField?>
|
||||||
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.ColumnConstraints?>
|
||||||
|
<?import javafx.scene.layout.GridPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
|
<AnchorPane id="AnchorPane" minHeight="-Infinity" minWidth="-Infinity" prefHeight="475.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="id.amigogroup.posterminal.bayar.FormBayarController">
|
||||||
|
<children>
|
||||||
|
<Label layoutX="14.0" layoutY="14.0" text="Poin" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="16.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
<GridPane layoutX="14.0" layoutY="39.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="39.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" percentWidth="50.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" percentWidth="50.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<HBox alignment="CENTER_LEFT" maxWidth="1.7976931348623157E308" spacing="5.0">
|
||||||
|
<children>
|
||||||
|
<Label text="Nomor Member" />
|
||||||
|
<Label text=": -">
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets />
|
||||||
|
</HBox.margin>
|
||||||
|
</Label>
|
||||||
|
</children>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets top="5.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</HBox>
|
||||||
|
<HBox alignment="CENTER_LEFT" maxWidth="1.7976931348623157E308" spacing="5.0" GridPane.columnIndex="1">
|
||||||
|
<children>
|
||||||
|
<Label text="Total Poin" />
|
||||||
|
<Label text=": -">
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets />
|
||||||
|
</HBox.margin>
|
||||||
|
</Label>
|
||||||
|
</children>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets top="5.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</HBox>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
<Separator layoutX="132.0" layoutY="69.0" prefWidth="200.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="69.0" />
|
||||||
|
<Label layoutX="14.0" layoutY="70.0" text="Bayar" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="70.0">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="16.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
<GridPane layoutX="14.0" layoutY="95.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="95.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="150.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="150.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="50.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<Label text="Total Harga">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Label>
|
||||||
|
<TextField alignment="CENTER_RIGHT" GridPane.columnIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" left="5.0" right="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
<Label text="Diskon" GridPane.rowIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Label>
|
||||||
|
<TextField alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" left="5.0" right="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
<Label text="Total Retur" GridPane.rowIndex="2">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Label>
|
||||||
|
<TextField alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" left="5.0" right="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
<Label text="Bayar via Poin" GridPane.rowIndex="3">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Label>
|
||||||
|
<TextField alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" left="5.0" right="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
<TextField alignment="CENTER_RIGHT" disable="true" GridPane.columnIndex="2" GridPane.rowIndex="3">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" left="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
<Label text="Sisa Bayar" GridPane.rowIndex="4">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Label>
|
||||||
|
<TextField alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.rowIndex="4">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="5.0" right="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
<Separator layoutY="249.0" prefWidth="200.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="249.0" />
|
||||||
|
<Label layoutX="14.0" layoutY="250.0" text="Tunai" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="250.0">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="16.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
<GridPane layoutX="14.0" layoutY="269.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="269.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="150.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="150.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="50.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<Label text="Bayar">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Label>
|
||||||
|
<TextField alignment="CENTER_RIGHT" GridPane.columnIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" left="5.0" right="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
<Label text="Kembalian" GridPane.rowIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Label>
|
||||||
|
<TextField alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="5.0" right="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
<Separator layoutY="345.0" prefWidth="200.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="345.0" />
|
||||||
|
<Label layoutX="15.0" layoutY="346.0" text="Non Tunai">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="16.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
<GridPane layoutX="14.0" layoutY="371.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="371.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="150.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="150.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="50.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<Label text="Nama Bank">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Label>
|
||||||
|
<ComboBox maxWidth="1.7976931348623157E308" GridPane.columnIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" left="5.0" right="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</ComboBox>
|
||||||
|
<Label text="Nomor Kartu" GridPane.rowIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Label>
|
||||||
|
<HBox spacing="5.0" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" left="5.0" right="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
<children>
|
||||||
|
<TextField fx:id="fldNoKartu1" alignment="CENTER_RIGHT" onKeyTyped="#fldNomorKartuOnKeyTyped" prefWidth="75.0" />
|
||||||
|
<TextField fx:id="fldNoKartu2" alignment="CENTER_RIGHT" onKeyTyped="#fldNomorKartuOnKeyTyped" prefWidth="75.0" />
|
||||||
|
<TextField fx:id="fldNoKartu3" alignment="CENTER_RIGHT" onKeyTyped="#fldNomorKartuOnKeyTyped" prefWidth="75.0" />
|
||||||
|
<TextField fx:id="fldNoKartu4" alignment="CENTER_RIGHT" onKeyTyped="#fldNomorKartuOnKeyTyped" prefWidth="75.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<Label text="Nomor Validasi" GridPane.rowIndex="2">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Label>
|
||||||
|
<TextField alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="5.0" right="2.5" top="2.5" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
Loading…
Reference in New Issue