Last active
March 12, 2019 16:52
-
-
Save markheramis/87542cb75fe7de321b6b36a74d98d22e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.applet.*; | |
import java.awt.*; | |
import java.awt.GridLayout; | |
import java.awt.event.*; | |
public class kwaza extends Applet implements ActionListener { | |
int tuifee; | |
String username = "IllusiveMan"; | |
String password = "1234567890"; | |
Label intro = new Label("WELCOME TO ENROLLMENT SYSTEM"); | |
Font pont = new Font("Font.Arial", Font.BOLD, 25); | |
Label no5 = new Label("UNIVERSITY OF CALOOCAN CITY", Label.LEFT); | |
Label no6 = new Label("username:", Label.LEFT); | |
Label no7 = new Label("Password:", Label.LEFT); | |
Label no8 = new Label("Please LogIn", Label.LEFT); | |
Label no9 = new Label("must have 81 average or above", Label.LEFT); | |
Label no10 = new Label("must be a citizen of caloocan city", Label.LEFT); | |
Label no11 = new Label("must have complete credentials", Label.LEFT); | |
Label no12 = new Label("Lastname:", Label.LEFT); | |
Label no13 = new Label("Firstname:", Label.LEFT); | |
Label no14 = new Label("MI:", Label.LEFT); | |
Label no15 = new Label("Gender:", Label.LEFT); | |
Label no16 = new Label("DIFFERENT COURSES", Label.LEFT); | |
Label no17 = new Label("BSIS 28 UNITS", Label.LEFT); | |
Label no18 = new Label("BSIT 27 UNITS", Label.LEFT); | |
Label no19 = new Label("BSCS 28 UNITS", Label.LEFT); | |
Label no20 = new Label("BSMATH 29 UNITS", Label.LEFT); | |
Label no21 = new Label("BSEMC 26 UNITS", Label.LEFT); | |
Label no22 = new Label("BSHRM 27 UNITS", Label.LEFT); | |
Label no23 = new Label("Amount Per Unit:", Label.LEFT); | |
Label no24 = new Label("Total Units:", Label.LEFT); | |
Label no25 = new Label("Tuition Fee:", Label.CENTER); | |
Label no26 = new Label("submit", Label.LEFT); | |
Label no27 = new Label("Clear", Label.LEFT); | |
TextField username = new TextField(10); | |
TextField password = new TextField(10); | |
TextField lastname = new TextField(10); | |
TextField firstname = new TextField(10); | |
TextField middle = new TextField(5); | |
TextField gender = new TextField(10); | |
TextField amount = new TextField("150", 10); | |
TextField units = new TextField(6); | |
TextField total = new TextField(15); | |
Button login = new Button("LogIn "); | |
Button submit = new Button("submit "); | |
Button cle = new Button("clear "); | |
public void init() { | |
setBackground(Color.gray); | |
intro.setForeground(Color.orange); | |
intro.setFont(pont); | |
add(intro); | |
addNewLine(); | |
add(no5); | |
addNewLine(); | |
add(no6); | |
add(username); | |
addNewLine(); | |
add(no7); | |
add(password); | |
addNewLine(); | |
add(no8); | |
add(login); | |
addNewLine(); | |
add(no9); | |
addNewLine(); | |
add(no10); | |
addNewLine(); | |
add(no11); | |
addNewLine(); | |
add(no12); | |
add(lastname); | |
add(no13); | |
add(firstname); | |
add(no14); | |
add(middle); | |
addNewLine(); | |
add(no15); | |
add(gender); | |
addNewLine(); | |
addNewLine(); | |
add(no16); | |
addNewLine(); | |
add(no17); | |
addNewLine(); | |
add(no18); | |
addNewLine(); | |
add(no19); | |
addNewLine(); | |
add(no20); | |
addNewLine(); | |
add(no21); | |
addNewLine(); | |
add(amount); | |
add(no22); | |
addNewLine(); | |
add(units); | |
add(no23); | |
add(total); | |
add(submit); | |
add(cle); | |
intro.setBounds(150, 20, 150, 50); | |
lastname.setBounds(150, 20, 150, 50); | |
firstname.setBounds(150, 20, 150, 50); | |
middle.setBounds(150, 20, 150, 50); | |
gender.setBounds(150, 20, 150, 50); | |
units.setBounds(150, 20, 150, 50); | |
amount.setEditable(false); | |
submit.addActionListener(this); | |
cle.addActionListener(this); | |
} | |
public void actionPerformed(ActionEvent ae) | |
{ | |
int tu = Integer.parseInt(units.getText()); | |
if (ae.getSource() == submit) { | |
tuifee = 150 * tu; | |
String tot = new Integer(tuifee).toString(); | |
total.setText(tot); | |
} else if (ae.getSource() == cle) { | |
username.setText(" "); | |
password.setText(" "); | |
lastname.setText(" "); | |
firstname.setText(" "); | |
middle.setText(" "); | |
gender.setText(" "); | |
units.setText(" "); | |
total.setText(" "); | |
} | |
} | |
private void addHorizontalLine(Color c) { | |
Canvas line = new Canvas(); | |
line.setSize(1000, 1); | |
line.setBackground(c); | |
add(line); | |
} | |
private void addNewLine() { | |
addHorizontalLine(getBackground()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment