Check.javapackage check;import javax.swing.*;p ublic class Check extends Jpanel{jlabel Namelabel1,namelabel2; JTextField name; JPasswordField password; JButton okbutton,cancelbutton;public Check () {namelabel1 = new JLabel ("username:"); namelabel2 = new JLabel ("Password:"); name = new JT Extfield;p assword = new JPasswordField, OKButton = new JButton ("OK"), CancelButton = new JButton ("Cancel"); Add ( NAMELABEL1); Add (name); add (Namelabel2); add (password); add (OKButton); add (CancelButton);}} Jframe.javapackage check;import javax.swing.*;import java.awt.*;p ublic class Jframe extends Jframe{check panel; private static final int d_width=320;private static final int d_height=120;public Jframe () {setSize (d_width,d_height); Settitle ("login");p anel = new Check (); Getcontentpane (). Add (Panel); setvisible (true); setresizable (false);}} Main.javapackage check;import javax.swing.*;p ublic class main extends jframe{public static void main (string[] args) { Jframe frame= new Jframe (); Frame.setdefaultcloseoperation (Jframe.exit_on_cloSE);}}
Simple User Login Interface