Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Catain
Final Exam
BSIT III
04/02/16
Application Class
public class library {
public static void main(String[] args) {
log_Instance login = new log_Instance();
login.setVisible(true);
}
}
INSTANCE CLASS
/**
* @(#)log_Instance.java
*
*
* @author
* @version 1.00 2016/3/31
*/
import
import
import
import
import
import
import
import
javax.swing.ImageIcon;
java.awt.image.BufferedImage;
javax.swing.*;
java.awt.*;
java.awt.event.*;
java.awt.Color;
javax.swing.JComboBox;
javax.swing.border.TitledBorder;
public log_Instance() {
//Set frame layout manager
super("System's Security");
setSize(WIDTH, LENGHT);
setLocation(250,250);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel bg = new JPanel(new FlowLayout());
bg.setBackground(blue);
JPanel gui = new JPanel(new BorderLayout());
gui.setBackground(blue);
JPanel dummyPanel = new JPanel(new GridLayout(0,1,1,1));
dummyPanel.setBackground(blue);
JPanel dummyPanel2 = new JPanel(new GridLayout(0,1,1,1));
dummyPanel2.setBackground(blue);
JPanel labelFields = new JPanel(new BorderLayout(3,2));
labelFields.setBackground(blue);
JPanel labelFieldImage = new JPanel(new BorderLayout(2,2));
labelFieldImage.setBackground(blue);
JPanel labels=new JPanel(new GridLayout(0,1,1,1));
labels.setBackground(blue);
JPanel fields=new JPanel(new GridLayout(0,1,1,1));
fields.setBackground(blue);
JPanel button=new JPanel(new GridLayout(0,1,1,1));
button.setBackground(blue);
lblUsername=new JLabel("Username:");
lblUsername.setHorizontalTextPosition(JLabel.CENTER);
lblUsername.setFont(myFont);
lblUsername.setForeground(Color.white);
lblPassword=new JLabel("Password:");
lblPassword.setHorizontalTextPosition(JLabel.CENTER);
lblPassword.setFont(myFont);
lblPassword.setForeground(Color.white);
txtUsername=new JTextField(20);
txtPassword=new JPasswordField(20);
String[] options = { "Admin", "Librarian", "Student Assistant"};
comboBox = new JComboBox(options);
comboBox.addActionListener(new ActionListener() {
@Override