Make Register Form with Java Swing


Creating Register Form using Java Swing:
https://youtu.be/nNTNsC1QP2c ________________________________________________ How to make Register Form

package Test;


import javax.swing.*;

public class RegisterForm {

public static void main(String[] args) {

JFrame frame = new JFrame("Register Form");

frame.setLayout(null);

frame.setVisible(true);

JLabel name = new JLabel("Name:");

name.setBounds(40,20,100,20);

JLabel surname = new JLabel("Surname:");

surname.setBounds(40,50,100,20);

JLabel gender = new JLabel("Gender:");

gender.setBounds(40,80,100,20);

JLabel nationality = new JLabel("Nationality:");

nationality.setBounds(40,110,100,20);

JLabel setpassword = new JLabel("Set new password:");

setpassword.setBounds(40,140,100,20);

JLabel repassword = new JLabel("Re-password:");

repassword.setBounds(40,170,100,20);

JTextField nameentry = new JTextField();

nameentry.setBounds(160,23,120,20);

JTextField surnameentry = new JTextField();

surnameentry.setBounds(160,53,120,20);

JCheckBox male = new JCheckBox("Male");

male.setBounds(160,83,60,20);

JCheckBox female = new JCheckBox("Female");

female.setBounds(220,83,120,20);

String countries[] = {"United States","United Kingdom","Korea","Mexico"};

JComboBox list = new JComboBox(countries);

list.setBounds(160,113,120,20);

JPasswordField setpass = new JPasswordField();

setpass.setBounds(160,143,120,20);

JPasswordField repass = new JPasswordField();

repass.setBounds(160,173,120,20);

JButton submit = new JButton("Submit");

submit.setBounds(130,220,80,20);

frame.add(name);

frame.add(surname);

frame.add(gender);

frame.add(nationality);

frame.add(setpassword);

frame.add(repassword);

frame.add(nameentry);

frame.add(surnameentry);

frame.add(male);

frame.add(female);

frame.add(list);

frame.add(setpass);

frame.add(repass);

frame.add(submit);

frame.setSize(400,300);

}

}

________________________________________________

Comments

Popular Posts