REGISTRATION FORM DESIGN WITH DESIGN STYLES IN JAVAFX
import javafx.application.Application;
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Cursor;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.stage.Stage;
public class signup extends Application
{
@Override
public void start(Stage arg0) throws Exception
{
BorderPane bp=new BorderPane();
bp.setPadding(new Insets(50,50,50,50));
HBox hbtit=new HBox();
hbtit.setPadding(new Insets(30,30,30,30));
hbtit.setSpacing(50);
Image image = new Image("signup.png");
ImageView iv1 = new ImageView();
iv1.setImage(image);
//HBOX TOP
HBox hb=new HBox();
hb.setPadding(new Insets(50,50,50,50));
hb.setSpacing(50);
hb.getChildren().addAll(hbtit);
hb.setStyle("-fx-background-color: #3FF4CB;");
bp.setTop(hb);
//HBOX BOTTOM
HBox hdb=new HBox();
hdb.setPadding(new Insets(50,50,50,50));
hdb.setSpacing(50);
hdb.setStyle("-fx-background-color: #3FF4CB;");
bp.setBottom(hdb);
//VBOX LEFT
VBox vdl=new VBox();
vdl.setPadding(new Insets(50,50,50,50));
vdl.setSpacing(50);
vdl.setStyle("-fx-background-color: #3FF4CB;");
bp.setLeft(vdl);
//VBOX RIGHT
VBox vdr=new VBox();
vdr.setPadding(new Insets(50,50,50,50));
vdr.setSpacing(50);
vdr.setStyle("-fx-background-color: #3FF4CB;");
bp.setRight(vdr);
//CENTER GRID
//GridPane gd=new GridPane();
//gd.add(child, columnIndex, rowIndex);
GridPane gdtop=new GridPane();
gdtop.setPadding(new Insets(60,60,60,60));
gdtop.setVgap(30);
gdtop.setHgap(40);
GridPane.setHalignment(iv1, HPos.CENTER);
gdtop.add(iv1, 0, 0);
Label title=new Label("SIGN UP");
title.setFont(Font.font("Arial",FontWeight.BOLD, 40));
GridPane.setHalignment(title, HPos.CENTER);
gdtop.add(title, 1, 0);
//NAME LABEL
Label name=new Label("NAME");
name.setFont(Font.font("Arial",FontWeight.BOLD, 20));
gdtop.add(name, 0, 1);
//NAME TEXT BOX
TextField namet=new TextField();
namet.setPromptText("Name");
gdtop.add(namet, 1, 1);
//EMAIL ADDRESS LABEL
Label email=new Label("EMAIL ID");
email.setFont(Font.font("Arial",FontWeight.BOLD, 20));
gdtop.add(email, 0, 2);
//EMAIL TEXT BOX
TextField emailt=new TextField();
emailt.setPromptText("Email Address");
gdtop.add(emailt, 1, 2);
//CONFIRM EMAIL ADDRESS LABEL
Label cemail=new Label("CONFIRM EMAIL");
cemail.setFont(Font.font("Arial",FontWeight.BOLD, 20));
gdtop.add(cemail, 0, 3);
//CONFIRM EMAIL ADDRESS TEXT BOX
TextField emailct=new TextField();
emailct.setPromptText("Confirm Email Address");
gdtop.add(emailct, 1, 3);
//MOBILE NUMBER LABEL
Label mobnol=new Label("MOBILE NUMBER");
mobnol.setFont(Font.font("Arial",FontWeight.BOLD, 20));
gdtop.add(mobnol, 0, 4);
//MOBILE NUMBER TEXT FIELD
TextField mobnot=new TextField();
mobnot.setPromptText("Phone/Mobile No");
gdtop.add(mobnot, 1, 4);
//PASSWORD LABEL
Label pwd=new Label("PASSWORD");
pwd.setFont(Font.font("Arial",FontWeight.BOLD, 20));
gdtop.add(pwd, 0, 5);
//PASSWORD TEXTFIELD
TextField pwdt=new TextField();
pwdt.setPromptText("Password");
gdtop.add(pwdt, 1, 5);
//CONFIRM PASSWORD LABEL
Label cpwd=new Label("CONFIRM PASSWORD..");
cpwd.setFont(Font.font("Arial",FontWeight.BOLD, 20));
gdtop.add(cpwd, 0, 6);
//CONFIRM PASSWORD TEXTFIELD
TextField pwdc=new TextField();
pwdc.setPromptText("Confirm Password");
gdtop.add(pwdc, 1, 6);
//SUBMIT BUTTON HBOX
HBox subh=new HBox();
// subh.setPadding(new Insets(50,50,50,50));
// subh.setSpacing(20);
subh.setAlignment(Pos.CENTER_RIGHT);
//SUBMIT BUTTON
HBox canch=new HBox();
// canch.setPadding(new Insets(10,10,10,10));
//canch.setSpacing(20);
canch.setAlignment(Pos.CENTER_LEFT);
Button submit=new Button("Submit");
submit.setCursor(Cursor.HAND);
submit.setFont(Font.font("Arial",FontWeight.BOLD, 20));
submit.setStyle("-fx-background-color: #3FF4CB;");
// GridPane.setHalignment(submit, HPos.CENTER);
subh.getChildren().addAll(submit);
gdtop.add(subh, 0, 7);
//CANCEL BUTTON
Button cancel=new Button("Cancel");
cancel.setCursor(Cursor.HAND);
cancel.setFont(Font.font("Arial",FontWeight.BOLD, 20));
cancel.setStyle("-fx-background-color: #3FF4CB;");
canch.getChildren().addAll(cancel);
// GridPane.setHalignment(cancel, HPos.CENTER);
gdtop.add(canch,1,7);
bp.setCenter(gdtop);
Scene scene =new Scene(bp);
arg0.setTitle("ACCOUNT SIGN UP");
arg0.setScene(scene);
arg0.show();
}
public static void main(String[] args)
{
launch(args);
}
}
No comments:
Post a Comment