Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package br.com.controlxerox.view;
- import javafx.application.Application;
- import javafx.geometry.Insets;
- import javafx.geometry.Pos;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.control.Label;
- import javafx.scene.control.TextField;
- import javafx.scene.layout.GridPane;
- import javafx.scene.text.Font;
- import javafx.scene.text.FontWeight;
- import javafx.scene.text.Text;
- import javafx.stage.Screen;
- import javafx.stage.Stage;
- import javafx.stage.StageStyle;
- public class ControlXeroxGUI extends Application {
- private TextField txtAcademicRecord;
- private TextField txtName, txtEmail;
- private TextField txtPeriod, txtQuota;
- private Button btRegistration, btSearch, btEvents;
- private Button btSave;
- private Scene scene;
- private void initializeComponents() {
- this.txtName = new TextField();
- this.txtEmail = new TextField();
- this.txtQuota = new TextField();
- this.txtPeriod = new TextField();
- this.txtAcademicRecord = new TextField();
- this.btSave = new Button("Salvar");
- }
- private void buildRegistrationForm() {
- GridPane gridForm = new GridPane();
- gridForm.setAlignment(Pos.CENTER);
- gridForm.setHgap(10);
- gridForm.setVgap(10);
- gridForm.setPadding(new Insets(25, 25, 25, 25));
- Text title = new Text("Cadastro de Alunos");
- title.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
- gridForm.add(title, 0, 0, 2, 1);
- Label lblRa = new Label("R.A.:");
- gridForm.add(lblRa, 0, 1);
- gridForm.add(this.txtAcademicRecord, 1, 1);
- Label lblName = new Label("Nome: ");
- gridForm.add(lblName, 2, 1);
- gridForm.add(this.txtName, 3, 1);
- Label lblEmail = new Label("Email:");
- gridForm.add(lblEmail, 0, 2);
- gridForm.add(this.txtEmail, 1, 2);
- Label lblPeriod = new Label("PerĂodo:");
- gridForm.add(lblPeriod, 0, 3);
- gridForm.add(this.txtPeriod, 1, 3);
- gridForm.add(this.btSave, 0, 4);
- this.scene = new Scene(gridForm, 300, 300);
- this.scene.getStylesheets().add(
- ControlXeroxGUI.class.getResource("style/rootPanel.css").toExternalForm());
- }
- @Override
- public void start(Stage stage) {
- this.initializeComponents();
- stage.initStyle(StageStyle.UNDECORATED);
- stage.setTitle("Controle de Xerox - D.A Arquitetura");
- stage.centerOnScreen();
- stage.setHeight(Screen.getPrimary().getBounds().getHeight() / 2);
- stage.setWidth(Screen.getPrimary().getBounds().getWidth() / 2);
- this.buildRegistrationForm();
- stage.setScene(this.scene);
- stage.show();
- }
- public static void main(String[] args) {
- launch(args);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement