-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTesteLayout.java
55 lines (46 loc) · 1.35 KB
/
TesteLayout.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package edu.curso;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
public class TesteLayout extends Application {
@Override
public void start(Stage stg) throws Exception {
BorderPane bp = new BorderPane();
Scene scn = new Scene(bp, 700, 250);
GridPane gp = new GridPane();
FlowPane fp = new FlowPane();
bp.setCenter(gp);
Label lblID = new Label("ID");
TextField txtID = new TextField();
// txtID.setMaxWidth(2000);
Label lblNome = new Label("Nome");
TextField txtNome = new TextField();
Label lblTel = new Label("Telefone");
TextField txtTel = new TextField();
gp.setHgap(50);
gp.setVgap(20);
gp.add(lblID, 1, 1);
gp.add(txtID, 2, 1);
gp.add(lblNome, 1, 2);
gp.add(txtNome, 2, 2);
gp.add(lblTel, 1, 3);
gp.add(txtTel, 2, 3);
gp.add(fp, 1, 4);
Button btnSalvar = new Button("Salvar");
Button btnPesq = new Button("Pesquisar");
fp.getChildren().addAll(btnSalvar, btnPesq);
fp.setMaxWidth(150);
stg.setTitle("Cadastro");
stg.setScene(scn);
stg.show();
}
public static void main(String[] args) {
Application.launch(TesteLayout.class, args);
}
}