Java Reference
In-Depth Information
class MyDialog extends Stage {
public MyDialog(Stage owner, boolean modality, String
title) {
super();
initOwner(owner);
Modality m = modality
? Modality.APPLICATION_MODAL : Modality.NONE;
initModality(m);
setOpacity(.90);
setTitle(title);
Group root = new Group();
Scene scene = new Scene(root, 250, 150,
Color.WHITE);
setScene(scene);
GridPane gridpane = new GridPane();
gridpane.setPadding(new Insets(5));
gridpane.setHgap(5);
gridpane.setVgap(5);
Label mainLabel = new Label("Enter User Name &
Password");
gridpane.add(mainLabel, 1, 0, 2, 1);
Label userNameLbl = new Label("User Name: ");
gridpane.add(userNameLbl, 0, 1);
Label passwordLbl = new Label("Password: ");
gridpane.add(passwordLbl, 0, 2);
// username text field
final TextField userNameFld = new
TextField("Admin");
gridpane.add(userNameFld, 1, 1);
// password field
final PasswordField passwordFld = new
Search WWH ::




Custom Search