Skip to content

Commit

Permalink
16 Jun 18 : Create/Update new files
Browse files Browse the repository at this point in the history
  • Loading branch information
yedhink committed Jun 16, 2018
1 parent f5cd341 commit 22737a0
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions EventHandling/LoginGUI.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* @name A Login GUI
* @name A Login GUI
* @package GUIProjects
* @file LoginGUI.java
* @author Yedhin Kizhakkethara
Expand All @@ -22,7 +22,7 @@

class LoginGUI extends Frame {
// declare variables
private Label label1,label2;
private Label label1,label2;
private TextField txtF1;
private TextField passF;
private Button buttonExit,buttonLogin;
Expand All @@ -31,7 +31,7 @@ class LoginGUI extends Frame {
// Looking for a better way to store this.
private final String uid = "Yedhin";
private final String pass = "*123#";

// Constructor for the class
public LoginGUI(){
// set title
Expand All @@ -46,9 +46,8 @@ public LoginGUI(){

// explictely setting layout. default is Flow itself
setLayout(new FlowLayout());


//add(buttonExit);


// create a label for username
label1.setAlignment(Label.CENTER);
label1.setText("Username");
Expand All @@ -60,7 +59,7 @@ public LoginGUI(){

// changing echoing of characters typed in password field into *
passF.setEchoChar('*');

add(txtF1);

// create a label for password
Expand All @@ -69,7 +68,7 @@ public LoginGUI(){
add(label2);

add(passF);

// create an exit button
add(buttonExit);

Expand All @@ -79,8 +78,8 @@ public LoginGUI(){

// create an listener object.
theHandler handler = new theHandler();
// add action listeners for both the buttons

// add action listeners for both the buttons
buttonExit.addActionListener(handler);
buttonLogin.addActionListener(handler);
}
Expand All @@ -104,7 +103,7 @@ public void actionPerformed(ActionEvent e) {
catch(InterruptedException ex){
System.out.println("Exception "+ex+" Caught");
}
dispose();
dispose();
System.exit(0);
}
else{
Expand All @@ -118,6 +117,6 @@ public void actionPerformed(ActionEvent e) {
public static void main(String[] args) {
LoginGUI frameObj = new LoginGUI();
frameObj.setSize(600,600);
frameObj.setVisible(true);
frameObj.setVisible(true);
}
}

0 comments on commit 22737a0

Please sign in to comment.