Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.event.*;
- import java.awt.*;
- import javax.swing.table.*;
- import javax.imageio.ImageIO;
- import java.io.*;
- import java.io.File;
- import java.io.IOException;
- import java.sql.*;
- public class JailManagement {
- public static final String jdriver = "com.mysql.cj.jdbc.Driver";
- public static final String dburl = "jdbc:mysql://localhost:3306/prison?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
- public static final String userdb = "root";
- public static final String passdb = "";
- public static void main(String args[]){
- ClockPane c1 = new ClockPane();
- ClockPane c2 = new ClockPane();
- ClockPane c3 = new ClockPane();
- ClockPane c4 = new ClockPane();
- ClockPane c5 = new ClockPane();
- //f1
- JFrame f1 = new JFrame();
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f1.setIconImage(icon.getImage());
- //f2
- JFrame f2 = new JFrame();
- ImageIcon icon1 = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f2.setIconImage(icon.getImage());
- //f3
- JFrame f3 = new JFrame();
- ImageIcon icon2 = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f3.setIconImage(icon.getImage());
- //f4
- JFrame f4 = new JFrame();
- ImageIcon icon3 = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f4.setIconImage(icon.getImage());
- //Login
- JLabel jail = new JLabel("Jail Management System");
- jail.setBounds(468,265,440,50);
- jail.setFont(new Font("Times New Roman",Font.BOLD,40));
- jail.setForeground(Color.WHITE);
- JLabel User = new JLabel("Username");
- User.setBounds(620,340,150,30);
- User.setFont(new Font("Times New Roman",Font.BOLD,25));
- User.setForeground(Color.WHITE);
- JLabel Pass = new JLabel("Password");
- Pass.setBounds(620,415,150,30);
- Pass.setFont(new Font("Times New Roman",Font.BOLD,25));
- Pass.setForeground(Color.WHITE);
- JTextField TUser = new JTextField();
- TUser.setBounds(570,380,200,30);
- JPasswordField TPass = new JPasswordField();
- TPass.setBounds(570,450,200,30);
- JButton BLogin = new JButton ("Login");
- BLogin.setBounds(570,510,200,30);
- try{
- f1.setContentPane(new JLabel(new ImageIcon(ImageIO.read(new File("C:\\Users\\jayjay matabang\\Desktop\\pic4.png")))));
- }
- catch(IOException b){
- b.printStackTrace();
- }
- BLogin.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_ENTER){
- BLogin.doClick();
- }
- }
- });
- BLogin.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- String a = TUser.getText();
- String b = TPass.getText();
- if (a.equals("jm")&& b.equals("gwapo")){
- f1.setVisible(false);
- f2.setVisible(true);
- JOptionPane.showMessageDialog(f1,"Welcome to Jail Management System","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- else if(a.equals("mukha")&& b.equals("123")){
- f1.setVisible(false);
- f2.setVisible(true);
- JOptionPane.showMessageDialog(f1,"Welcome to Jail Management System","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- else if (a.equals("")&&b.equals("")){
- JOptionPane.showMessageDialog(f1,"Please Type Username and Password","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- else {
- JOptionPane.showMessageDialog(f1,"Wrong Username and Password!","Warning",JOptionPane.ERROR_MESSAGE);
- }
- }
- });
- //HomePage
- //tour
- JButton tour = new JButton("Tour");
- tour.setBounds(1180,600,150,75);
- tour.setFont(new Font("Times New Roman",Font.BOLD,20));
- tour.setBackground(Color.LIGHT_GRAY);
- tour.setForeground(Color.BLACK);
- f2.add(tour);
- tour.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_T){
- BLogin.doClick();
- }
- }
- });
- tour.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JFrame f16 = new JFrame();
- f16.setVisible(true);
- f2.setVisible(false);
- f16.setLayout(null);
- f16.setSize(1366,768);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f16.setIconImage(icon.getImage());
- f16.add(c4);
- c4.setBounds(0,650,200,50);
- JButton rule = new JButton("Rule");
- rule.setBounds(1180,135,150,75);
- rule.setFont(new Font("Times New Roman",Font.BOLD,20));
- rule.setBackground(Color.LIGHT_GRAY);
- rule.setForeground(Color.BLACK);
- f16.add(rule);
- JButton Watch = new JButton("Watch");
- Watch.setBounds(1000,135,150,75);
- Watch.setFont(new Font("Times New Roman",Font.BOLD,20));
- Watch.setBackground(Color.LIGHT_GRAY);
- Watch.setForeground(Color.BLACK);
- f16.add(Watch);
- JLabel p1 = new JLabel();
- p1.setBounds(45,20,140,83);
- p1.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
- f16.add(p1);
- JLabel p2 = new JLabel();
- p2.setBounds(1150,20,140,83);
- p2.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
- f16.add(p2);
- JLabel tl1 = new JLabel("Jail Gallery");
- tl1.setBounds(485,30,450,70);
- tl1.setFont(new Font("Times new Roman",Font.BOLD,75));
- tl1.setForeground(Color.WHITE);
- f16.add(tl1);
- //Gallery
- JLabel p3 = new JLabel();
- p3.setBounds(0,230,320,350);
- p3.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\fac1.jpg"));
- f16.add(p3);
- JLabel p4 = new JLabel();
- p4.setBounds(321,230,340,350);
- p4.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\fac6.jpg"));
- f16.add(p4);
- JLabel p5 = new JLabel();
- p5.setBounds(662,230,340,350);
- p5.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\fac10.jpg"));
- f16.add(p5);
- JLabel p6 = new JLabel();
- p6.setBounds(1003,230,360,350);
- p6.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\fac77.jpg"));
- f16.add(p6);
- JPanel t1 = new JPanel();
- t1.setBounds(0,0,1366,120);
- t1.setBackground(Color.BLACK);
- t1.setBorder(BorderFactory.createEtchedBorder(1));
- f16.add(t1);
- Watch.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_W){
- Watch.doClick();
- }
- }
- });
- Watch.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- try {
- video();
- } catch (IOException ex) {
- ex.printStackTrace();
- }
- }
- });
- rule.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_R){
- rule.doClick();
- }
- }
- });
- rule.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JFrame f17 = new JFrame();
- f17.setVisible(true);
- f17.setLayout(null);
- f17.setSize(500,300);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f17.setIconImage(icon.getImage());
- JLabel p7 = new JLabel();
- p7.setBounds(0,0,480,270);
- p7.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\tg1.gif"));
- f17.add(p7);
- }
- });
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- f16.add(Back);
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f16.setVisible(false);
- f2.setVisible(true);
- }
- });
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- }
- });
- JLabel lp2 = new JLabel();
- lp2.setBounds(45,20,140,83);
- lp2.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
- f2.add(lp2);
- JLabel lp7 = new JLabel();
- lp7.setBounds(1150,20,140,83);
- lp7.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
- f2.add(lp7);
- JButton BHome = new JButton("Home");
- BHome.setBounds(270,20,150,75);
- BHome.setFont(new Font("Times New Roman",Font.BOLD,20));
- BHome.setBackground(Color.LIGHT_GRAY);
- BHome.setForeground(Color.BLACK);
- JButton BPrisoner = new JButton("Prisoner");
- BPrisoner.setBounds(485,20,150,75);
- BPrisoner.setFont(new Font("Times New Roman",Font.BOLD,20));
- BPrisoner.setBackground(Color.LIGHT_GRAY);
- BPrisoner.setForeground(Color.BLACK);
- JLabel lp8 = new JLabel();
- lp8.setBounds(45,20,140,83);
- lp8.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
- f3.add(lp8);
- JLabel lp9 = new JLabel();
- lp9.setBounds(1150,20,140,83);
- lp9.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
- f3.add(lp9);
- JButton BRoom = new JButton("Room");
- BRoom.setBounds(695,20,150,75);
- BRoom.setBackground(Color.LIGHT_GRAY);
- BRoom.setForeground(Color.BLACK);
- BRoom.setFont(new Font("Times New Roman",Font.BOLD,20));
- JButton BLogout = new JButton("Logout");
- BLogout.setBounds(900,20,150,75);
- BLogout.setFont(new Font("Times New Roman",Font.BOLD,20));
- BLogout.setBackground(Color.LIGHT_GRAY);
- BLogout.setForeground(Color.BLACK);
- JLabel lp3 = new JLabel();
- lp3.setBounds(1120,30,175,75);
- lp3.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic1.png"));
- f2.add(lp3);
- JPanel jpl = new JPanel();
- jpl.setBounds(0,0,1366,120);
- jpl.setBackground(Color.BLACK);
- jpl.setBorder(BorderFactory.createEtchedBorder(1));
- f2.add(BHome);
- f2.add(BPrisoner);
- f2.add(BRoom);
- f2.add(BLogout);
- f2.add(jpl);
- //Logout
- BLogout.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_L){
- BLogout.doClick();
- }
- }
- });
- BLogout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- f2, "Would you like to exit the program?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- f2.setVisible(false);
- f1.setVisible(true);
- TUser.setText("");
- TPass.setText("");
- }
- else {
- f1.setVisible(false);
- f2.setVisible(true);
- }
- }
- });
- JLabel tp = new JLabel("Jail Mangement Cooperation");
- tp.setBounds(390,0,900,350);
- tp.setFont(new Font("Times New Roman",Font.BOLD,48));
- f2.add(tp);
- JLabel lp = new JLabel();
- lp.setBounds(450,0,1000,900);
- lp.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png"));
- f2.add(lp);
- BPrisoner.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_P){
- BPrisoner.doClick();
- }
- }
- });
- BHome.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_H){
- BHome.doClick();
- }
- }
- });
- BRoom.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_R){
- BRoom.doClick();
- }
- }
- });
- //Prisoner Page
- BPrisoner.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f2.setVisible(false);
- f3.setVisible(true);
- f4.setVisible(false);
- JButton BHome = new JButton("Home");
- BHome.setBounds(270,20,150,75);
- BHome.setFont(new Font("Times New Roman",Font.BOLD,20));
- BHome.setBackground(Color.LIGHT_GRAY);
- BHome.setForeground(Color.BLACK);
- //home
- BHome.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f3.setVisible(false);
- f2.setVisible(true);
- f4.setVisible(false);
- }
- });
- JButton BPrisoner = new JButton("Prisoner");
- BPrisoner.setBounds(485,20,150,75);
- BPrisoner.setBackground(Color.LIGHT_GRAY);
- BPrisoner.setForeground(Color.BLACK);
- BPrisoner.setFont(new Font("Times New Roman",Font.BOLD,20));
- JButton BRoom = new JButton("Room");
- BRoom.setBounds(695,20,150,75);
- BRoom.setFont(new Font("Times New Roman",Font.BOLD,20));
- BRoom.setBackground(Color.LIGHT_GRAY);
- BRoom.setForeground(Color.BLACK);
- BRoom.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f3.setVisible(false);
- f2.setVisible(false);
- f4.setVisible(true);
- }
- });
- BPrisoner.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_P){
- BPrisoner.doClick();
- }
- }
- });
- BHome.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_H){
- BHome.doClick();
- }
- }
- });
- BRoom.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_R){
- BRoom.doClick();
- }
- }
- });
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.RED);
- Font font = (new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f3.add(pane);
- JButton BLogout = new JButton("Logout");
- BLogout.setBounds(900,20,150,75);
- BLogout.setFont(new Font("Times New Roman",Font.BOLD,20));
- BLogout.setBackground(Color.LIGHT_GRAY);
- BLogout.setForeground(Color.BLACK);
- //Logout
- BLogout.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_L){
- BLogout.doClick();
- }
- }
- });
- BLogout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- f2, "Would you like to exit the program?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- f3.setVisible(false);
- f1.setVisible(true);
- TUser.setText("");
- TPass.setText("");
- }
- else {
- f1.setVisible(false);
- f3.setVisible(true);
- }
- }
- });
- BLogout.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_L){
- BLogout.doClick();
- }
- }
- });
- JPanel jpl = new JPanel();
- jpl.setBounds(0,0,1366,120);
- jpl.setBackground(Color.BLACK);
- jpl.setBorder(BorderFactory.createEtchedBorder(1));
- f3.add(BHome);
- f3.add(BPrisoner);
- f3.add(BRoom);
- f3.add(BLogout);
- f3.add(jpl);
- }
- });
- // view
- JButton VRoom = new JButton("Room");
- VRoom.setBounds(1000,135,150,75);
- VRoom.setBackground(Color.LIGHT_GRAY);
- VRoom.setForeground(Color.BLACK);
- VRoom.setFont(new Font("Times New Roman",Font.BOLD,20));
- JButton Bview = new JButton("View");
- Bview.setBounds(1180,135,150,75);
- Bview.setFont(new Font("Times New Roman",Font.BOLD,20));
- Bview.setBackground(Color.LIGHT_GRAY);
- Bview.setForeground(Color.BLACK);
- f3.add(VRoom);
- f3.add(Bview);
- Bview.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_V){
- Bview.doClick();
- }
- }
- });
- Bview.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f15 = new JFrame();
- f15.setVisible(true);
- f3.setVisible(false);
- f15.setSize(1366,768);
- f15.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f15.setIconImage(icon.getImage());
- f15.add(c5);
- c5.setBounds(0,650,200,50);
- //Button View
- JLabel vl1 = new JLabel("Prisoner List");
- vl1.setBounds(485,30,450,70);
- vl1.setFont(new Font("Times new Roman",Font.BOLD,80));
- vl1.setForeground(Color.WHITE);
- f15.add(vl1);
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.RED);
- Font font = (new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f15.add(pane);
- //release
- JButton Release = new JButton("Release");
- Release.setBounds(1180,135,150,75);
- Release.setFont(new Font("Times New Roman",Font.BOLD,20));
- Release.setBackground(Color.LIGHT_GRAY);
- Release.setForeground(Color.BLACK);
- f15.add(Release);
- //Archieve
- JButton ar = new JButton("Archive");
- ar.setBounds(1000,135,150,75);
- ar.setFont(new Font("Times New Roman",Font.BOLD,20));
- ar.setBackground(Color.LIGHT_GRAY);
- ar.setForeground(Color.BLACK);
- f15.add(ar);
- JPanel vp1 = new JPanel();
- f15.add(vp1);
- vp1.setBounds(0,0,1366,120);
- vp1.setBackground(Color.BLACK);
- vp1.setBorder(BorderFactory.createEtchedBorder(1));
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- f15.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f15.setVisible(false);
- f3.setVisible(true);
- }
- });
- }
- });
- VRoom.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f3.setVisible(false);
- f4.setVisible(true);
- }
- });
- VRoom.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_R){
- VRoom.doClick();
- }
- }
- });
- //back
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f3.add(Back);
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f3.setVisible(false);
- f2.setVisible(true);
- f4.setVisible(false);
- }
- });
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- //Room Page
- BRoom.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f2.setVisible(false);
- f3.setVisible(false);
- f4.setVisible(true);
- JLabel lp10 = new JLabel();
- lp10.setBounds(45,20,140,83);
- lp10.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
- f4.add(lp10);
- JLabel lp11 = new JLabel();
- lp11.setBounds(1150,20,140,83);
- lp11.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
- f4.add(lp11);
- JButton BHome = new JButton("Home");
- BHome.setBounds(270,20,150,75);
- BHome.setBackground(Color.LIGHT_GRAY);
- BHome.setForeground(Color.BLACK);
- BHome.setFont(new Font("Times New Roman",Font.BOLD,20));
- //home
- BHome.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f3.setVisible(false);
- f2.setVisible(true);
- f4.setVisible(false);
- }
- });
- JButton BPrisoner = new JButton("Prisoner");
- BPrisoner.setBounds(485,20,150,75);
- BPrisoner.setFont(new Font("Times New Roman",Font.BOLD,20));
- BPrisoner.setBackground(Color.LIGHT_GRAY);
- BPrisoner.setForeground(Color.BLACK);
- BPrisoner.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f3.setVisible(true);
- f2.setVisible(false);
- f4.setVisible(false);
- }
- });
- JButton BRoom = new JButton("Room");
- BRoom.setBounds(695,20,150,75);
- BRoom.setFont(new Font("Times New Roman",Font.BOLD,20));
- BRoom.setBackground(Color.LIGHT_GRAY);
- BRoom.setForeground(Color.BLACK);
- JButton BLogout = new JButton("Logout");
- BLogout.setBounds(900,20,150,75);
- BLogout.setFont(new Font("Times New Roman",Font.BOLD,20));
- BLogout.setBackground(Color.LIGHT_GRAY);
- BLogout.setForeground(Color.BLACK);
- //Logout
- BLogout.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_L){
- BLogout.doClick();
- }
- }
- });
- BPrisoner.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_P){
- BPrisoner.doClick();
- }
- }
- });
- BHome.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_H){
- BHome.doClick();
- }
- }
- });
- BRoom.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_R){
- BRoom.doClick();
- }
- }
- });
- BLogout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- f2, "Would you like to exit the program?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- f4.setVisible(false);
- f1.setVisible(true);
- TUser.setText("");
- TPass.setText("");
- }
- else {
- f1.setVisible(false);
- f4.setVisible(true);
- }
- }
- });
- JLabel z = new JLabel("Room List");
- z.setBounds(485,140,450,70);
- z.setFont(new Font("Times New Roman",Font.BOLD,90));
- f4.add(z);
- JPanel jpl = new JPanel();
- jpl.setBounds(0,0,1366,120);
- jpl.setBackground(Color.BLACK);
- jpl.setBorder(BorderFactory.createEtchedBorder(1));
- f4.add(BHome);
- f4.add(BPrisoner);
- f4.add(BRoom);
- f4.add(BLogout);
- f4.add(jpl);
- }
- });
- //Room List
- JButton r1 = new JButton("Cell One");
- r1.setBounds(218,300,198,45);
- r1.setFont(new Font("Times New Roman",Font.BOLD,20));
- r1.setBackground(Color.LIGHT_GRAY);
- r1.setForeground(Color.BLACK);
- JButton r2 = new JButton("Cell Two");
- r2.setBounds(218,351,198,47);
- r2.setBackground(Color.LIGHT_GRAY);
- r2.setForeground(Color.BLACK);
- r2.setFont(new Font("Times New Roman",Font.BOLD,20));
- JButton r3 = new JButton("Cell Three");
- r3.setBounds(218,400,198,45);
- r3.setFont(new Font("Times New Roman",Font.BOLD,20));
- r3.setBackground(Color.LIGHT_GRAY);
- r3.setForeground(Color.BLACK);
- JButton r4 = new JButton("Cell Four");
- r4.setBounds(218,448,198,45);
- r4.setFont(new Font("Times New Roman",Font.BOLD,20));
- r4.setBackground(Color.LIGHT_GRAY);
- r4.setForeground(Color.BLACK);
- JButton r5 = new JButton("Cell Five");
- r5.setBounds(960,300,198,45);
- r5.setFont(new Font("Times New Roman",Font.BOLD,20));
- r5.setBackground(Color.LIGHT_GRAY);
- r5.setForeground(Color.BLACK);
- JButton r6 = new JButton("Cell Six");
- r6.setBounds(960,350,198,47);
- r6.setFont(new Font("Times New Roman",Font.BOLD,20));
- r6.setBackground(Color.LIGHT_GRAY);
- r6.setForeground(Color.BLACK);
- JButton r7 = new JButton("Cell Seven");
- r7.setBounds(960,400,198,45);
- r7.setFont(new Font("Times New Roman",Font.BOLD,20));
- r7.setBackground(Color.LIGHT_GRAY);
- r7.setForeground(Color.BLACK);
- JButton r8 = new JButton("Cell Eight");
- r8.setBounds(960,448,198,45);
- r8.setFont(new Font("Times New Roman",Font.BOLD,20));
- r8.setBackground(Color.LIGHT_GRAY);
- r8.setForeground(Color.BLACK);
- JButton r9 = new JButton("Cell Nine");
- r9.setBounds(500,311,177,66);
- r9.setFont(new Font("Times New Roman",Font.BOLD,20));
- r9.setBackground(Color.LIGHT_GRAY);
- r9.setForeground(Color.BLACK);
- JButton r10 = new JButton("Cell Ten");
- r10.setBounds(681,311,181,66);
- r10.setFont(new Font("Times New Roman",Font.BOLD,20));
- r10.setBackground(Color.LIGHT_GRAY);
- r10.setForeground(Color.BLACK);
- f4.add(r1);
- f4.add(r2);
- f4.add(r3);
- f4.add(r4);
- f4.add(r5);
- f4.add(r6);
- f4.add(r7);
- f4.add(r8);
- f4.add(r9);
- f4.add(r10);
- JLabel lp12 = new JLabel();
- lp12.setBounds(0,230,1366,350);
- lp12.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\jm.jpg"));
- f4.add(lp12);
- BPrisoner.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_P){
- BPrisoner.doClick();
- }
- }
- });
- BHome.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_H){
- BHome.doClick();
- }
- }
- });
- BRoom.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_R){
- BRoom.doClick();
- }
- }
- });
- r1.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_1){
- r1.doClick();
- }
- }
- });
- r1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f5 = new JFrame();
- f5.setVisible(true);
- f4.setVisible(false);
- f5.setSize(1366,768);
- f5.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f5.setIconImage(icon.getImage());
- f5.add(c5);
- c5.setBounds(0,650,200,50);
- //B-1
- JLabel rl1 = new JLabel("Cell One");
- rl1.setBounds(485,30,450,70);
- rl1.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl1.setForeground(Color.WHITE);
- f5.add(rl1);
- JButton a1 = new JButton("Add");
- a1.setBounds(1180,135,150,75);
- a1.setFont(new Font("Times New Roman",Font.BOLD,20));
- a1.setBackground(Color.LIGHT_GRAY);
- a1.setForeground(Color.BLACK);
- f5.add(a1);
- JButton d1 = new JButton("Delete");
- d1.setBounds(1000,135,150,75);
- d1.setFont(new Font("Times New Roman",Font.BOLD,20));
- d1.setBackground(Color.LIGHT_GRAY);
- d1.setForeground(Color.BLACK);
- f5.add(d1);
- JButton u1 = new JButton("Edit");
- u1.setBounds(820,135,150,75);
- u1.setFont(new Font("Times New Roman",Font.BOLD,20));
- u1.setBackground(Color.LIGHT_GRAY);
- u1.setForeground(Color.BLACK);
- f5.add(u1);
- JPanel rp1 = new JPanel();
- f5.add(rp1);
- rp1.setBounds(0,0,1366,120);
- rp1.setBackground(Color.BLACK);
- rp1.setBorder(BorderFactory.createEtchedBorder(1));
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.BLACK);
- Font font = (new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f5.add(pane);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f5.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f5.setVisible(false);
- f4.setVisible(true);
- }
- });
- //ADD-1
- a1.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_A){
- a1.doClick();
- }
- }
- });
- a1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f15 = new JFrame();
- f15.setVisible(true);
- f5.setVisible(false);
- f15.setSize(1366,768);
- f15.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f15.setIconImage(icon.getImage());
- f15.add(c5);
- c5.setBounds(0,650,200,50);
- JPanel rp16 = new JPanel();
- rp16.setBounds(0,0,1366,120);
- rp16.setBackground(Color.BLACK);
- rp16.setBorder(BorderFactory.createEtchedBorder(1));
- f15.add(rp16);
- JLabel rl5 = new JLabel("Prisoner Fill Up Form");
- rl5.setBounds(485,30,450,70);
- rl5.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl5.setForeground(Color.WHITE);
- rp16.add(rl5);
- JPanel rp26 = new JPanel();
- rp26.setBounds(12,130,1325,450);
- rp26.setBackground(Color.BLACK);
- rp26.setBorder(BorderFactory.createEtchedBorder());
- f15.add(rp26);
- JLabel r140 = new JLabel();
- r140.setBounds(15,15,130,130);
- r140.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
- rp26.add(r140);
- //Prisoner aydi:
- JLabel r119 = new JLabel ("FIRSTNAME:");
- r119.setBounds(183,40,200,50);
- r119.setFont(new Font("Times new Roman",Font.BOLD,20));
- r119.setForeground(Color.WHITE);
- JTextField tf96 = new JTextField ();
- tf96.setBounds(180,85,210,30);
- rp26.add(tf96);
- rp26.add(r119);
- JLabel r120 = new JLabel ("MI:");
- r120.setBounds(413,40,200,50);
- r120.setFont(new Font("Times new Roman",Font.BOLD,20));
- r120.setForeground(Color.WHITE);
- JTextField tf97 = new JTextField ();
- tf97.setBounds(410,85,80,30);
- rp26.add(tf97);
- rp26.add(r120);
- JLabel r121 = new JLabel ("LASTNAME:");
- r121.setBounds(518,40,200,50);
- r121.setFont(new Font("Times new Roman",Font.BOLD,20));
- r121.setForeground(Color.WHITE);
- JTextField tf98 = new JTextField ();
- tf98.setBounds(515,85,210,30);
- rp26.add(tf98);
- rp26.add(r121);
- JLabel r122 = new JLabel ("SEX:");
- r122.setBounds(751,40,200,50);
- r122.setFont(new Font("Times new Roman",Font.BOLD,20));
- r122.setForeground(Color.WHITE);
- JTextField tf99 = new JTextField ();
- tf99.setBounds(750,85,90,30);
- rp26.add(tf99);
- rp26.add(r122);
- JLabel r123 = new JLabel ("AGE:");
- r123.setBounds(861,40,200,50);
- r123.setFont(new Font("Times new Roman",Font.BOLD,20));
- r123.setForeground(Color.WHITE);
- JTextField tf100 = new JTextField ();
- tf100.setBounds(860,85,60,30);
- rp26.add(tf100);
- rp26.add(r123);
- JLabel r124 = new JLabel ("ADDRESS:");
- r124.setBounds(951,40,200,50);
- r124.setFont(new Font("Times new Roman",Font.BOLD,20));
- r124.setForeground(Color.WHITE);
- JTextField tf101 = new JTextField ();
- tf101.setBounds(950,85,355,30);
- rp26.add(tf101);
- rp26.add(r124);
- JLabel r125 = new JLabel ("DATE OF BIRTH:");
- r125.setBounds(17,150,200,50);
- r125.setFont(new Font("Times new Roman",Font.BOLD,20));
- r125.setForeground(Color.WHITE);
- JTextField tf102 = new JTextField ();
- tf102.setBounds(15,195,210,30);
- rp26.add(tf102);
- rp26.add(r125);
- JLabel r126 = new JLabel ("NATIONALITY:");
- r126.setBounds(247,150,200,50);
- r126.setFont(new Font("Times new Roman",Font.BOLD,20));
- r126.setForeground(Color.WHITE);
- JTextField tf103 = new JTextField ();
- tf103.setBounds(245,195,210,30);
- rp26.add(tf103);
- rp26.add(r126);
- JLabel r127 = new JLabel ("HEIGHT:");
- r127.setBounds(482,150,200,50);
- r127.setFont(new Font("Times new Roman",Font.BOLD,20));
- r127.setForeground(Color.WHITE);
- JTextField tf104 = new JTextField ();
- tf104.setBounds(480,195,120,30);
- rp26.add(tf104);
- rp26.add(r127);
- JLabel r128 = new JLabel ("WEIGHT:");
- r128.setBounds(636,150,200,50);
- r128.setFont(new Font("Times new Roman",Font.BOLD,20));
- r128.setForeground(Color.WHITE);
- JTextField tf105 = new JTextField ();
- tf105.setBounds(630,195,120,30);
- rp26.add(tf105);
- rp26.add(r128);
- JLabel r129 = new JLabel ("EYE COLOR:");
- r129.setBounds(787,150,200,50);
- r129.setFont(new Font("Times new Roman",Font.BOLD,20));
- r129.setForeground(Color.WHITE);
- JTextField tf106 = new JTextField ();
- tf106.setBounds(785 ,195,190,30);
- rp26.add(tf106);
- rp26.add(r129);
- JLabel r130 = new JLabel ("PHONE NUMBER:");
- r130.setBounds(997,150,200,50);
- r130.setFont(new Font("Times new Roman",Font.BOLD,20));
- r130.setForeground(Color.WHITE);
- JTextField tf107 = new JTextField ();
- tf107.setBounds(995,195,310,30);
- rp26.add(tf107);
- rp26.add(r130);
- JLabel r131 = new JLabel ("LANGUAGE:");
- r131.setBounds(16,250,200,50);
- r131.setFont(new Font("Times new Roman",Font.BOLD,20));
- r131.setForeground(Color.WHITE);
- JTextField tf108 = new JTextField ();
- tf108.setBounds(15,295,210,30);
- rp26.add(tf108);
- rp26.add(r131);
- JLabel r132 = new JLabel ("DATE OF CAPTURE:");
- r132.setBounds(247,250,200,50);
- r132.setFont(new Font("Times new Roman",Font.BOLD,20));
- r132.setForeground(Color.WHITE);
- JTextField tf109 = new JTextField ();
- tf109.setBounds(245,295,210,30);
- rp26.add(tf109);
- rp26.add(r132);
- JLabel r133 = new JLabel ("PLACE OF CAPTURE:");
- r133.setBounds(482,250,220,50);
- r133.setFont(new Font("Times new Roman",Font.BOLD,20));
- r133.setForeground(Color.WHITE);
- JTextField tf110 = new JTextField ();
- tf110.setBounds(480,295,320,30);
- rp26.add(tf110);
- rp26.add(r133);
- JLabel r134 = new JLabel ("CIVILLIAN OCCUPATION:");
- r134.setBounds(827,250,270,50);
- r134.setFont(new Font("Times new Roman",Font.BOLD,20));
- r134.setForeground(Color.WHITE);
- JTextField tf111 = new JTextField ();
- tf111.setBounds(825,295,480,30);
- rp26.add(tf111);
- rp26.add(r134);
- JLabel r135 = new JLabel ("PHYSICAL CONDITION:");
- r135.setBounds(16,350,260,50);
- r135.setFont(new Font("Times new Roman",Font.BOLD,20));
- r135.setForeground(Color.WHITE);
- JTextField tf112 = new JTextField ();
- tf112.setBounds(15,395,260,30);
- rp26.add(tf112);
- rp26.add(r135);
- JLabel r136 = new JLabel ("DAYS IN JAIL:");
- r136.setBounds(302,350,250,50);
- r136.setFont(new Font("Times new Roman",Font.BOLD,20));
- r136.setForeground(Color.WHITE);
- JTextField tf113 = new JTextField ();
- tf113.setBounds(300,395,180,30);
- rp26.add(tf113);
- rp26.add(r136);
- JLabel r137 = new JLabel ("ARRIVAL OF PRISONER:");
- r137.setBounds(502,350,280,50);
- r137.setFont(new Font("Times new Roman",Font.BOLD,20));
- r137.setForeground(Color.WHITE);
- JTextField tf114 = new JTextField ();
- tf114.setBounds(500,395,280,30);
- rp26.add(tf114);
- rp26.add(r137);
- JLabel r138 = new JLabel ("DATE/TIME:");
- r138.setBounds(802,350,250,50);
- r138.setFont(new Font("Times new Roman",Font.BOLD,20));
- r138.setForeground(Color.WHITE);
- JTextField tf115 = new JTextField ();
- tf115.setBounds(800,395,150,30);
- rp26.add(tf115);
- rp26.add(r138);
- JLabel r139 = new JLabel ("ARRIVAL OFFICER:");
- r139.setBounds(972,350,250,50);
- r139.setFont(new Font("Times new Roman",Font.BOLD,20));
- r139.setForeground(Color.WHITE);
- JTextField tf116 = new JTextField ();
- tf116.setBounds(970,395,335,30);
- rp26.add(tf116);
- rp26.add(r139);
- rp26.setLayout(null);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f15.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f15.setVisible(false);
- f5.setVisible(true);
- }
- });
- //update
- JButton update = new JButton("Update");
- update.setBounds(820,600,150,75);
- update.setFont(new Font("Times New Roman",Font.BOLD,20));
- update.setBackground(Color.LIGHT_GRAY);
- update.setForeground(Color.BLACK);
- f15.add(update);
- //Save
- JButton Save = new JButton("Save");
- Save.setBounds(1000,600,150,75);
- Save.setFont(new Font("Times New Roman",Font.BOLD,20));
- Save.setBackground(Color.LIGHT_GRAY);
- Save.setForeground(Color.BLACK);
- f15.add(Save);
- u1.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u1.doClick();
- }
- }
- });
- u1.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- f15.setVisible(true);
- f5.setVisible(false);
- }
- });
- //UPDATE FUNCTION
- update.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- f15.setVisible(false);
- f5.setVisible(true);
- JOptionPane.showMessageDialog(f5,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- });
- //ADD FUNCTION
- Save.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_S){
- Save.doClick();
- }
- }
- });
- Save.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to ADD This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- try {
- Connection con = DriverManager.getConnection(dburl, userdb, passdb);
- String squery = "insert into prisoner (Firstname,Middlename,Lastname,Sex,Age,Address,Date_Of_Birth,Nationality,Height,Weight,Eyecolor,Phonenumber,Language,Date_Of_Capture,Place_Of_Capture,Civillian_Occupation,Physical_Condition,Days_In_Jail,Arrival_Prisoner,Date_Time,Arrival_Officer) values ('"+Tf96.getText()+"','"+Tf97.getText() + "', '" +Tf98.getText()+"','"+Tf99.getText()+"','"+Tf100.getText()+"','"+Tf101.getText()+"','"+Tf102.getText()+"','"+Tf103.getText()+"','"+Tf104.getText()+"','"+Tf105.getText()+"', '"+Tf106.getText()+"','"+Tf107.getText()+"','"+Tf108.getText()+"','"+Tf109.getText()+"','"+Tf110.getText()+"','"+Tf111.getText()+"','"+Tf112.getText()+"','"+Tf113.getText()+"','"+Tf114.getText()+"','"+Tf115.getText()+"','"+Tf115.getText()+"')";
- Statement st = con.createStatement();
- st.executeUpdate(squery);
- } catch (Exception ex) {
- System.out.println(ex);
- System.out.println("Failed ");
- }
- f15.setVisible(false);
- f5.setVisible(true);
- JOptionPane.showMessageDialog(f5,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //DELETE FUNCTION
- d1.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_D){
- d1.doClick();
- }
- }
- });
- d1.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to DELETE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- JOptionPane.showMessageDialog(f5,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- }
- });
- }
- });
- r2.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_2){
- r2.doClick();
- }
- }
- });
- //B2
- r2.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f6 = new JFrame();
- f6.setVisible(true);
- f4.setVisible(false);
- f6.setSize(1366,768);
- f6.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f6.setIconImage(icon.getImage());
- f6.add(c5);
- c5.setBounds(0,650,200,50);
- JLabel rl2 = new JLabel("Cell Two");
- rl2.setBounds(485,30,450,70);
- rl2.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl2.setForeground(Color.WHITE);
- f6.add(rl2);
- JButton a2 = new JButton("Add");
- a2.setBounds(1180,135,150,75);
- a2.setFont(new Font("Times New Roman",Font.BOLD,20));
- a2.setBackground(Color.LIGHT_GRAY);
- a2.setForeground(Color.BLACK);
- f6.add(a2);
- JButton d2 = new JButton("Delete");
- d2.setBounds(1000,135,150,75);
- d2.setFont(new Font("Times New Roman",Font.BOLD,20));
- d2.setBackground(Color.LIGHT_GRAY);
- d2.setForeground(Color.BLACK);
- f6.add(d2);
- JButton u2 = new JButton("Edit");
- u2.setBounds(820,135,150,75);
- u2.setFont(new Font("Times New Roman",Font.BOLD,20));
- u2.setBackground(Color.LIGHT_GRAY);
- u2.setForeground(Color.BLACK);
- f6.add(u2);
- JPanel rp17 = new JPanel();
- f6.add(rp17);
- rp17.setBounds(0,0,1366,120);
- rp17.setBackground(Color.BLACK);
- rp17.setBorder(BorderFactory.createEtchedBorder(1));
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.BLACK);
- Font font =(new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f6.add(pane);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f6.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f6.setVisible(false);
- f4.setVisible(true);
- }
- });
- a2.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_A){
- a2.doClick();
- }
- }
- });
- //ADD-2
- a2.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f16 = new JFrame();
- f16.setVisible(true);
- f6.setVisible(false);
- f16.setSize(1366,768);
- f16.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f16.setIconImage(icon.getImage());
- f16.add(c5);
- c5.setBounds(0,650,200,50);
- JPanel rp17 = new JPanel();
- rp17.setBounds(0,0,1366,120);
- rp17.setBackground(Color.BLACK);
- rp17.setBorder(BorderFactory.createEtchedBorder(1));
- f16.add(rp17);
- JLabel rl6 = new JLabel("Prisoner Fill Up Form");
- rl6.setBounds(485,30,450,70);
- rl6.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl6.setForeground(Color.WHITE);
- rp17.add(rl6);
- JPanel rp27 = new JPanel();
- rp27.setBounds(12,130,1325,450);
- rp27.setBackground(Color.BLACK);
- rp27.setBorder(BorderFactory.createEtchedBorder());
- f16.add(rp27);
- JLabel r141 = new JLabel();
- r141.setBounds(15,15,130,130);
- r141.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
- rp27.add(r141);
- //Prisoner aydi:
- JLabel r142 = new JLabel ("FIRSTNAME:");
- r142.setBounds(183,40,200,50);
- r142.setFont(new Font("Times new Roman",Font.BOLD,20));
- r142.setForeground(Color.WHITE);
- JTextField tf117 = new JTextField ();
- tf117.setBounds(180,85,210,30);
- rp27.add(tf117);
- rp27.add(r142);
- JLabel r143 = new JLabel ("MI:");
- r143.setBounds(413,40,200,50);
- r143.setFont(new Font("Times new Roman",Font.BOLD,20));
- r143.setForeground(Color.WHITE);
- JTextField tf118 = new JTextField ();
- tf118.setBounds(410,85,80,30);
- rp27.add(tf118);
- rp27.add(r143);
- JLabel r144 = new JLabel ("LASTNAME:");
- r144.setBounds(518,40,200,50);
- r144.setFont(new Font("Times new Roman",Font.BOLD,20));
- r144.setForeground(Color.WHITE);
- JTextField tf119 = new JTextField ();
- tf119.setBounds(515,85,210,30);
- rp27.add(tf119);
- rp27.add(r144);
- JLabel r145 = new JLabel ("SEX:");
- r145.setBounds(751,40,200,50);
- r145.setFont(new Font("Times new Roman",Font.BOLD,20));
- r145.setForeground(Color.WHITE);
- JTextField tf120 = new JTextField ();
- tf120.setBounds(750,85,90,30);
- rp27.add(tf120);
- rp27.add(r145);
- JLabel r146 = new JLabel ("AGE:");
- r146.setBounds(861,40,200,50);
- r146.setFont(new Font("Times new Roman",Font.BOLD,20));
- r146.setForeground(Color.WHITE);
- JTextField tf121 = new JTextField ();
- tf121.setBounds(860,85,60,30);
- rp27.add(tf121);
- rp27.add(r146);
- JLabel r147 = new JLabel ("ADDRESS:");
- r147.setBounds(951,40,200,50);
- r147.setFont(new Font("Times new Roman",Font.BOLD,20));
- r147.setForeground(Color.WHITE);
- JTextField tf122 = new JTextField ();
- tf122.setBounds(950,85,355,30);
- rp27.add(tf122);
- rp27.add(r147);
- JLabel r148 = new JLabel ("DATE OF BIRTH:");
- r148.setBounds(17,150,200,50);
- r148.setFont(new Font("Times new Roman",Font.BOLD,20));
- r148.setForeground(Color.WHITE);
- JTextField tf123 = new JTextField ();
- tf123.setBounds(15,195,210,30);
- rp27.add(tf123);
- rp27.add(r148);
- JLabel r149 = new JLabel ("NATIONALITY:");
- r149.setBounds(247,150,200,50);
- r149.setFont(new Font("Times new Roman",Font.BOLD,20));
- r149.setForeground(Color.WHITE);
- JTextField tf124 = new JTextField ();
- tf124.setBounds(245,195,210,30);
- rp27.add(tf124);
- rp27.add(r149);
- JLabel r150 = new JLabel ("HEIGHT:");
- r150.setBounds(482,150,200,50);
- r150.setFont(new Font("Times new Roman",Font.BOLD,20));
- r150.setForeground(Color.WHITE);
- JTextField tf125 = new JTextField ();
- tf125.setBounds(480,195,120,30);
- rp27.add(tf125);
- rp27.add(r150);
- JLabel r151 = new JLabel ("WEIGHT:");
- r151.setBounds(636,150,200,50);
- r151.setFont(new Font("Times new Roman",Font.BOLD,20));
- r151.setForeground(Color.WHITE);
- JTextField tf126 = new JTextField ();
- tf126.setBounds(630,195,120,30);
- rp27.add(tf126);
- rp27.add(r151);
- JLabel r152 = new JLabel ("EYE COLOR:");
- r152.setBounds(787,150,200,50);
- r152.setFont(new Font("Times new Roman",Font.BOLD,20));
- r152.setForeground(Color.WHITE);
- JTextField tf127 = new JTextField ();
- tf127.setBounds(785 ,195,190,30);
- rp27.add(tf127);
- rp27.add(r152);
- JLabel r153 = new JLabel ("PHONE NUMBER:");
- r153.setBounds(997,150,200,50);
- r153.setFont(new Font("Times new Roman",Font.BOLD,20));
- r153.setForeground(Color.WHITE);
- JTextField tf128 = new JTextField ();
- tf128.setBounds(995,195,310,30);
- rp27.add(tf128);
- rp27.add(r153);
- JLabel r154 = new JLabel ("LANGUAGE:");
- r154.setBounds(16,250,200,50);
- r154.setFont(new Font("Times new Roman",Font.BOLD,20));
- r154.setForeground(Color.WHITE);
- JTextField tf129 = new JTextField ();
- tf129.setBounds(15,295,210,30);
- rp27.add(tf129);
- rp27.add(r154);
- JLabel r155 = new JLabel ("DATE OF CAPTURE:");
- r155.setBounds(247,250,200,50);
- r155.setFont(new Font("Times new Roman",Font.BOLD,20));
- r155.setForeground(Color.WHITE);
- JTextField tf130 = new JTextField ();
- tf130.setBounds(245,295,210,30);
- rp27.add(tf130);
- rp27.add(r155);
- JLabel r156 = new JLabel ("PLACE OF CAPTURE:");
- r156.setBounds(482,250,220,50);
- r156.setFont(new Font("Times new Roman",Font.BOLD,20));
- r156.setForeground(Color.WHITE);
- JTextField tf131 = new JTextField ();
- tf131.setBounds(480,295,320,30);
- rp27.add(tf131);
- rp27.add(r156);
- JLabel r157 = new JLabel ("CIVILLIAN OCCUPATION:");
- r157.setBounds(827,250,270,50);
- r157.setFont(new Font("Times new Roman",Font.BOLD,20));
- r157.setForeground(Color.WHITE);
- JTextField tf132 = new JTextField ();
- tf132.setBounds(825,295,480,30);
- rp27.add(tf132);
- rp27.add(r157);
- JLabel r158 = new JLabel ("PHYSICAL CONDITION:");
- r158.setBounds(16,350,260,50);
- r158.setFont(new Font("Times new Roman",Font.BOLD,20));
- r158.setForeground(Color.WHITE);
- JTextField tf133 = new JTextField ();
- tf133.setBounds(15,395,260,30);
- rp27.add(tf133);
- rp27.add(r158);
- JLabel r159 = new JLabel ("DAYS IN JAIL:");
- r159.setBounds(302,350,250,50);
- r159.setFont(new Font("Times new Roman",Font.BOLD,20));
- r159.setForeground(Color.WHITE);
- JTextField tf134 = new JTextField ();
- tf134.setBounds(300,395,180,30);
- rp27.add(tf134);
- rp27.add(r159);
- JLabel r160 = new JLabel ("ARRIVAL OF PRISONER:");
- r160.setBounds(502,350,280,50);
- r160.setFont(new Font("Times new Roman",Font.BOLD,20));
- r160.setForeground(Color.WHITE);
- JTextField tf135 = new JTextField ();
- tf135.setBounds(500,395,280,30);
- rp27.add(tf135);
- rp27.add(r160);
- JLabel r161 = new JLabel ("DATE/TIME:");
- r161.setBounds(802,350,250,50);
- r161.setFont(new Font("Times new Roman",Font.BOLD,20));
- r161.setForeground(Color.WHITE);
- JTextField tf136 = new JTextField ();
- tf136.setBounds(800,395,150,30);
- rp27.add(tf136);
- rp27.add(r161);
- JLabel r162 = new JLabel ("ARRIVAL OFFICER:");
- r162.setBounds(972,350,250,50);
- r162.setFont(new Font("Times new Roman",Font.BOLD,20));
- r162.setForeground(Color.WHITE);
- JTextField tf137 = new JTextField ();
- tf137.setBounds(970,395,335,30);
- rp27.add(tf137);
- rp27.add(r162);
- rp27.setLayout(null);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f16.add(Back);
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f16.setVisible(false);
- f6.setVisible(true);
- }
- });
- //update
- JButton update = new JButton("Update");
- update.setBounds(820,600,150,75);
- update.setFont(new Font("Times New Roman",Font.BOLD,20));
- update.setBackground(Color.LIGHT_GRAY);
- update.setForeground(Color.BLACK);
- f16.add(update);
- //Save
- JButton Save = new JButton("Save");
- Save.setBounds(1000,600,150,75);
- Save.setFont(new Font("Times New Roman",Font.BOLD,20));
- Save.setBackground(Color.LIGHT_GRAY);
- Save.setForeground(Color.BLACK);
- f16.add(Save);
- u2.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u2.doClick();
- }
- }
- });
- u2.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f16.setVisible(true);
- f6.setVisible(false);
- }
- });
- //UPDATE FUNCTION
- update.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_U){
- update.doClick();
- }
- }
- });
- update.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to UPDATE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f16.setVisible(false);
- f6.setVisible(true);
- JOptionPane.showMessageDialog(f6,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //ADD FUNCTION
- Save.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_S){
- Save.doClick();
- }
- }
- });
- Save.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to ADD This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f16.setVisible(false);
- f6.setVisible(true);
- JOptionPane.showMessageDialog(f6,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //DELETE FUNCTION
- d2.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_D){
- d2.doClick();
- }
- }
- });
- d2.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to DELETE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- JOptionPane.showMessageDialog(f6,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- }
- });
- }
- });
- //B3
- r3.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_3){
- r3.doClick();
- }
- }
- });
- r3.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f7 = new JFrame();
- f7.setVisible(true);
- f4.setVisible(false);
- f7.setSize(1366,768);
- f7.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f7.setIconImage(icon.getImage());
- f7.add(c5);
- c5.setBounds(0,650,200,50);
- JLabel rl3 = new JLabel("Cell Three");
- rl3.setBounds(485,30,450,70);
- rl3.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl3.setForeground(Color.WHITE);
- f7.add(rl3);
- JButton a3 = new JButton("Add");
- a3.setBounds(1180,135,150,75);
- a3.setFont(new Font("Times New Roman",Font.BOLD,20));
- a3.setBackground(Color.LIGHT_GRAY);
- a3.setForeground(Color.BLACK);
- f7.add(a3);
- JButton d3 = new JButton("Delete");
- d3.setBounds(1000,135,150,75);
- d3.setFont(new Font("Times New Roman",Font.BOLD,20));
- d3.setBackground(Color.LIGHT_GRAY);
- d3.setForeground(Color.BLACK);
- f7.add(d3);
- JButton u3 = new JButton("Edit");
- u3.setBounds(820,135,150,75);
- u3.setFont(new Font("Times New Roman",Font.BOLD,20));
- u3.setBackground(Color.LIGHT_GRAY);
- u3.setForeground(Color.BLACK);
- f7.add(u3);
- JPanel rp3 = new JPanel();
- f7.add(rp3);
- rp3.setBounds(0,0,1366,120);
- rp3.setBackground(Color.BLACK);
- rp3.setBorder(BorderFactory.createEtchedBorder(1));
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.BLACK);
- Font font =(new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f7.add(pane);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f7.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f7.setVisible(false);
- f4.setVisible(true);
- }
- });
- //ADD-3
- a3.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_A){
- a3.doClick();
- }
- }
- });
- a3.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f17 = new JFrame();
- f17.setVisible(true);
- f7.setVisible(false);
- f17.setSize(1366,768);
- f17.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f17.setIconImage(icon.getImage());
- f17.add(c5);
- c5.setBounds(0,650,200,50);
- JPanel rp18 = new JPanel();
- rp18.setBounds(0,0,1366,120);
- rp18.setBackground(Color.BLACK);
- rp18.setBorder(BorderFactory.createEtchedBorder(1));
- f17.add(rp18);
- JLabel rl7 = new JLabel("Prisoner Fill Up Form");
- rl7.setBounds(485,30,450,70);
- rl7.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl7.setForeground(Color.WHITE);
- rp18.add(rl7);
- JPanel rp28 = new JPanel();
- rp28.setBounds(12,130,1325,450);
- rp28.setBackground(Color.BLACK);
- rp28.setBorder(BorderFactory.createEtchedBorder());
- f17.add(rp28);
- JLabel r140 = new JLabel();
- r140.setBounds(15,15,130,130);
- r140.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
- rp28.add(r140);
- //Prisoner aydi:
- JLabel r163 = new JLabel ("FIRSTNAME:");
- r163.setBounds(183,40,200,50);
- r163.setFont(new Font("Times new Roman",Font.BOLD,20));
- r163.setForeground(Color.WHITE);
- JTextField tf138 = new JTextField ();
- tf138.setBounds(180,85,210,30);
- rp28.add(tf138);
- rp28.add(r163);
- JLabel r164 = new JLabel ("MI:");
- r164.setBounds(413,40,200,50);
- r164.setFont(new Font("Times new Roman",Font.BOLD,20));
- r164.setForeground(Color.WHITE);
- JTextField tf139 = new JTextField ();
- tf139.setBounds(410,85,80,30);
- rp28.add(tf139);
- rp28.add(r164);
- JLabel r165 = new JLabel ("LASTNAME:");
- r165.setBounds(518,40,200,50);
- r165.setFont(new Font("Times new Roman",Font.BOLD,20));
- r165.setForeground(Color.WHITE);
- JTextField tf140 = new JTextField ();
- tf140.setBounds(515,85,210,30);
- rp28.add(tf140);
- rp28.add(r165);
- JLabel r166 = new JLabel ("SEX:");
- r166.setBounds(751,40,200,50);
- r166.setFont(new Font("Times new Roman",Font.BOLD,20));
- r166.setForeground(Color.WHITE);
- JTextField tf141 = new JTextField ();
- tf141.setBounds(750,85,90,30);
- rp28.add(tf141);
- rp28.add(r166);
- JLabel r167 = new JLabel ("AGE:");
- r167.setBounds(861,40,200,50);
- r167.setFont(new Font("Times new Roman",Font.BOLD,20));
- r167.setForeground(Color.WHITE);
- JTextField tf142 = new JTextField ();
- tf142.setBounds(860,85,60,30);
- rp28.add(tf142);
- rp28.add(r167);
- JLabel r168 = new JLabel ("ADDRESS:");
- r168.setBounds(951,40,200,50);
- r168.setFont(new Font("Times new Roman",Font.BOLD,20));
- r168.setForeground(Color.WHITE);
- JTextField tf143 = new JTextField ();
- tf143.setBounds(950,85,355,30);
- rp28.add(tf143);
- rp28.add(r168);
- JLabel r169 = new JLabel ("DATE OF BIRTH:");
- r169.setBounds(17,150,200,50);
- r169.setFont(new Font("Times new Roman",Font.BOLD,20));
- r169.setForeground(Color.WHITE);
- JTextField tf144 = new JTextField ();
- tf144.setBounds(15,195,210,30);
- rp28.add(tf144);
- rp28.add(r169);
- JLabel r170 = new JLabel ("NATIONALITY:");
- r170.setBounds(247,150,200,50);
- r170.setFont(new Font("Times new Roman",Font.BOLD,20));
- r170.setForeground(Color.WHITE);
- JTextField tf145 = new JTextField ();
- tf145.setBounds(245,195,210,30);
- rp28.add(tf145);
- rp28.add(r170);
- JLabel r171 = new JLabel ("HEIGHT:");
- r171.setBounds(482,150,200,50);
- r171.setFont(new Font("Times new Roman",Font.BOLD,20));
- r171.setForeground(Color.WHITE);
- JTextField tf146 = new JTextField ();
- tf146.setBounds(480,195,120,30);
- rp28.add(tf146);
- rp28.add(r171);
- JLabel r172 = new JLabel ("WEIGHT:");
- r172.setBounds(636,150,200,50);
- r172.setFont(new Font("Times new Roman",Font.BOLD,20));
- r172.setForeground(Color.WHITE);
- JTextField tf147 = new JTextField ();
- tf147.setBounds(630,195,120,30);
- rp28.add(tf147);
- rp28.add(r172);
- JLabel r173 = new JLabel ("EYE COLOR:");
- r173.setBounds(787,150,200,50);
- r173.setFont(new Font("Times new Roman",Font.BOLD,20));
- r173.setForeground(Color.WHITE);
- JTextField tf148 = new JTextField ();
- tf148.setBounds(785 ,195,190,30);
- rp28.add(tf148);
- rp28.add(r173);
- JLabel r174 = new JLabel ("PHONE NUMBER:");
- r174.setBounds(997,150,200,50);
- r174.setFont(new Font("Times new Roman",Font.BOLD,20));
- r174.setForeground(Color.WHITE);
- JTextField tf149 = new JTextField ();
- tf149.setBounds(995,195,310,30);
- rp28.add(tf149);
- rp28.add(r174);
- JLabel r175 = new JLabel ("LANGUAGE:");
- r175.setBounds(16,250,200,50);
- r175.setFont(new Font("Times new Roman",Font.BOLD,20));
- r175.setForeground(Color.WHITE);
- JTextField tf150 = new JTextField ();
- tf150.setBounds(15,295,210,30);
- rp28.add(tf150);
- rp28.add(r175);
- JLabel r176 = new JLabel ("DATE OF CAPTURE:");
- r176.setBounds(247,250,200,50);
- r176.setFont(new Font("Times new Roman",Font.BOLD,20));
- r176.setForeground(Color.WHITE);
- JTextField tf151 = new JTextField ();
- tf151.setBounds(245,295,210,30);
- rp28.add(tf151);
- rp28.add(r176);
- JLabel r177 = new JLabel ("PLACE OF CAPTURE:");
- r177.setBounds(482,250,220,50);
- r177.setFont(new Font("Times new Roman",Font.BOLD,20));
- r177.setForeground(Color.WHITE);
- JTextField tf152 = new JTextField ();
- tf152.setBounds(480,295,320,30);
- rp28.add(tf152);
- rp28.add(r177);
- JLabel r178 = new JLabel ("CIVILLIAN OCCUPATION:");
- r178.setBounds(827,250,270,50);
- r178.setFont(new Font("Times new Roman",Font.BOLD,20));
- r178.setForeground(Color.WHITE);
- JTextField tf153 = new JTextField ();
- tf153.setBounds(825,295,480,30);
- rp28.add(tf153);
- rp28.add(r178);
- JLabel r179 = new JLabel ("PHYSICAL CONDITION:");
- r179.setBounds(16,350,260,50);
- r179.setFont(new Font("Times new Roman",Font.BOLD,20));
- r179.setForeground(Color.WHITE);
- JTextField tf154 = new JTextField ();
- tf154.setBounds(15,395,260,30);
- rp28.add(tf154);
- rp28.add(r179);
- JLabel r180 = new JLabel ("DAYS IN JAIL:");
- r180.setBounds(302,350,250,50);
- r180.setFont(new Font("Times new Roman",Font.BOLD,20));
- r180.setForeground(Color.WHITE);
- JTextField tf155 = new JTextField ();
- tf155.setBounds(300,395,180,30);
- rp28.add(tf155);
- rp28.add(r180);
- JLabel r181 = new JLabel ("ARRIVAL OF PRISONER:");
- r181.setBounds(502,350,280,50);
- r181.setFont(new Font("Times new Roman",Font.BOLD,20));
- r181.setForeground(Color.WHITE);
- JTextField tf156 = new JTextField ();
- tf156.setBounds(500,395,280,30);
- rp28.add(tf156);
- rp28.add(r181);
- JLabel r182 = new JLabel ("DATE/TIME:");
- r182.setBounds(802,350,250,50);
- r182.setFont(new Font("Times new Roman",Font.BOLD,20));
- r182.setForeground(Color.WHITE);
- JTextField tf157 = new JTextField ();
- tf157.setBounds(800,395,150,30);
- rp28.add(tf157);
- rp28.add(r182);
- JLabel r183 = new JLabel ("ARRIVAL OFFICER:");
- r183.setBounds(972,350,250,50);
- r183.setFont(new Font("Times new Roman",Font.BOLD,20));
- r183.setForeground(Color.WHITE);
- JTextField tf158 = new JTextField ();
- tf158.setBounds(970,395,335,30);
- rp28.add(tf158);
- rp28.add(r183);
- rp28.setLayout(null);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- f17.add(Back);
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f17.setVisible(false);
- f7.setVisible(true);
- }
- });
- //update
- JButton update = new JButton("Update");
- update.setBounds(820,600,150,75);
- update.setFont(new Font("Times New Roman",Font.BOLD,20));
- update.setBackground(Color.LIGHT_GRAY);
- update.setForeground(Color.BLACK);
- f17.add(update);
- //Save
- JButton Save = new JButton("Save");
- Save.setBounds(1000,600,150,75);
- Save.setFont(new Font("Times New Roman",Font.BOLD,20));
- Save.setBackground(Color.LIGHT_GRAY);
- Save.setForeground(Color.BLACK);
- f17.add(Save);
- u3.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u3.doClick();
- }
- }
- });
- u3.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f17.setVisible(true);
- f7.setVisible(false);
- }
- });
- //UPDATE FUNCTION
- update.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_U){
- update.doClick();
- }
- }
- });
- update.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to UPDATE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f17.setVisible(false);
- f7.setVisible(true);
- JOptionPane.showMessageDialog(f7,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //ADD FUNCTION
- Save.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_S){
- Save.doClick();
- }
- }
- });
- Save.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to ADD This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- JOptionPane.showMessageDialog(f7,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- f17.setVisible(false);
- f7.setVisible(true);
- }
- }
- });
- //DELETE FUNCTION
- d3.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_D){
- d3.doClick();
- }
- }
- });
- d3.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to DELETE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- JOptionPane.showMessageDialog(f7,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- }
- });
- }
- });
- //B4
- r4.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_4){
- r4.doClick();
- }
- }
- });
- r4.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f8 = new JFrame();
- f8.setVisible(true);
- f4.setVisible(false);
- f8.setSize(1366,768);
- f8.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f8.setIconImage(icon.getImage());
- f8.add(c5);
- c5.setBounds(0,650,200,50);
- JLabel rl4 = new JLabel("Cell Four");
- rl4.setBounds(485,30,450,70);
- rl4.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl4.setForeground(Color.WHITE);
- f8.add(rl4);
- JButton a4 = new JButton("Add");
- a4.setBounds(1180,135,150,75);
- a4.setFont(new Font("Times New Roman",Font.BOLD,20));
- a4.setBackground(Color.LIGHT_GRAY);
- a4.setForeground(Color.BLACK);
- f8.add(a4);
- JButton d4 = new JButton("Delete");
- d4.setBounds(1000,135,150,75);
- d4.setFont(new Font("Times New Roman",Font.BOLD,20));
- d4.setBackground(Color.LIGHT_GRAY);
- d4.setForeground(Color.BLACK);
- f8.add(d4);
- JButton u4 = new JButton("Edit");
- u4.setBounds(820,135,150,75);
- u4.setFont(new Font("Times New Roman",Font.BOLD,20));
- u4.setBackground(Color.LIGHT_GRAY);
- u4.setForeground(Color.BLACK);
- f8.add(u4);
- JPanel rp4 = new JPanel();
- f8.add(rp4);
- rp4.setBounds(0,0,1366,120);
- rp4.setBackground(Color.BLACK);
- rp4.setBorder(BorderFactory.createEtchedBorder(1));
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.BLACK);
- Font font = (new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f8.add(pane);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f8.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f8.setVisible(false);
- f4.setVisible(true);
- }
- });
- //ADD-4
- u4.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u4.doClick();
- }
- }
- });
- a4.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f18 = new JFrame();
- f18.setVisible(true);
- f8.setVisible(false);
- f18.setSize(1366,768);
- f18.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f18.setIconImage(icon.getImage());
- f18.add(c5);
- c5.setBounds(0,650,200,50);
- JPanel rp19 = new JPanel();
- rp19.setBounds(0,0,1366,120);
- rp19.setBackground(Color.BLACK);
- rp19.setBorder(BorderFactory.createEtchedBorder(1));
- f18.add(rp19);
- JLabel rl8 = new JLabel("Prisoner Fill Up Form");
- rl8.setBounds(485,30,450,70);
- rl8.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl8.setForeground(Color.WHITE);
- rp19.add(rl8);
- JPanel rp29 = new JPanel();
- rp29.setBounds(12,130,1325,450);
- rp29.setBackground(Color.BLACK);
- rp29.setBorder(BorderFactory.createEtchedBorder());
- f18.add(rp29);
- JLabel r141 = new JLabel();
- r141.setBounds(15,15,130,130);
- r141.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
- rp29.add(r141);
- //Prisoner aydi:
- JLabel r184 = new JLabel ("FIRSTNAME:");
- r184.setBounds(183,40,200,50);
- r184.setFont(new Font("Times new Roman",Font.BOLD,20));
- r184.setForeground(Color.WHITE);
- JTextField tf159 = new JTextField ();
- tf159.setBounds(180,85,210,30);
- rp29.add(tf159);
- rp29.add(r184);
- JLabel r185 = new JLabel ("MI:");
- r185.setBounds(413,40,200,50);
- r185.setFont(new Font("Times new Roman",Font.BOLD,20));
- r185.setForeground(Color.WHITE);
- JTextField tf160 = new JTextField ();
- tf160.setBounds(410,85,80,30);
- rp29.add(tf160);
- rp29.add(r185);
- JLabel r186 = new JLabel ("LASTNAME:");
- r186.setBounds(518,40,200,50);
- r186.setFont(new Font("Times new Roman",Font.BOLD,20));
- r186.setForeground(Color.WHITE);
- JTextField tf161 = new JTextField ();
- tf161.setBounds(515,85,210,30);
- rp29.add(tf161);
- rp29.add(r186);
- JLabel r187 = new JLabel ("SEX:");
- r187.setBounds(751,40,200,50);
- r187.setFont(new Font("Times new Roman",Font.BOLD,20));
- r187.setForeground(Color.WHITE);
- JTextField tf162 = new JTextField ();
- tf162.setBounds(750,85,90,30);
- rp29.add(tf162);
- rp29.add(r187);
- JLabel r188 = new JLabel ("AGE:");
- r188.setBounds(861,40,200,50);
- r188.setFont(new Font("Times new Roman",Font.BOLD,20));
- r188.setForeground(Color.WHITE);
- JTextField tf163 = new JTextField ();
- tf163.setBounds(860,85,60,30);
- rp29.add(tf163);
- rp29.add(r188);
- JLabel r189 = new JLabel ("ADDRESS:");
- r189.setBounds(951,40,200,50);
- r189.setFont(new Font("Times new Roman",Font.BOLD,20));
- r189.setForeground(Color.WHITE);
- JTextField tf164 = new JTextField ();
- tf164.setBounds(950,85,355,30);
- rp29.add(tf164);
- rp29.add(r189);
- JLabel r190 = new JLabel ("DATE OF BIRTH:");
- r190.setBounds(17,150,200,50);
- r190.setFont(new Font("Times new Roman",Font.BOLD,20));
- r190.setForeground(Color.WHITE);
- JTextField tf165 = new JTextField ();
- tf165.setBounds(15,195,210,30);
- rp29.add(tf165);
- rp29.add(r190);
- JLabel r191 = new JLabel ("NATIONALITY:");
- r191.setBounds(247,150,200,50);
- r191.setFont(new Font("Times new Roman",Font.BOLD,20));
- r191.setForeground(Color.WHITE);
- JTextField tf166 = new JTextField ();
- tf166.setBounds(245,195,210,30);
- rp29.add(tf166);
- rp29.add(r191);
- JLabel r192 = new JLabel ("HEIGHT:");
- r192.setBounds(482,150,200,50);
- r192.setFont(new Font("Times new Roman",Font.BOLD,20));
- r192.setForeground(Color.WHITE);
- JTextField tf167 = new JTextField ();
- tf167.setBounds(480,195,120,30);
- rp29.add(tf167);
- rp29.add(r192);
- JLabel r193 = new JLabel ("WEIGHT:");
- r193.setBounds(636,150,200,50);
- r193.setFont(new Font("Times new Roman",Font.BOLD,20));
- r193.setForeground(Color.WHITE);
- JTextField tf168 = new JTextField ();
- tf168.setBounds(630,195,120,30);
- rp29.add(tf168);
- rp29.add(r193);
- JLabel r194 = new JLabel ("EYE COLOR:");
- r194.setBounds(787,150,200,50);
- r194.setFont(new Font("Times new Roman",Font.BOLD,20));
- r194.setForeground(Color.WHITE);
- JTextField tf169 = new JTextField ();
- tf169.setBounds(785 ,195,190,30);
- rp29.add(tf169);
- rp29.add(r194);
- JLabel r195 = new JLabel ("PHONE NUMBER:");
- r195.setBounds(997,150,200,50);
- r195.setFont(new Font("Times new Roman",Font.BOLD,20));
- r195.setForeground(Color.WHITE);
- JTextField tf170 = new JTextField ();
- tf170.setBounds(995,195,310,30);
- rp29.add(tf170);
- rp29.add(r195);
- JLabel r196 = new JLabel ("LANGUAGE:");
- r196.setBounds(16,250,200,50);
- r196.setFont(new Font("Times new Roman",Font.BOLD,20));
- r196.setForeground(Color.WHITE);
- JTextField tf171 = new JTextField ();
- tf171.setBounds(15,295,210,30);
- rp29.add(tf171);
- rp29.add(r196);
- JLabel r197 = new JLabel ("DATE OF CAPTURE:");
- r197.setBounds(247,250,200,50);
- r197.setFont(new Font("Times new Roman",Font.BOLD,20));
- r197.setForeground(Color.WHITE);
- JTextField tf172 = new JTextField ();
- tf172.setBounds(245,295,210,30);
- rp29.add(tf172);
- rp29.add(r197);
- JLabel r198 = new JLabel ("PLACE OF CAPTURE:");
- r198.setBounds(482,250,220,50);
- r198.setFont(new Font("Times new Roman",Font.BOLD,20));
- r198.setForeground(Color.WHITE);
- JTextField tf173 = new JTextField ();
- tf173.setBounds(480,295,320,30);
- rp29.add(tf173);
- rp29.add(r198);
- JLabel r199 = new JLabel ("CIVILLIAN OCCUPATION:");
- r199.setBounds(827,250,270,50);
- r199.setFont(new Font("Times new Roman",Font.BOLD,20));
- r199.setForeground(Color.WHITE);
- JTextField tf174 = new JTextField ();
- tf174.setBounds(825,295,480,30);
- rp29.add(tf174);
- rp29.add(r199);
- JLabel r200 = new JLabel ("PHYSICAL CONDITION:");
- r200.setBounds(16,350,260,50);
- r200.setFont(new Font("Times new Roman",Font.BOLD,20));
- r200.setForeground(Color.WHITE);
- JTextField tf175 = new JTextField ();
- tf175.setBounds(15,395,260,30);
- rp29.add(tf175);
- rp29.add(r200);
- JLabel r201 = new JLabel ("DAYS IN JAIL:");
- r201.setBounds(302,350,250,50);
- r201.setFont(new Font("Times new Roman",Font.BOLD,20));
- r201.setForeground(Color.WHITE);
- JTextField tf176 = new JTextField ();
- tf176.setBounds(300,395,180,30);
- rp29.add(tf176);
- rp29.add(r201);
- JLabel r202 = new JLabel ("ARRIVAL OF PRISONER:");
- r202.setBounds(502,350,280,50);
- r202.setFont(new Font("Times new Roman",Font.BOLD,20));
- r202.setForeground(Color.WHITE);
- JTextField tf177 = new JTextField ();
- tf177.setBounds(500,395,280,30);
- rp29.add(tf177);
- rp29.add(r202);
- JLabel r203 = new JLabel ("DATE/TIME:");
- r203.setBounds(802,350,250,50);
- r203.setFont(new Font("Times new Roman",Font.BOLD,20));
- r203.setForeground(Color.WHITE);
- JTextField tf178 = new JTextField ();
- tf178.setBounds(800,395,150,30);
- rp29.add(tf178);
- rp29.add(r203);
- JLabel r204 = new JLabel ("ARRIVAL OFFICER:");
- r204.setBounds(972,350,250,50);
- r204.setFont(new Font("Times new Roman",Font.BOLD,20));
- r204.setForeground(Color.WHITE);
- JTextField tf179 = new JTextField ();
- tf179.setBounds(970,395,335,30);
- rp29.add(tf179);
- rp29.add(r204);
- rp29.setLayout(null);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f18.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f18.setVisible(false);
- f8.setVisible(true);
- }
- });
- //update
- JButton update = new JButton("Update");
- update.setBounds(820,600,150,75);
- update.setFont(new Font("Times New Roman",Font.BOLD,20));
- update.setBackground(Color.LIGHT_GRAY);
- update.setForeground(Color.BLACK);
- f18.add(update);
- //Save
- JButton Save = new JButton("Save");
- Save.setBounds(1000,600,150,75);
- Save.setFont(new Font("Times New Roman",Font.BOLD,20));
- Save.setBackground(Color.LIGHT_GRAY);
- Save.setForeground(Color.BLACK);
- f18.add(Save);
- u4.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u4.doClick();
- }
- }
- });
- u4.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f18.setVisible(true);
- f8.setVisible(false);
- }
- });
- //UPDATE FUNCTION
- update.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_U){
- update.doClick();
- }
- }
- });
- update.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- f2, "Would you like to UPDATE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f18.setVisible(false);
- f8.setVisible(true);
- JOptionPane.showMessageDialog(f8,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //ADD FUNCTION
- Save.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_S){
- Save.doClick();
- }
- }
- });
- Save.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to ADD This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f18.setVisible(false);
- f8.setVisible(true);
- JOptionPane.showMessageDialog(f8,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //DELETE FUNCTION
- d4.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_D){
- d4.doClick();
- }
- }
- });
- d4.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to DELETE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- JOptionPane.showMessageDialog(f8,"Delected Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- }
- });
- }
- });
- //B5
- r5.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_5){
- r5.doClick();
- }
- }
- });
- r5.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f9 = new JFrame();
- f9.setVisible(true);
- f4.setVisible(false);
- f9.setSize(1366,768);
- f9.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f9.setIconImage(icon.getImage());
- f9.add(c5);
- c5.setBounds(0,650,200,50);
- JLabel rl5 = new JLabel("Cell Five");
- rl5.setBounds(485,30,450,70);
- rl5.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl5.setForeground(Color.WHITE);
- f9.add(rl5);
- JButton a5 = new JButton("Add");
- a5.setBounds(1180,135,150,75);
- a5.setFont(new Font("Times New Roman",Font.BOLD,20));
- a5.setBackground(Color.LIGHT_GRAY);
- a5.setForeground(Color.BLACK);
- f9.add(a5);
- JButton d5 = new JButton("Delete");
- d5.setBounds(1000,135,150,75);
- d5.setFont(new Font("Times New Roman",Font.BOLD,20));
- d5.setBackground(Color.LIGHT_GRAY);
- d5.setForeground(Color.BLACK);
- f9.add(d5);
- JButton u5 = new JButton("Edit");
- u5.setBounds(820,135,150,75);
- u5.setFont(new Font("Times New Roman",Font.BOLD,20));
- u5.setBackground(Color.LIGHT_GRAY);
- u5.setForeground(Color.BLACK);
- f9.add(u5);
- JPanel rp5 = new JPanel();
- f9.add(rp5);
- rp5.setBounds(0,0,1366,120);
- rp5.setBackground(Color.BLACK);
- rp5.setBorder(BorderFactory.createEtchedBorder(1));
- JTable table = new JTable();
- Object[] columns ={"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.BLACK);
- Font font =(new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f9.add(pane);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f9.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f9.setVisible(false);
- f4.setVisible(true);
- }
- });
- //ADD-5
- a5.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_A){
- a5.doClick();
- }
- }
- });
- a5.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f19 = new JFrame();
- f19.setVisible(true);
- f9.setVisible(false);
- f19.setSize(1366,768);
- f19.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f19.setIconImage(icon.getImage());
- f19.add(c5);
- c5.setBounds(0,650,200,50);
- JPanel rp20 = new JPanel();
- rp20.setBounds(0,0,1366,120);
- rp20.setBackground(Color.BLACK);
- rp20.setBorder(BorderFactory.createEtchedBorder(1));
- f19.add(rp20);
- JLabel r900 = new JLabel("Prisoner Fill Up Form");
- r900.setBounds(485,30,450,70);
- r900.setFont(new Font("Times new Roman",Font.BOLD,80));
- r900.setForeground(Color.WHITE);
- rp20.add(r900);
- JPanel rp30 = new JPanel();
- rp30.setBounds(12,130,1325,450);
- rp30.setBackground(Color.BLACK);
- rp30.setBorder(BorderFactory.createEtchedBorder());
- f19.add(rp30);
- JLabel r142 = new JLabel();
- r142.setBounds(15,15,130,130);
- r142.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
- rp30.add(r142);
- //Prisoner aydi:
- JLabel r205 = new JLabel ("FIRSTNAME:");
- r205.setBounds(183,40,200,50);
- r205.setFont(new Font("Times new Roman",Font.BOLD,20));
- r205.setForeground(Color.WHITE);
- JTextField tf180 = new JTextField ();
- tf180.setBounds(180,85,210,30);
- rp30.add(tf180);
- rp30.add(r205);
- JLabel r206 = new JLabel ("MI:");
- r206.setBounds(413,40,200,50);
- r206.setFont(new Font("Times new Roman",Font.BOLD,20));
- r206.setForeground(Color.WHITE);
- JTextField tf181 = new JTextField ();
- tf181.setBounds(410,85,80,30);
- rp30.add(tf181);
- rp30.add(r206);
- JLabel r207 = new JLabel ("LASTNAME:");
- r207.setBounds(518,40,200,50);
- r207.setFont(new Font("Times new Roman",Font.BOLD,20));
- r207.setForeground(Color.WHITE);
- JTextField tf182 = new JTextField ();
- tf182.setBounds(515,85,210,30);
- rp30.add(tf182);
- rp30.add(r207);
- JLabel r208 = new JLabel ("SEX:");
- r208.setBounds(751,40,200,50);
- r208.setFont(new Font("Times new Roman",Font.BOLD,20));
- r208.setForeground(Color.WHITE);
- JTextField tf183 = new JTextField ();
- tf183.setBounds(750,85,90,30);
- rp30.add(tf183);
- rp30.add(r208);
- JLabel r209 = new JLabel ("AGE:");
- r209.setBounds(861,40,200,50);
- r209.setFont(new Font("Times new Roman",Font.BOLD,20));
- r209.setForeground(Color.WHITE);
- JTextField tf184 = new JTextField ();
- tf184.setBounds(860,85,60,30);
- rp30.add(tf184);
- rp30.add(r209);
- JLabel r210 = new JLabel ("ADDRESS:");
- r210.setBounds(951,40,200,50);
- r210.setFont(new Font("Times new Roman",Font.BOLD,20));
- r210.setForeground(Color.WHITE);
- JTextField tf185 = new JTextField ();
- tf185.setBounds(950,85,355,30);
- rp30.add(tf185);
- rp30.add(r210);
- JLabel r211 = new JLabel ("DATE OF BIRTH:");
- r211.setBounds(17,150,200,50);
- r211.setFont(new Font("Times new Roman",Font.BOLD,20));
- r211.setForeground(Color.WHITE);
- JTextField tf186 = new JTextField ();
- tf186.setBounds(15,195,210,30);
- rp30.add(tf186);
- rp30.add(r211);
- JLabel r212 = new JLabel ("NATIONALITY:");
- r212.setBounds(247,150,200,50);
- r212.setFont(new Font("Times new Roman",Font.BOLD,20));
- r212.setForeground(Color.WHITE);
- JTextField tf187 = new JTextField ();
- tf187.setBounds(245,195,210,30);
- rp30.add(tf187);
- rp30.add(r212);
- JLabel r213 = new JLabel ("HEIGHT:");
- r213.setBounds(482,150,200,50);
- r213.setFont(new Font("Times new Roman",Font.BOLD,20));
- r213.setForeground(Color.WHITE);
- JTextField tf188 = new JTextField ();
- tf188.setBounds(480,195,120,30);
- rp30.add(tf188);
- rp30.add(r213);
- JLabel r214 = new JLabel ("WEIGHT:");
- r214.setBounds(636,150,200,50);
- r214.setFont(new Font("Times new Roman",Font.BOLD,20));
- r214.setForeground(Color.WHITE);
- JTextField tf189 = new JTextField ();
- tf189.setBounds(630,195,120,30);
- rp30.add(tf189);
- rp30.add(r214);
- JLabel r215 = new JLabel ("EYE COLOR:");
- r215.setBounds(787,150,200,50);
- r215.setFont(new Font("Times new Roman",Font.BOLD,20));
- r215.setForeground(Color.WHITE);
- JTextField tf190 = new JTextField ();
- tf190.setBounds(785 ,195,190,30);
- rp30.add(tf190);
- rp30.add(r215);
- JLabel r216 = new JLabel ("PHONE NUMBER:");
- r216.setBounds(997,150,200,50);
- r216.setFont(new Font("Times new Roman",Font.BOLD,20));
- r216.setForeground(Color.WHITE);
- JTextField tf191 = new JTextField ();
- tf191.setBounds(995,195,310,30);
- rp30.add(tf191);
- rp30.add(r216);
- JLabel r217 = new JLabel ("LANGUAGE:");
- r217.setBounds(16,250,200,50);
- r217.setFont(new Font("Times new Roman",Font.BOLD,20));
- r217.setForeground(Color.WHITE);
- JTextField tf192 = new JTextField ();
- tf192.setBounds(15,295,210,30);
- rp30.add(tf192);
- rp30.add(r217);
- JLabel r218 = new JLabel ("DATE OF CAPTURE:");
- r218.setBounds(247,250,200,50);
- r218.setFont(new Font("Times new Roman",Font.BOLD,20));
- r218.setForeground(Color.WHITE);
- JTextField tf193 = new JTextField ();
- tf193.setBounds(245,295,210,30);
- rp30.add(tf193);
- rp30.add(r218);
- JLabel r219 = new JLabel ("PLACE OF CAPTURE:");
- r219.setBounds(482,250,220,50);
- r219.setFont(new Font("Times new Roman",Font.BOLD,20));
- r219.setForeground(Color.WHITE);
- JTextField tf194 = new JTextField ();
- tf194.setBounds(480,295,320,30);
- rp30.add(tf194);
- rp30.add(r219);
- JLabel r220 = new JLabel ("CIVILLIAN OCCUPATION:");
- r220.setBounds(827,250,270,50);
- r220.setFont(new Font("Times new Roman",Font.BOLD,20));
- r220.setForeground(Color.WHITE);
- JTextField tf195 = new JTextField ();
- tf195.setBounds(825,295,480,30);
- rp30.add(tf195);
- rp30.add(r220);
- JLabel r221 = new JLabel ("PHYSICAL CONDITION:");
- r221.setBounds(16,350,260,50);
- r221.setFont(new Font("Times new Roman",Font.BOLD,20));
- r221.setForeground(Color.WHITE);
- JTextField tf196 = new JTextField ();
- tf196.setBounds(15,395,260,30);
- rp30.add(tf196);
- rp30.add(r221);
- JLabel r222 = new JLabel ("DAYS IN JAIL:");
- r222.setBounds(302,350,250,50);
- r222.setFont(new Font("Times new Roman",Font.BOLD,20));
- r222.setForeground(Color.WHITE);
- JTextField tf197 = new JTextField ();
- tf197.setBounds(300,395,180,30);
- rp30.add(tf197);
- rp30.add(r222);
- JLabel r223 = new JLabel ("ARRIVAL OF PRISONER:");
- r223.setBounds(502,350,280,50);
- r223.setFont(new Font("Times new Roman",Font.BOLD,20));
- r223.setForeground(Color.WHITE);
- JTextField tf198 = new JTextField ();
- tf198.setBounds(500,395,280,30);
- rp30.add(tf198);
- rp30.add(r223);
- JLabel r224 = new JLabel ("DATE/TIME:");
- r224.setBounds(802,350,250,50);
- r224.setFont(new Font("Times new Roman",Font.BOLD,20));
- r224.setForeground(Color.WHITE);
- JTextField tf199 = new JTextField ();
- tf199.setBounds(800,395,150,30);
- rp30.add(tf199);
- rp30.add(r224);
- JLabel r225 = new JLabel ("ARRIVAL OFFICER:");
- r225.setBounds(972,350,250,50);
- r225.setFont(new Font("Times new Roman",Font.BOLD,20));
- r225.setForeground(Color.WHITE);
- JTextField tf200 = new JTextField ();
- tf200.setBounds(970,395,335,30);
- rp30.add(tf200);
- rp30.add(r225);
- rp30.setLayout(null);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f19.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f19.setVisible(false);
- f9.setVisible(true);
- }
- });
- //update
- JButton update = new JButton("Update");
- update.setBounds(820,600,150,75);
- update.setFont(new Font("Times New Roman",Font.BOLD,20));
- update.setBackground(Color.LIGHT_GRAY);
- update.setForeground(Color.BLACK);
- f19.add(update);
- //Save
- JButton Save = new JButton("Save");
- Save.setBounds(1000,600,150,75);
- Save.setFont(new Font("Times New Roman",Font.BOLD,20));
- Save.setBackground(Color.LIGHT_GRAY);
- Save.setForeground(Color.BLACK);
- f19.add(Save);
- u5.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u5.doClick();
- }
- }
- });
- u5.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f19.setVisible(true);
- f9.setVisible(false);
- }
- });
- //UPDATE FUNCTION
- update.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_U){
- update.doClick();
- }
- }
- });
- update.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- f2, "Would you like to UPDATE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f19.setVisible(false);
- f9.setVisible(true);
- JOptionPane.showMessageDialog(f9,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //ADD FUNCTION
- Save.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_S){
- Save.doClick();
- }
- }
- });
- Save.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to ADD This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f19.setVisible(false);
- f9.setVisible(true);
- JOptionPane.showMessageDialog(f9,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //DELETE FUNCTION
- d5.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_D){
- d5.doClick();
- }
- }
- });
- d5.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to DELETE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- JOptionPane.showMessageDialog(f9,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- }
- });
- }
- });
- //B6
- r6.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_6){
- r6.doClick();
- }
- }
- });
- r6.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f10 = new JFrame();
- f10.setVisible(true);
- f4.setVisible(false);
- f10.setSize(1366,768);
- f10.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f10.setIconImage(icon.getImage());
- f10.add(c5);
- c5.setBounds(0,650,200,50);
- JLabel rl6 = new JLabel("Cell Six");
- rl6.setBounds(485,30,450,70);
- rl6.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl6.setForeground(Color.WHITE);
- f10.add(rl6);
- JButton a6 = new JButton("Add");
- a6.setBounds(1180,135,150,75);
- a6.setFont(new Font("Times New Roman",Font.BOLD,20));
- a6.setBackground(Color.LIGHT_GRAY);
- a6.setForeground(Color.BLACK);
- f10.add(a6);
- JButton d6 = new JButton("Delete");
- d6.setBounds(1000,135,150,75);
- d6.setFont(new Font("Times New Roman",Font.BOLD,20));
- d6.setBackground(Color.LIGHT_GRAY);
- d6.setForeground(Color.BLACK);
- f10.add(d6);
- JButton u6 = new JButton("Edit");
- u6.setBounds(820,135,150,75);
- u6.setFont(new Font("Times New Roman",Font.BOLD,20));
- u6.setBackground(Color.LIGHT_GRAY);
- u6.setForeground(Color.BLACK);
- f10.add(u6);
- JPanel rp6 = new JPanel();
- f10.add(rp6);
- rp6.setBounds(0,0,1366,120);
- rp6.setBackground(Color.BLACK);
- rp6.setBorder(BorderFactory.createEtchedBorder(1));
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.BLACK);
- Font font = (new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f10.add(pane);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f10.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f10.setVisible(false);
- f4.setVisible(true);
- }
- });
- //ADD-6
- a6.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_A){
- a6.doClick();
- }
- }
- });
- a6.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f20 = new JFrame();
- f20.setVisible(true);
- f10.setVisible(false);
- f20.setSize(1366,768);
- f20.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f20.setIconImage(icon.getImage());
- f20.add(c5);
- c5.setBounds(0,650,200,50);
- JPanel rp21 = new JPanel();
- rp21.setBounds(0,0,1366,120);
- rp21.setBackground(Color.BLACK);
- rp21.setBorder(BorderFactory.createEtchedBorder(1));
- f20.add(rp21);
- JLabel r20 = new JLabel("Prisoner Fill Up Form");
- r20.setBounds(485,30,450,70);
- r20.setFont(new Font("Times new Roman",Font.BOLD,80));
- r20.setForeground(Color.WHITE);
- rp21.add(r20);
- JPanel rp31 = new JPanel();
- rp31.setBounds(12,130,1325,450);
- rp31.setBackground(Color.BLACK);
- rp31.setBorder(BorderFactory.createEtchedBorder());
- f20.add(rp31);
- JLabel r143 = new JLabel();
- r143.setBounds(15,15,130,130);
- r143.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
- rp31.add(r143);
- //Prisoner aydi:
- JLabel r226 = new JLabel ("FIRSTNAME:");
- r226.setBounds(183,40,200,50);
- r226.setFont(new Font("Times new Roman",Font.BOLD,20));
- r226.setForeground(Color.WHITE);
- JTextField tf201 = new JTextField ();
- tf201.setBounds(180,85,210,30);
- rp31.add(tf201);
- rp31.add(r226);
- JLabel r227 = new JLabel ("MI:");
- r227.setBounds(413,40,200,50);
- r227.setFont(new Font("Times new Roman",Font.BOLD,20));
- r227.setForeground(Color.WHITE);
- JTextField tf202 = new JTextField ();
- tf202.setBounds(410,85,80,30);
- rp31.add(tf202);
- rp31.add(r227);
- JLabel r228 = new JLabel ("LASTNAME:");
- r228.setBounds(518,40,200,50);
- r228.setFont(new Font("Times new Roman",Font.BOLD,20));
- r228.setForeground(Color.WHITE);
- JTextField tf203 = new JTextField ();
- tf203.setBounds(515,85,210,30);
- rp31.add(tf203);
- rp31.add(r228);
- JLabel r229 = new JLabel ("SEX:");
- r229.setBounds(751,40,200,50);
- r229.setFont(new Font("Times new Roman",Font.BOLD,20));
- r229.setForeground(Color.WHITE);
- JTextField tf204 = new JTextField ();
- tf204.setBounds(750,85,90,30);
- rp31.add(tf204);
- rp31.add(r229);
- JLabel r230 = new JLabel ("AGE:");
- r230.setBounds(861,40,200,50);
- r230.setFont(new Font("Times new Roman",Font.BOLD,20));
- r230.setForeground(Color.WHITE);
- JTextField tf205 = new JTextField ();
- tf205.setBounds(860,85,60,30);
- rp31.add(tf205);
- rp31.add(r230);
- JLabel r231 = new JLabel ("ADDRESS:");
- r231.setBounds(951,40,200,50);
- r231.setFont(new Font("Times new Roman",Font.BOLD,20));
- r231.setForeground(Color.WHITE);
- JTextField tf206 = new JTextField ();
- tf206.setBounds(950,85,355,30);
- rp31.add(tf206);
- rp31.add(r231);
- JLabel r232 = new JLabel ("DATE OF BIRTH:");
- r232.setBounds(17,150,200,50);
- r232.setFont(new Font("Times new Roman",Font.BOLD,20));
- r232.setForeground(Color.WHITE);
- JTextField tf207 = new JTextField ();
- tf207.setBounds(15,195,210,30);
- rp31.add(tf207);
- rp31.add(r232);
- JLabel r233 = new JLabel ("NATIONALITY:");
- r233.setBounds(247,150,200,50);
- r233.setFont(new Font("Times new Roman",Font.BOLD,20));
- r233.setForeground(Color.WHITE);
- JTextField tf208 = new JTextField ();
- tf208.setBounds(245,195,210,30);
- rp31.add(tf208);
- rp31.add(r233);
- JLabel r234 = new JLabel ("HEIGHT:");
- r234.setBounds(482,150,200,50);
- r234.setFont(new Font("Times new Roman",Font.BOLD,20));
- r234.setForeground(Color.WHITE);
- JTextField tf209 = new JTextField ();
- tf209.setBounds(480,195,120,30);
- rp31.add(tf209);
- rp31.add(r234);
- JLabel r235 = new JLabel ("WEIGHT:");
- r235.setBounds(636,150,200,50);
- r235.setFont(new Font("Times new Roman",Font.BOLD,20));
- r235.setForeground(Color.WHITE);
- JTextField tf210 = new JTextField ();
- tf210.setBounds(630,195,120,30);
- rp31.add(tf210);
- rp31.add(r235);
- JLabel r236 = new JLabel ("EYE COLOR:");
- r236.setBounds(787,150,200,50);
- r236.setFont(new Font("Times new Roman",Font.BOLD,20));
- r236.setForeground(Color.WHITE);
- JTextField tf211 = new JTextField ();
- tf211.setBounds(785 ,195,190,30);
- rp31.add(tf211);
- rp31.add(r236);
- JLabel r237 = new JLabel ("PHONE NUMBER:");
- r237.setBounds(997,150,200,50);
- r237.setFont(new Font("Times new Roman",Font.BOLD,20));
- r237.setForeground(Color.WHITE);
- JTextField tf212 = new JTextField ();
- tf212.setBounds(995,195,310,30);
- rp31.add(tf212);
- rp31.add(r237);
- JLabel r238 = new JLabel ("LANGUAGE:");
- r238.setBounds(16,250,200,50);
- r238.setFont(new Font("Times new Roman",Font.BOLD,20));
- r238.setForeground(Color.WHITE);
- JTextField tf213 = new JTextField ();
- tf213.setBounds(15,295,210,30);
- rp31.add(tf213);
- rp31.add(r238);
- JLabel r239 = new JLabel ("DATE OF CAPTURE:");
- r239.setBounds(247,250,200,50);
- r239.setFont(new Font("Times new Roman",Font.BOLD,20));
- r239.setForeground(Color.WHITE);
- JTextField tf214 = new JTextField ();
- tf214.setBounds(245,295,210,30);
- rp31.add(tf214);
- rp31.add(r239);
- JLabel r240 = new JLabel ("PLACE OF CAPTURE:");
- r240.setBounds(482,250,220,50);
- r240.setFont(new Font("Times new Roman",Font.BOLD,20));
- r240.setForeground(Color.WHITE);
- JTextField tf215 = new JTextField ();
- tf215.setBounds(480,295,320,30);
- rp31.add(tf215);
- rp31.add(r240);
- JLabel r241 = new JLabel ("CIVILLIAN OCCUPATION:");
- r241.setBounds(827,250,270,50);
- r241.setFont(new Font("Times new Roman",Font.BOLD,20));
- r241.setForeground(Color.WHITE);
- JTextField tf216 = new JTextField ();
- tf216.setBounds(825,295,480,30);
- rp31.add(tf216);
- rp31.add(r241);
- JLabel r242 = new JLabel ("PHYSICAL CONDITION:");
- r242.setBounds(16,350,260,50);
- r242.setFont(new Font("Times new Roman",Font.BOLD,20));
- r242.setForeground(Color.WHITE);
- JTextField tf217 = new JTextField ();
- tf217.setBounds(15,395,260,30);
- rp31.add(tf217);
- rp31.add(r242);
- JLabel r243 = new JLabel ("DAYS IN JAIL:");
- r243.setBounds(302,350,250,50);
- r243.setFont(new Font("Times new Roman",Font.BOLD,20));
- r243.setForeground(Color.WHITE);
- JTextField tf218 = new JTextField ();
- tf218.setBounds(300,395,180,30);
- rp31.add(tf218);
- rp31.add(r243);
- JLabel r244 = new JLabel ("ARRIVAL OF PRISONER:");
- r244.setBounds(502,350,280,50);
- r244.setFont(new Font("Times new Roman",Font.BOLD,20));
- r244.setForeground(Color.WHITE);
- JTextField tf219 = new JTextField ();
- tf219.setBounds(500,395,280,30);
- rp31.add(tf219);
- rp31.add(r244);
- JLabel r245 = new JLabel ("DATE/TIME:");
- r245.setBounds(802,350,250,50);
- r245.setFont(new Font("Times new Roman",Font.BOLD,20));
- r245.setForeground(Color.WHITE);
- JTextField tf220 = new JTextField ();
- tf220.setBounds(800,395,150,30);
- rp31.add(tf220);
- rp31.add(r245);
- JLabel r246 = new JLabel ("ARRIVAL OFFICER:");
- r246.setBounds(972,350,250,50);
- r246.setFont(new Font("Times new Roman",Font.BOLD,20));
- r246.setForeground(Color.WHITE);
- JTextField tf221 = new JTextField ();
- tf221.setBounds(970,395,335,30);
- rp31.add(tf221);
- rp31.add(r246);
- rp31.setLayout(null);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f20.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f20.setVisible(false);
- f10.setVisible(true);
- }
- });
- //update
- JButton update = new JButton("Update");
- update.setBounds(820,600,150,75);
- update.setFont(new Font("Times New Roman",Font.BOLD,20));
- update.setBackground(Color.LIGHT_GRAY);
- update.setForeground(Color.BLACK);
- f20.add(update);
- //Save
- JButton Save = new JButton("Save");
- Save.setBounds(1000,600,150,75);
- Save.setFont(new Font("Times New Roman",Font.BOLD,20));
- Save.setBackground(Color.LIGHT_GRAY);
- Save.setForeground(Color.BLACK);
- f20.add(Save);
- u6.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u6.doClick();
- }
- }
- });
- u6.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f20.setVisible(true);
- f10.setVisible(false);
- }
- });
- //UPDATE FUNCTION
- update.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_U){
- update.doClick();
- }
- }
- });
- update.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- f2, "Would you like to UPDATE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f20.setVisible(false);
- f10.setVisible(true);
- JOptionPane.showMessageDialog(f10,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //ADD FUNCTION
- Save.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_S){
- Save.doClick();
- }
- }
- });
- Save.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to ADD This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f20.setVisible(false);
- f10.setVisible(true);
- JOptionPane.showMessageDialog(f10,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //DELETE FUNCTION
- d6.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_D){
- d6.doClick();
- }
- }
- });
- d6.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to DELETE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- JOptionPane.showMessageDialog(f10,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- }
- });
- }
- });
- //B7
- r7.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_7){
- r7.doClick();
- }
- }
- });
- r7.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f11 = new JFrame();
- f11.setVisible(true);
- f4.setVisible(false);
- f11.setSize(1366,768);
- f11.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f11.setIconImage(icon.getImage());
- f11.add(c5);
- c5.setBounds(0,650,200,50);
- JLabel rl7 = new JLabel("Cell Seven");
- rl7.setBounds(485,30,450,70);
- rl7.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl7.setForeground(Color.WHITE);
- f11.add(rl7);
- JButton a7 = new JButton("Add");
- a7.setBounds(1180,135,150,75);
- a7.setFont(new Font("Times New Roman",Font.BOLD,20));
- a7.setBackground(Color.LIGHT_GRAY);
- a7.setForeground(Color.BLACK);
- f11.add(a7);
- JButton d7 = new JButton("Delete");
- d7.setBounds(1000,135,150,75);
- d7.setFont(new Font("Times New Roman",Font.BOLD,20));
- d7.setBackground(Color.LIGHT_GRAY);
- d7.setForeground(Color.BLACK);
- f11.add(d7);
- JButton u7 = new JButton("Edit");
- u7.setBounds(820,135,150,75);
- u7.setFont(new Font("Times New Roman",Font.BOLD,20));
- u7.setBackground(Color.LIGHT_GRAY);
- u7.setForeground(Color.BLACK);
- f11.add(u7);
- JPanel rp7 = new JPanel();
- f11.add(rp7);
- rp7.setBounds(0,0,1366,120);
- rp7.setBackground(Color.BLACK);
- rp7.setBorder(BorderFactory.createEtchedBorder(1));
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.BLACK);
- Font font = (new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f11.add(pane);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f11.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f11.setVisible(false);
- f4.setVisible(true);
- }
- });
- //ADD-7
- a7.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_A){
- a7.doClick();
- }
- }
- });
- a7.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f21 = new JFrame();
- f21.setVisible(true);
- f11.setVisible(false);
- f21.setSize(1366,768);
- f21.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f21.setIconImage(icon.getImage());
- f21.add(c5);
- c5.setBounds(0,650,200,50);
- JPanel rp22 = new JPanel();
- rp22.setBounds(0,0,1366,120);
- rp22.setBackground(Color.BLACK);
- rp22.setBorder(BorderFactory.createEtchedBorder(1));
- f21.add(rp22);
- JLabel r21 = new JLabel("Prisoner Fill Up Form");
- r21.setBounds(485,30,450,70);
- r21.setFont(new Font("Times new Roman",Font.BOLD,80));
- r21.setForeground(Color.WHITE);
- rp22.add(r21);
- JPanel rp32 = new JPanel();
- rp32.setBounds(12,130,1325,450);
- rp32.setBackground(Color.BLACK);
- rp32.setBorder(BorderFactory.createEtchedBorder());
- f21.add(rp32);
- JLabel r144 = new JLabel();
- r144.setBounds(15,15,130,130);
- r144.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
- rp32.add(r144);
- //Prisoner aydi:
- JLabel r247 = new JLabel ("FIRSTNAME:");
- r247.setBounds(183,40,200,50);
- r247.setFont(new Font("Times new Roman",Font.BOLD,20));
- r247.setForeground(Color.WHITE);
- JTextField tf222 = new JTextField ();
- tf222.setBounds(180,85,210,30);
- rp32.add(tf222);
- rp32.add(r247);
- JLabel r248 = new JLabel ("MI:");
- r248.setBounds(413,40,200,50);
- r248.setFont(new Font("Times new Roman",Font.BOLD,20));
- r248.setForeground(Color.WHITE);
- JTextField tf223 = new JTextField ();
- tf223.setBounds(410,85,80,30);
- rp32.add(tf223);
- rp32.add(r248);
- JLabel r249 = new JLabel ("LASTNAME:");
- r249.setBounds(518,40,200,50);
- r249.setFont(new Font("Times new Roman",Font.BOLD,20));
- r249.setForeground(Color.WHITE);
- JTextField tf224 = new JTextField ();
- tf224.setBounds(515,85,210,30);
- rp32.add(tf224);
- rp32.add(r249);
- JLabel r250 = new JLabel ("SEX:");
- r250.setBounds(751,40,200,50);
- r250.setFont(new Font("Times new Roman",Font.BOLD,20));
- r250.setForeground(Color.WHITE);
- JTextField tf225 = new JTextField ();
- tf225.setBounds(750,85,90,30);
- rp32.add(tf225);
- rp32.add(r250);
- JLabel r251 = new JLabel ("AGE:");
- r251.setBounds(861,40,200,50);
- r251.setFont(new Font("Times new Roman",Font.BOLD,20));
- r251.setForeground(Color.WHITE);
- JTextField tf226 = new JTextField ();
- tf226.setBounds(860,85,60,30);
- rp32.add(tf226);
- rp32.add(r251);
- JLabel r252 = new JLabel ("ADDRESS:");
- r252.setBounds(951,40,200,50);
- r252.setFont(new Font("Times new Roman",Font.BOLD,20));
- r252.setForeground(Color.WHITE);
- JTextField tf227 = new JTextField ();
- tf227.setBounds(950,85,355,30);
- rp32.add(tf227);
- rp32.add(r252);
- JLabel r253 = new JLabel ("DATE OF BIRTH:");
- r253.setBounds(17,150,200,50);
- r253.setFont(new Font("Times new Roman",Font.BOLD,20));
- r253.setForeground(Color.WHITE);
- JTextField tf228 = new JTextField ();
- tf228.setBounds(15,195,210,30);
- rp32.add(tf228);
- rp32.add(r253);
- JLabel r254 = new JLabel ("NATIONALITY:");
- r254.setBounds(247,150,200,50);
- r254.setFont(new Font("Times new Roman",Font.BOLD,20));
- r254.setForeground(Color.WHITE);
- JTextField tf229 = new JTextField ();
- tf229.setBounds(245,195,210,30);
- rp32.add(tf229);
- rp32.add(r254);
- JLabel r255 = new JLabel ("HEIGHT:");
- r255.setBounds(482,150,200,50);
- r255.setFont(new Font("Times new Roman",Font.BOLD,20));
- r255.setForeground(Color.WHITE);
- JTextField tf230 = new JTextField ();
- tf230.setBounds(480,195,120,30);
- rp32.add(tf230);
- rp32.add(r255);
- JLabel r256 = new JLabel ("WEIGHT:");
- r256.setBounds(636,150,200,50);
- r256.setFont(new Font("Times new Roman",Font.BOLD,20));
- r256.setForeground(Color.WHITE);
- JTextField tf231 = new JTextField ();
- tf231.setBounds(630,195,120,30);
- rp32.add(tf231);
- rp32.add(r256);
- JLabel r257 = new JLabel ("EYE COLOR:");
- r257.setBounds(787,150,200,50);
- r257.setFont(new Font("Times new Roman",Font.BOLD,20));
- r257.setForeground(Color.WHITE);
- JTextField tf232 = new JTextField ();
- tf232.setBounds(785 ,195,190,30);
- rp32.add(tf232);
- rp32.add(r257);
- JLabel r258 = new JLabel ("PHONE NUMBER:");
- r258.setBounds(997,150,200,50);
- r258.setFont(new Font("Times new Roman",Font.BOLD,20));
- r258.setForeground(Color.WHITE);
- JTextField tf233 = new JTextField ();
- tf233.setBounds(995,195,310,30);
- rp32.add(tf233);
- rp32.add(r258);
- JLabel r259 = new JLabel ("LANGUAGE:");
- r259.setBounds(16,250,200,50);
- r259.setFont(new Font("Times new Roman",Font.BOLD,20));
- r259.setForeground(Color.WHITE);
- JTextField tf234 = new JTextField ();
- tf234.setBounds(15,295,210,30);
- rp32.add(tf234);
- rp32.add(r259);
- JLabel r260 = new JLabel ("DATE OF CAPTURE:");
- r260.setBounds(247,250,200,50);
- r260.setFont(new Font("Times new Roman",Font.BOLD,20));
- r260.setForeground(Color.WHITE);
- JTextField tf235 = new JTextField ();
- tf235.setBounds(245,295,210,30);
- rp32.add(tf235);
- rp32.add(r260);
- JLabel r261 = new JLabel ("PLACE OF CAPTURE:");
- r261.setBounds(482,250,220,50);
- r261.setFont(new Font("Times new Roman",Font.BOLD,20));
- r261.setForeground(Color.WHITE);
- JTextField tf236 = new JTextField ();
- tf236.setBounds(480,295,320,30);
- rp32.add(tf236);
- rp32.add(r261);
- JLabel r262 = new JLabel ("CIVILLIAN OCCUPATION:");
- r262.setBounds(827,250,270,50);
- r262.setFont(new Font("Times new Roman",Font.BOLD,20));
- r262.setForeground(Color.WHITE);
- JTextField tf237 = new JTextField ();
- tf237.setBounds(825,295,480,30);
- rp32.add(tf237);
- rp32.add(r262);
- JLabel r263 = new JLabel ("PHYSICAL CONDITION:");
- r263.setBounds(16,350,260,50);
- r263.setFont(new Font("Times new Roman",Font.BOLD,20));
- r263.setForeground(Color.WHITE);
- JTextField tf238 = new JTextField ();
- tf238.setBounds(15,395,260,30);
- rp32.add(tf238);
- rp32.add(r263);
- JLabel r264 = new JLabel ("DAYS IN JAIL:");
- r264.setBounds(302,350,250,50);
- r264.setFont(new Font("Times new Roman",Font.BOLD,20));
- r264.setForeground(Color.WHITE);
- JTextField tf239 = new JTextField ();
- tf239.setBounds(300,395,180,30);
- rp32.add(tf239);
- rp32.add(r264);
- JLabel r265 = new JLabel ("ARRIVAL OF PRISONER:");
- r265.setBounds(502,350,280,50);
- r265.setFont(new Font("Times new Roman",Font.BOLD,20));
- r265.setForeground(Color.WHITE);
- JTextField tf240 = new JTextField ();
- tf240.setBounds(500,395,280,30);
- rp32.add(tf240);
- rp32.add(r265);
- JLabel r266 = new JLabel ("DATE/TIME:");
- r266.setBounds(802,350,250,50);
- r266.setFont(new Font("Times new Roman",Font.BOLD,20));
- r266.setForeground(Color.WHITE);
- JTextField tf241 = new JTextField ();
- tf241.setBounds(800,395,150,30);
- rp32.add(tf241);
- rp32.add(r266);
- JLabel r267 = new JLabel ("ARRIVAL OFFICER:");
- r267.setBounds(972,350,250,50);
- r267.setFont(new Font("Times new Roman",Font.BOLD,20));
- r267.setForeground(Color.WHITE);
- JTextField tf242 = new JTextField ();
- tf242.setBounds(970,395,335,30);
- rp32.add(tf242);
- rp32.add(r267);
- rp32.setLayout(null);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f21.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f21.setVisible(false);
- f11.setVisible(true);
- }
- });
- //update
- JButton update = new JButton("Update");
- update.setBounds(820,600,150,75);
- update.setFont(new Font("Times New Roman",Font.BOLD,20));
- update.setBackground(Color.LIGHT_GRAY);
- update.setForeground(Color.BLACK);
- f21.add(update);
- //Save
- JButton Save = new JButton("Save");
- Save.setBounds(1000,600,150,75);
- Save.setFont(new Font("Times New Roman",Font.BOLD,20));
- Save.setBackground(Color.LIGHT_GRAY);
- Save.setForeground(Color.BLACK);
- f21.add(Save);
- u7.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u7.doClick();
- }
- }
- });
- u7.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f21.setVisible(true);
- f11.setVisible(false);
- }
- });
- //UPDATE FUNCTION
- update.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_U){
- update.doClick();
- }
- }
- });
- update.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to UPDATE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- JOptionPane.showMessageDialog(f11,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //ADD FUNCTION
- Save.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_S){
- Save.doClick();
- }
- }
- });
- Save.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to ADD This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f21.setVisible(false);
- f11.setVisible(true);
- JOptionPane.showMessageDialog(f11,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //DELETE FUNCTION
- d7.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_D){
- d7.doClick();
- }
- }
- });
- d7.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to DELETE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- JOptionPane.showMessageDialog(f11,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- }
- });
- }
- });
- //B8
- r8.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_8){
- r8.doClick();
- }
- }
- });
- r8.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f12 = new JFrame();
- f12.setVisible(true);
- f4.setVisible(false);
- f12.setSize(1366,768);
- f12.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f12.setIconImage(icon.getImage());
- f12.add(c5);
- c5.setBounds(0,650,200,50);
- JLabel rl8 = new JLabel("Cell Eight");
- rl8.setBounds(485,30,450,70);
- rl8.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl8.setForeground(Color.WHITE);
- f12.add(rl8);
- JButton a8 = new JButton("Add");
- a8.setBounds(1180,135,150,75);
- a8.setFont(new Font("Times New Roman",Font.BOLD,20));
- a8.setBackground(Color.LIGHT_GRAY);
- a8.setForeground(Color.BLACK);
- f12.add(a8);
- JButton d8 = new JButton("Delete");
- d8.setBounds(1000,135,150,75);
- d8.setFont(new Font("Times New Roman",Font.BOLD,20));
- d8.setBackground(Color.LIGHT_GRAY);
- d8.setForeground(Color.BLACK);
- f12.add(d8);
- JButton u8 = new JButton("Edit");
- u8.setBounds(820,135,150,75);
- u8.setFont(new Font("Times New Roman",Font.BOLD,20));
- u8.setBackground(Color.LIGHT_GRAY);
- u8.setForeground(Color.BLACK);
- f12.add(u8);
- JPanel rp8 = new JPanel();
- f12.add(rp8);
- rp8.setBounds(0,0,1366,120);
- rp8.setBackground(Color.BLACK);
- rp8.setBorder(BorderFactory.createEtchedBorder(1));
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.BLACK);
- Font font =(new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f12.add(pane);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f12.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f12.setVisible(false);
- f4.setVisible(true);
- }
- });
- //ADD-8
- a8.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_A){
- a8.doClick();
- }
- }
- });
- a8.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f22 = new JFrame();
- f22.setVisible(true);
- f12.setVisible(false);
- f22.setSize(1366,768);
- f22.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f22.setIconImage(icon.getImage());
- f22.add(c5);
- c5.setBounds(0,650,200,50);
- JPanel rp23 = new JPanel();
- rp23.setBounds(0,0,1366,120);
- rp23.setBackground(Color.BLACK);
- rp23.setBorder(BorderFactory.createEtchedBorder(1));
- f22.add(rp23);
- JLabel r22 = new JLabel("Prisoner Fill Up Form");
- r22.setBounds(485,30,450,70);
- r22.setFont(new Font("Times new Roman",Font.BOLD,80));
- r22.setForeground(Color.WHITE);
- rp23.add(r22);
- JPanel rp33 = new JPanel();
- rp33.setBounds(12,130,1325,450);
- rp33.setBackground(Color.BLACK);
- rp33.setBorder(BorderFactory.createEtchedBorder());
- f22.add(rp33);
- JLabel r146 = new JLabel();
- r146.setBounds(15,15,130,130);
- r146.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
- rp33.add(r146);
- //Prisoner aydi:
- JLabel r268 = new JLabel ("FIRSTNAME:");
- r268.setBounds(183,40,200,50);
- r268.setFont(new Font("Times new Roman",Font.BOLD,20));
- r268.setForeground(Color.WHITE);
- JTextField tf243 = new JTextField ();
- tf243.setBounds(180,85,210,30);
- rp33.add(tf243);
- rp33.add(r268);
- JLabel r269 = new JLabel ("MI:");
- r269.setBounds(413,40,200,50);
- r269.setFont(new Font("Times new Roman",Font.BOLD,20));
- r269.setForeground(Color.WHITE);
- JTextField tf244 = new JTextField ();
- tf244.setBounds(410,85,80,30);
- rp33.add(tf244);
- rp33.add(r269);
- JLabel r270 = new JLabel ("LASTNAME:");
- r270.setBounds(518,40,200,50);
- r270.setFont(new Font("Times new Roman",Font.BOLD,20));
- r270.setForeground(Color.WHITE);
- JTextField tf245 = new JTextField ();
- tf245.setBounds(515,85,210,30);
- rp33.add(tf245);
- rp33.add(r270);
- JLabel r271 = new JLabel ("SEX:");
- r271.setBounds(751,40,200,50);
- r271.setFont(new Font("Times new Roman",Font.BOLD,20));
- r271.setForeground(Color.WHITE);
- JTextField tf246 = new JTextField ();
- tf246.setBounds(750,85,90,30);
- rp33.add(tf246);
- rp33.add(r271);
- JLabel r272 = new JLabel ("AGE:");
- r272.setBounds(861,40,200,50);
- r272.setFont(new Font("Times new Roman",Font.BOLD,20));
- r272.setForeground(Color.WHITE);
- JTextField tf247 = new JTextField ();
- tf247.setBounds(860,85,60,30);
- rp33.add(tf247);
- rp33.add(r272);
- JLabel r273 = new JLabel ("ADDRESS:");
- r273.setBounds(951,40,200,50);
- r273.setFont(new Font("Times new Roman",Font.BOLD,20));
- r273.setForeground(Color.WHITE);
- JTextField tf248 = new JTextField ();
- tf248.setBounds(950,85,355,30);
- rp33.add(tf248);
- rp33.add(r273);
- JLabel r274 = new JLabel ("DATE OF BIRTH:");
- r274.setBounds(17,150,200,50);
- r274.setFont(new Font("Times new Roman",Font.BOLD,20));
- r274.setForeground(Color.WHITE);
- JTextField tf249 = new JTextField ();
- tf249.setBounds(15,195,210,30);
- rp33.add(tf249);
- rp33.add(r274);
- JLabel r275 = new JLabel ("NATIONALITY:");
- r275.setBounds(247,150,200,50);
- r275.setFont(new Font("Times new Roman",Font.BOLD,20));
- r275.setForeground(Color.WHITE);
- JTextField tf250 = new JTextField ();
- tf250.setBounds(245,195,210,30);
- rp33.add(tf250);
- rp33.add(r275);
- JLabel r276 = new JLabel ("HEIGHT:");
- r276.setBounds(482,150,200,50);
- r276.setFont(new Font("Times new Roman",Font.BOLD,20));
- r276.setForeground(Color.WHITE);
- JTextField tf251 = new JTextField ();
- tf251.setBounds(480,195,120,30);
- rp33.add(tf251);
- rp33.add(r276);
- JLabel r277 = new JLabel ("WEIGHT:");
- r277.setBounds(636,150,200,50);
- r277.setFont(new Font("Times new Roman",Font.BOLD,20));
- r277.setForeground(Color.WHITE);
- JTextField tf252 = new JTextField ();
- tf252.setBounds(630,195,120,30);
- rp33.add(tf252);
- rp33.add(r277);
- JLabel r278 = new JLabel ("EYE COLOR:");
- r278.setBounds(787,150,200,50);
- r278.setFont(new Font("Times new Roman",Font.BOLD,20));
- r278.setForeground(Color.WHITE);
- JTextField tf253 = new JTextField ();
- tf253.setBounds(785 ,195,190,30);
- rp33.add(tf253);
- rp33.add(r278);
- JLabel r279 = new JLabel ("PHONE NUMBER:");
- r279.setBounds(997,150,200,50);
- r279.setFont(new Font("Times new Roman",Font.BOLD,20));
- r279.setForeground(Color.WHITE);
- JTextField tf254 = new JTextField ();
- tf254.setBounds(995,195,310,30);
- rp33.add(tf254);
- rp33.add(r279);
- JLabel r280 = new JLabel ("LANGUAGE:");
- r280.setBounds(16,250,200,50);
- r280.setFont(new Font("Times new Roman",Font.BOLD,20));
- r280.setForeground(Color.WHITE);
- JTextField tf255 = new JTextField ();
- tf255.setBounds(15,295,210,30);
- rp33.add(tf255);
- rp33.add(r280);
- JLabel r281 = new JLabel ("DATE OF CAPTURE:");
- r281.setBounds(247,250,200,50);
- r281.setFont(new Font("Times new Roman",Font.BOLD,20));
- r281.setForeground(Color.WHITE);
- JTextField tf256 = new JTextField ();
- tf256.setBounds(245,295,210,30);
- rp33.add(tf256);
- rp33.add(r281);
- JLabel r282 = new JLabel ("PLACE OF CAPTURE:");
- r282.setBounds(482,250,220,50);
- r282.setFont(new Font("Times new Roman",Font.BOLD,20));
- r282.setForeground(Color.WHITE);
- JTextField tf257 = new JTextField ();
- tf257.setBounds(480,295,320,30);
- rp33.add(tf257);
- rp33.add(r282);
- JLabel r283 = new JLabel ("CIVILLIAN OCCUPATION:");
- r283.setBounds(827,250,270,50);
- r283.setFont(new Font("Times new Roman",Font.BOLD,20));
- r283.setForeground(Color.WHITE);
- JTextField tf258 = new JTextField ();
- tf258.setBounds(825,295,480,30);
- rp33.add(tf258);
- rp33.add(r283);
- JLabel r284 = new JLabel ("PHYSICAL CONDITION:");
- r284.setBounds(16,350,260,50);
- r284.setFont(new Font("Times new Roman",Font.BOLD,20));
- r284.setForeground(Color.WHITE);
- JTextField tf259 = new JTextField ();
- tf259.setBounds(15,395,260,30);
- rp33.add(tf259);
- rp33.add(r284);
- JLabel r285 = new JLabel ("DAYS IN JAIL:");
- r285.setBounds(302,350,250,50);
- r285.setFont(new Font("Times new Roman",Font.BOLD,20));
- r285.setForeground(Color.WHITE);
- JTextField tf260 = new JTextField ();
- tf260.setBounds(300,395,180,30);
- rp33.add(tf260);
- rp33.add(r285);
- JLabel r286 = new JLabel ("ARRIVAL OF PRISONER:");
- r286.setBounds(502,350,280,50);
- r286.setFont(new Font("Times new Roman",Font.BOLD,20));
- r286.setForeground(Color.WHITE);
- JTextField tf261 = new JTextField ();
- tf261.setBounds(500,395,280,30);
- rp33.add(tf261);
- rp33.add(r286);
- JLabel r287 = new JLabel ("DATE/TIME:");
- r287.setBounds(802,350,250,50);
- r287.setFont(new Font("Times new Roman",Font.BOLD,20));
- r287.setForeground(Color.WHITE);
- JTextField tf262 = new JTextField ();
- tf262.setBounds(800,395,150,30);
- rp33.add(tf262);
- rp33.add(r287);
- JLabel r288 = new JLabel ("ARRIVAL OFFICER:");
- r288.setBounds(972,350,250,50);
- r288.setFont(new Font("Times new Roman",Font.BOLD,20));
- r288.setForeground(Color.WHITE);
- JTextField tf263 = new JTextField ();
- tf263.setBounds(970,395,335,30);
- rp33.add(tf263);
- rp33.add(r288);
- rp33.setLayout(null);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f22.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f22.setVisible(false);
- f12.setVisible(true);
- }
- });
- //update
- JButton update = new JButton("Update");
- update.setBounds(820,600,150,75);
- update.setFont(new Font("Times New Roman",Font.BOLD,20));
- update.setBackground(Color.LIGHT_GRAY);
- update.setForeground(Color.BLACK);
- f22.add(update);
- //Save
- JButton Save = new JButton("Save");
- Save.setBounds(1000,600,150,75);
- Save.setFont(new Font("Times New Roman",Font.BOLD,20));
- Save.setBackground(Color.LIGHT_GRAY);
- Save.setForeground(Color.BLACK);
- f22.add(Save);
- u8.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u8.doClick();
- }
- }
- });
- u8.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f22.setVisible(true);
- f12.setVisible(false);
- }
- });
- //UPDATE FUNCTION
- update.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_U){
- update.doClick();
- }
- }
- });
- update.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to UPDATE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f22.setVisible(false);
- f12.setVisible(true);
- JOptionPane.showMessageDialog(f12,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //ADD FUNCTION
- Save.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_S){
- Save.doClick();
- }
- }
- });
- Save.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to ADD This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f22.setVisible(false);
- f12.setVisible(true);
- JOptionPane.showMessageDialog(f12,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //DELETE FUNCTION
- d8.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_D){
- d8.doClick();
- }
- }
- });
- d8.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to DELETE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- JOptionPane.showMessageDialog(f12,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- }
- });
- }
- });
- //B9
- r9.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_9){
- r9.doClick();
- }
- }
- });
- r9.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f13 = new JFrame();
- f13.setVisible(true);
- f4.setVisible(false);
- f13.setSize(1366,768);
- f13.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f13.setIconImage(icon.getImage());
- f13.add(c5);
- c5.setBounds(0,650,200,50);
- JLabel rl9 = new JLabel("Cell Nine");
- rl9.setBounds(485,30,450,70);
- rl9.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl9.setForeground(Color.WHITE);
- f13.add(rl9);
- JButton a9 = new JButton("Add");
- a9.setBounds(1180,135,150,75);
- a9.setFont(new Font("Times New Roman",Font.BOLD,20));
- a9.setBackground(Color.LIGHT_GRAY);
- a9.setForeground(Color.BLACK);
- f13.add(a9);
- JButton d9 = new JButton("Delete");
- d9.setBounds(1000,135,150,75);
- d9.setFont(new Font("Times New Roman",Font.BOLD,20));
- d9.setBackground(Color.LIGHT_GRAY);
- d9.setForeground(Color.BLACK);
- f13.add(d9);
- JButton u9 = new JButton("Edit");
- u9.setBounds(820,135,150,75);
- u9.setFont(new Font("Times New Roman",Font.BOLD,20));
- u9.setBackground(Color.LIGHT_GRAY);
- u9.setForeground(Color.BLACK);
- f13.add(u9);
- JPanel rp9 = new JPanel();
- f13.add(rp9);
- rp9.setBounds(0,0,1366,120);
- rp9.setBackground(Color.BLACK);
- rp9.setBorder(BorderFactory.createEtchedBorder(1));
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.RED);
- Font font =(new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f13.add(pane);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f13.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f13.setVisible(false);
- f4.setVisible(true);
- }
- });
- //ADD-9
- a9.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_A){
- a9.doClick();
- }
- }
- });
- a9.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f23 = new JFrame();
- f23.setVisible(true);
- f13.setVisible(false);
- f23.setSize(1366,768);
- f23.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f23.setIconImage(icon.getImage());
- f23.add(c5);
- c5.setBounds(0,650,200,50);
- JPanel rp24 = new JPanel();
- rp24.setBounds(0,0,1366,120);
- rp24.setBackground(Color.BLACK);
- rp24.setBorder(BorderFactory.createEtchedBorder(1));
- f23.add(rp24);
- JLabel r23 = new JLabel("Prisoner Fill Up Form");
- r23.setBounds(485,30,450,70);
- r23.setFont(new Font("Times new Roman",Font.BOLD,80));
- r23.setForeground(Color.WHITE);
- rp24.add(r23);
- JPanel rp34 = new JPanel();
- rp34.setBounds(12,130,1325,450);
- rp34.setBackground(Color.BLACK);
- rp34.setBorder(BorderFactory.createEtchedBorder());
- f23.add(rp34);
- JLabel r147 = new JLabel();
- r147.setBounds(15,15,130,130);
- r147.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
- rp34.add(r147);
- //Prisoner aydi:
- JLabel r289 = new JLabel ("FIRSTNAME:");
- r289.setBounds(183,40,200,50);
- r289.setFont(new Font("Times new Roman",Font.BOLD,20));
- r289.setForeground(Color.WHITE);
- JTextField tf264 = new JTextField ();
- tf264.setBounds(180,85,210,30);
- rp34.add(tf264);
- rp34.add(r289);
- JLabel r290 = new JLabel ("MI:");
- r290.setBounds(413,40,200,50);
- r290.setFont(new Font("Times new Roman",Font.BOLD,20));
- r290.setForeground(Color.WHITE);
- JTextField tf265 = new JTextField ();
- tf265.setBounds(410,85,80,30);
- rp34.add(tf265);
- rp34.add(r290);
- JLabel r291 = new JLabel ("LASTNAME:");
- r291.setBounds(518,40,200,50);
- r291.setFont(new Font("Times new Roman",Font.BOLD,20));
- r291.setForeground(Color.WHITE);
- JTextField tf266 = new JTextField ();
- tf266.setBounds(515,85,210,30);
- rp34.add(tf266);
- rp34.add(r291);
- JLabel r292 = new JLabel ("SEX:");
- r292.setBounds(751,40,200,50);
- r292.setFont(new Font("Times new Roman",Font.BOLD,20));
- r292.setForeground(Color.WHITE);
- JTextField tf267 = new JTextField ();
- tf267.setBounds(750,85,90,30);
- rp34.add(tf267);
- rp34.add(r292);
- JLabel r293 = new JLabel ("AGE:");
- r293.setBounds(861,40,200,50);
- r293.setFont(new Font("Times new Roman",Font.BOLD,20));
- r293.setForeground(Color.WHITE);
- JTextField tf268 = new JTextField ();
- tf268.setBounds(860,85,60,30);
- rp34.add(tf268);
- rp34.add(r293);
- JLabel r294 = new JLabel ("ADDRESS:");
- r294.setBounds(951,40,200,50);
- r294.setFont(new Font("Times new Roman",Font.BOLD,20));
- r294.setForeground(Color.WHITE);
- JTextField tf269 = new JTextField ();
- tf269.setBounds(950,85,355,30);
- rp34.add(tf269);
- rp34.add(r294);
- JLabel r295 = new JLabel ("DATE OF BIRTH:");
- r295.setBounds(17,150,200,50);
- r295.setFont(new Font("Times new Roman",Font.BOLD,20));
- r295.setForeground(Color.WHITE);
- JTextField tf270 = new JTextField ();
- tf270.setBounds(15,195,210,30);
- rp34.add(tf270);
- rp34.add(r295);
- JLabel r296 = new JLabel ("NATIONALITY:");
- r296.setBounds(247,150,200,50);
- r296.setFont(new Font("Times new Roman",Font.BOLD,20));
- r296.setForeground(Color.WHITE);
- JTextField tf271 = new JTextField ();
- tf271.setBounds(245,195,210,30);
- rp34.add(tf271);
- rp34.add(r296);
- JLabel r297 = new JLabel ("HEIGHT:");
- r297.setBounds(482,150,200,50);
- r297.setFont(new Font("Times new Roman",Font.BOLD,20));
- r297.setForeground(Color.WHITE);
- JTextField tf272 = new JTextField ();
- tf272.setBounds(480,195,120,30);
- rp34.add(tf272);
- rp34.add(r297);
- JLabel r298 = new JLabel ("WEIGHT:");
- r298.setBounds(636,150,200,50);
- r298.setFont(new Font("Times new Roman",Font.BOLD,20));
- r298.setForeground(Color.WHITE);
- JTextField tf273 = new JTextField ();
- tf273.setBounds(630,195,120,30);
- rp34.add(tf273);
- rp34.add(r298);
- JLabel r299 = new JLabel ("EYE COLOR:");
- r299.setBounds(787,150,200,50);
- r299.setFont(new Font("Times new Roman",Font.BOLD,20));
- r299.setForeground(Color.WHITE);
- JTextField tf274 = new JTextField ();
- tf274.setBounds(785,195,190,30);
- rp34.add(tf274);
- rp34.add(r299);
- JLabel r300 = new JLabel ("PHONE NUMBER:");
- r300.setBounds(997,150,200,50);
- r300.setFont(new Font("Times new Roman",Font.BOLD,20));
- r300.setForeground(Color.WHITE);
- JTextField tf275 = new JTextField ();
- tf275.setBounds(995,195,310,30);
- rp34.add(tf275);
- rp34.add(r300);
- JLabel r301 = new JLabel ("LANGUAGE:");
- r301.setBounds(16,250,200,50);
- r301.setFont(new Font("Times new Roman",Font.BOLD,20));
- r301.setForeground(Color.WHITE);
- JTextField tf276 = new JTextField ();
- tf276.setBounds(15,295,210,30);
- rp34.add(tf276);
- rp34.add(r301);
- JLabel r302 = new JLabel ("DATE OF CAPTURE:");
- r302.setBounds(247,250,200,50);
- r302.setFont(new Font("Times new Roman",Font.BOLD,20));
- r302.setForeground(Color.WHITE);
- JTextField tf277 = new JTextField ();
- tf277.setBounds(245,295,210,30);
- rp34.add(tf277);
- rp34.add(r302);
- JLabel r303 = new JLabel ("PLACE OF CAPTURE:");
- r303.setBounds(482,250,220,50);
- r303.setFont(new Font("Times new Roman",Font.BOLD,20));
- r303.setForeground(Color.WHITE);
- JTextField tf278 = new JTextField ();
- tf278.setBounds(480,295,320,30);
- rp34.add(tf278);
- rp34.add(r303);
- JLabel r304 = new JLabel ("CIVILLIAN OCCUPATION:");
- r304.setBounds(827,250,270,50);
- r304.setFont(new Font("Times new Roman",Font.BOLD,20));
- r304.setForeground(Color.WHITE);
- JTextField tf279 = new JTextField ();
- tf279.setBounds(825,295,480,30);
- rp34.add(tf279);
- rp34.add(r304);
- JLabel r305 = new JLabel ("PHYSICAL CONDITION:");
- r305.setBounds(16,350,260,50);
- r305.setFont(new Font("Times new Roman",Font.BOLD,20));
- r305.setForeground(Color.WHITE);
- JTextField tf280 = new JTextField ();
- tf280.setBounds(15,395,260,30);
- rp34.add(tf280);
- rp34.add(r305);
- JLabel r306 = new JLabel ("DAYS IN JAIL:");
- r306.setBounds(302,350,250,50);
- r306.setFont(new Font("Times new Roman",Font.BOLD,20));
- r306.setForeground(Color.WHITE);
- JTextField tf281 = new JTextField ();
- tf281.setBounds(300,395,180,30);
- rp34.add(tf281);
- rp34.add(r306);
- JLabel r307 = new JLabel ("ARRIVAL OF PRISONER:");
- r307.setBounds(502,350,280,50);
- r307.setFont(new Font("Times new Roman",Font.BOLD,20));
- r307.setForeground(Color.WHITE);
- JTextField tf282 = new JTextField ();
- tf282.setBounds(500,395,280,30);
- rp34.add(tf282);
- rp34.add(r307);
- JLabel r308 = new JLabel ("DATE/TIME:");
- r308.setBounds(802,350,250,50);
- r308.setFont(new Font("Times new Roman",Font.BOLD,20));
- r308.setForeground(Color.WHITE);
- JTextField tf283 = new JTextField ();
- tf283.setBounds(800,395,150,30);
- rp34.add(tf283);
- rp34.add(r308);
- JLabel r309 = new JLabel ("ARRIVAL OFFICER:");
- r309.setBounds(972,350,250,50);
- r309.setFont(new Font("Times new Roman",Font.BOLD,20));
- r309.setForeground(Color.WHITE);
- JTextField tf284 = new JTextField ();
- tf284.setBounds(970,395,335,30);
- rp34.add(tf284);
- rp34.add(r309);
- rp34.setLayout(null);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f23.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f23.setVisible(false);
- f13.setVisible(true);
- }
- });
- //update
- JButton update = new JButton("Update");
- update.setBounds(820,600,150,75);
- update.setFont(new Font("Times New Roman",Font.BOLD,20));
- update.setBackground(Color.LIGHT_GRAY);
- update.setForeground(Color.BLACK);
- f23.add(update);
- //Save
- JButton Save = new JButton("Save");
- Save.setBounds(1000,600,150,75);
- Save.setFont(new Font("Times New Roman",Font.BOLD,20));
- Save.setBackground(Color.LIGHT_GRAY);
- Save.setForeground(Color.BLACK);
- f23.add(Save);
- u9.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u9.doClick();
- }
- }
- });
- u9.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f23.setVisible(true);
- f13.setVisible(false);
- }
- });
- //UPDATE FUNCTION
- update.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_U){
- update.doClick();
- }
- }
- });
- update.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to UPDATE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f23.setVisible(false);
- f13.setVisible(true);
- JOptionPane.showMessageDialog(f13,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //ADD FUNCTION
- Save.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_S){
- Save.doClick();
- }
- }
- });
- Save.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to ADD This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f23.setVisible(false);
- f13.setVisible(true);
- JOptionPane.showMessageDialog(f13,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //DELETE FUNCTION
- d9.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_D){
- d9.doClick();
- }
- }
- });
- d9.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to DELETE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- JOptionPane.showMessageDialog(f13,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- }
- });
- }
- });
- //B10
- r10.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_0){
- r10.doClick();
- }
- }
- });
- r10.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f14 = new JFrame();
- f14.setVisible(true);
- f4.setVisible(false);
- f14.setSize(1366,768);
- f14.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f14.setIconImage(icon.getImage());
- f14.add(c5);
- c5.setBounds(0,650,200,50);
- JLabel rl10 = new JLabel("Cell Ten");
- rl10.setBounds(485,30,450,70);
- rl10.setFont(new Font("Times new Roman",Font.BOLD,80));
- rl10.setForeground(Color.WHITE);
- f14.add(rl10);
- JButton a10 = new JButton("Add");
- a10.setBounds(1180,135,150,75);
- a10.setFont(new Font("Times New Roman",Font.BOLD,20));
- a10.setBackground(Color.LIGHT_GRAY);
- a10.setForeground(Color.BLACK);
- f14.add(a10);
- JButton d10 = new JButton("Delete");
- d10.setBounds(1000,135,150,75);
- d10.setFont(new Font("Times New Roman",Font.BOLD,20));
- d10.setBackground(Color.LIGHT_GRAY);
- d10.setForeground(Color.BLACK);
- f14.add(d10);
- JButton u10 = new JButton("Edit");
- u10.setBounds(820,135,150,75);
- u10.setFont(new Font("Times New Roman",Font.BOLD,20));
- u10.setBackground(Color.LIGHT_GRAY);
- u10.setForeground(Color.BLACK);
- f14.add(u10);
- JPanel rp10 = new JPanel();
- f14.add(rp10);
- rp10.setBounds(0,0,1366,120);
- rp10.setBackground(Color.BLACK);
- rp10.setBorder(BorderFactory.createEtchedBorder(1));
- JTable table = new JTable();
- Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
- "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
- "ArrivalPrisoner","Date/Time","ArrivalOficer"};
- DefaultTableModel model = new DefaultTableModel();
- model.setColumnIdentifiers(columns);
- table.setModel(model);
- table.setBackground(Color.LIGHT_GRAY);
- table.setForeground(Color.RED);
- Font font =(new Font("Times New Roman",Font.BOLD,20));
- table.setFont(font);
- table.setRowHeight(30);
- //JScrollPane
- JScrollPane pane = new JScrollPane(table);
- pane.setBounds(0,230,1366,350);
- f14.add(pane);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f14.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f14.setVisible(false);
- f4.setVisible(true);
- }
- });
- //ADD-10
- a10.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_A){
- a10.doClick();
- }
- }
- });
- a10.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Frame f24 = new JFrame();
- f24.setVisible(true);
- f14.setVisible(false);
- f24.setSize(1366,768);
- f24.setLayout(null);
- ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
- f24.setIconImage(icon.getImage());
- f24.add(c5);
- c5.setBounds(0,650,200,50);
- JPanel rp25 = new JPanel();
- rp25.setBounds(0,0,1366,120);
- rp25.setBackground(Color.BLACK);
- rp25.setBorder(BorderFactory.createEtchedBorder(1));
- f24.add(rp25);
- JLabel r24 = new JLabel("Prisoner Fill Up Form");
- r24.setBounds(485,30,450,70);
- r24.setFont(new Font("Times new Roman",Font.BOLD,80));
- r24.setForeground(Color.WHITE);
- rp25.add(r24);
- JPanel rp35 = new JPanel();
- rp35.setBounds(12,130,1325,450);
- rp35.setBackground(Color.BLACK);
- rp35.setBorder(BorderFactory.createEtchedBorder());
- f24.add(rp35);
- JLabel r118 = new JLabel();
- r118.setBounds(15,15,130,130);
- r118.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
- rp35.add(r118);
- //Prisoner aydi:
- JLabel r97 = new JLabel ("FIRSTNAME:");
- r97.setBounds(183,40,200,50);
- r97.setFont(new Font("Times new Roman",Font.BOLD,20));
- r97.setForeground(Color.WHITE);
- JTextField tf75 = new JTextField ();
- tf75.setBounds(180,85,210,30);
- rp35.add(tf75);
- rp35.add(r97);
- JLabel r98 = new JLabel ("MI:");
- r98.setBounds(413,40,200,50);
- r98.setFont(new Font("Times new Roman",Font.BOLD,20));
- r98.setForeground(Color.WHITE);
- JTextField tf76 = new JTextField ();
- tf76.setBounds(410,85,80,30);
- rp35.add(tf76);
- rp35.add(r98);
- JLabel r99 = new JLabel ("LASTNAME:");
- r99.setBounds(518,40,200,50);
- r99.setFont(new Font("Times new Roman",Font.BOLD,20));
- r99.setForeground(Color.WHITE);
- JTextField tf77 = new JTextField ();
- tf77.setBounds(515,85,210,30);
- rp35.add(tf77);
- rp35.add(r99);
- JLabel r100 = new JLabel ("SEX:");
- r100.setBounds(751,40,200,50);
- r100.setFont(new Font("Times new Roman",Font.BOLD,20));
- r100.setForeground(Color.WHITE);
- JTextField tf78 = new JTextField ();
- tf78.setBounds(750,85,90,30);
- rp35.add(tf78);
- rp35.add(r100);
- JLabel r101 = new JLabel ("AGE:");
- r101.setBounds(861,40,200,50);
- r101.setFont(new Font("Times new Roman",Font.BOLD,20));
- r101.setForeground(Color.WHITE);
- JTextField tf79 = new JTextField ();
- tf79.setBounds(860,85,60,30);
- rp35.add(tf79);
- rp35.add(r101);
- JLabel r102 = new JLabel ("ADDRESS:");
- r102.setBounds(951,40,200,50);
- r102.setFont(new Font("Times new Roman",Font.BOLD,20));
- r102.setForeground(Color.WHITE);
- JTextField tf80 = new JTextField ();
- tf80.setBounds(950,85,355,30);
- rp35.add(tf80);
- rp35.add(r102);
- JLabel r103 = new JLabel ("DATE OF BIRTH:");
- r103.setBounds(17,150,200,50);
- r103.setFont(new Font("Times new Roman",Font.BOLD,20));
- r103.setForeground(Color.WHITE);
- JTextField tf81 = new JTextField ();
- tf81.setBounds(15,195,210,30);
- rp35.add(tf81);
- rp35.add(r103);
- JLabel r104 = new JLabel ("NATIONALITY:");
- r104.setBounds(247,150,200,50);
- r104.setFont(new Font("Times new Roman",Font.BOLD,20));
- r104.setForeground(Color.WHITE);
- JTextField tf82 = new JTextField ();
- tf82.setBounds(245,195,210,30);
- rp35.add(tf82);
- rp35.add(r104);
- JLabel r105 = new JLabel ("HEIGHT:");
- r105.setBounds(482,150,200,50);
- r105.setFont(new Font("Times new Roman",Font.BOLD,20));
- r105.setForeground(Color.WHITE);
- JTextField tf83 = new JTextField ();
- tf83.setBounds(480,195,120,30);
- rp35.add(tf83);
- rp35.add(r105);
- JLabel r106 = new JLabel ("WEIGHT:");
- r106.setBounds(636,150,200,50);
- r106.setFont(new Font("Times new Roman",Font.BOLD,20));
- r106.setForeground(Color.WHITE);
- JTextField tf84 = new JTextField ();
- tf84.setBounds(630,195,120,30);
- rp35.add(tf84);
- rp35.add(r106);
- JLabel r107 = new JLabel ("EYE COLOR:");
- r107.setBounds(787,150,200,50);
- r107.setFont(new Font("Times new Roman",Font.BOLD,20));
- r107.setForeground(Color.WHITE);
- JTextField tf85 = new JTextField ();
- tf85.setBounds(785 ,195,190,30);
- rp35.add(tf85);
- rp35.add(r107);
- JLabel r108 = new JLabel ("PHONE NUMBER:");
- r108.setBounds(997,150,200,50);
- r108.setFont(new Font("Times new Roman",Font.BOLD,20));
- r108.setForeground(Color.WHITE);
- JTextField tf86 = new JTextField ();
- tf86.setBounds(995,195,310,30);
- rp35.add(tf86);
- rp35.add(r108);
- JLabel r109 = new JLabel ("LANGUAGE:");
- r109.setBounds(16,250,200,50);
- r109.setFont(new Font("Times new Roman",Font.BOLD,20));
- r109.setForeground(Color.WHITE);
- JTextField tf87 = new JTextField ();
- tf87.setBounds(15,295,210,30);
- rp35.add(tf87);
- rp35.add(r109);
- JLabel r110 = new JLabel ("DATE OF CAPTURE:");
- r110.setBounds(247,250,200,50);
- r110.setFont(new Font("Times new Roman",Font.BOLD,20));
- r110.setForeground(Color.WHITE);
- JTextField tf88 = new JTextField ();
- tf88.setBounds(245,295,210,30);
- rp35.add(tf88);
- rp35.add(r110);
- JLabel r111 = new JLabel ("PLACE OF CAPTURE:");
- r111.setBounds(482,250,220,50);
- r111.setFont(new Font("Times new Roman",Font.BOLD,20));
- r111.setForeground(Color.WHITE);
- JTextField tf89 = new JTextField ();
- tf89.setBounds(480,295,320,30);
- rp35.add(tf89);
- rp35.add(r111);
- JLabel r112 = new JLabel ("CIVILLIAN OCCUPATION:");
- r112.setBounds(827,250,270,50);
- r112.setFont(new Font("Times new Roman",Font.BOLD,20));
- r112.setForeground(Color.WHITE);
- JTextField tf90 = new JTextField ();
- tf90.setBounds(825,295,480,30);
- rp35.add(tf90);
- rp35.add(r112);
- JLabel r113 = new JLabel ("PHYSICAL CONDITION:");
- r113.setBounds(16,350,260,50);
- r113.setFont(new Font("Times new Roman",Font.BOLD,20));
- r113.setForeground(Color.WHITE);
- JTextField tf91 = new JTextField ();
- tf91.setBounds(15,395,260,30);
- rp35.add(tf91);
- rp35.add(r113);
- JLabel r114 = new JLabel ("DAYS IN JAIL:");
- r114.setBounds(302,350,250,50);
- r114.setFont(new Font("Times new Roman",Font.BOLD,20));
- r114.setForeground(Color.WHITE);
- JTextField tf92 = new JTextField ();
- tf92.setBounds(300,395,180,30);
- rp35.add(tf92);
- rp35.add(r114);
- JLabel r115 = new JLabel ("ARRIVAL OF PRISONER:");
- r115.setBounds(502,350,280,50);
- r115.setFont(new Font("Times new Roman",Font.BOLD,20));
- r115.setForeground(Color.WHITE);
- JTextField tf93 = new JTextField ();
- tf93.setBounds(500,395,280,30);
- rp35.add(tf93);
- rp35.add(r115);
- JLabel r116 = new JLabel ("DATE/TIME:");
- r116.setBounds(802,350,250,50);
- r116.setFont(new Font("Times new Roman",Font.BOLD,20));
- r116.setForeground(Color.WHITE);
- JTextField tf94 = new JTextField ();
- tf94.setBounds(800,395,150,30);
- rp35.add(tf94);
- rp35.add(r116);
- JLabel r117 = new JLabel ("ARRIVAL OFFICER:");
- r117.setBounds(972,350,250,50);
- r117.setFont(new Font("Times new Roman",Font.BOLD,20));
- r117.setForeground(Color.WHITE);
- JTextField tf95 = new JTextField ();
- tf95.setBounds(970,395,335,30);
- rp35.add(tf95);
- rp35.add(r117);
- rp35.setLayout(null);
- JButton Back = new JButton("Back");
- Back.setBounds(1180,600,150,75);
- Back.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back.setBackground(Color.LIGHT_GRAY);
- Back.setForeground(Color.BLACK);
- f24.add(Back);
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- Back.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f24.setVisible(false);
- f14.setVisible(true);
- }
- });
- //update
- JButton update = new JButton("Update");
- update.setBounds(820,600,150,75);
- update.setFont(new Font("Times New Roman",Font.BOLD,20));
- update.setBackground(Color.LIGHT_GRAY);
- update.setForeground(Color.BLACK);
- f24.add(update);
- //Save
- JButton Save = new JButton("Save");
- Save.setBounds(1000,600,150,75);
- Save.setFont(new Font("Times New Roman",Font.BOLD,20));
- Save.setBackground(Color.LIGHT_GRAY);
- Save.setForeground(Color.BLACK);
- f24.add(Save);
- u10.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_E){
- u10.doClick();
- }
- }
- });
- u10.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f24.setVisible(true);
- f14.setVisible(false);
- }
- });
- //UPDATE FUNCTION
- update.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_U){
- update.doClick();
- }
- }
- });
- update.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to UPDATE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f24.setVisible(false);
- f14.setVisible(true);
- JOptionPane.showMessageDialog(f14,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //ADD FUNCTION
- Save.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_S){
- Save.doClick();
- }
- }
- });
- Save.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to ADD This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION){
- f24.setVisible(false);
- f14.setVisible(true);
- JOptionPane.showMessageDialog(f14,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- //DELETE FUNCTION
- Back.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back.doClick();
- }
- }
- });
- d10.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_D){
- d10.doClick();
- }
- }
- });
- d10.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e) {
- int n = JOptionPane.showConfirmDialog(
- null, "Would you like to DELETE This Row?",
- "Are you sure?",
- JOptionPane.YES_NO_OPTION);
- if (n == JOptionPane.YES_OPTION) {
- JOptionPane.showMessageDialog(f14,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- }
- });
- }
- });
- //back1
- JButton Back1 = new JButton("Back");
- Back1.setBounds(1180,600,150,75);
- Back1.setFont(new Font("Times New Roman",Font.BOLD,20));
- Back1.setBackground(Color.LIGHT_GRAY);
- Back1.setForeground(Color.BLACK);
- f4.add(Back1);
- Back1.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_B){
- Back1.doClick();
- }
- }
- });
- Back1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- f4.setVisible(false);
- f2.setVisible(true);
- }
- });
- Back1.addKeyListener(new KeyAdapter(){
- public void keyPressed(KeyEvent w){
- if(w.getKeyCode()==KeyEvent.VK_L){
- Back1.doClick();
- }
- }
- });
- //f1
- f1.setSize(1366,768);
- f1.setVisible(true);
- f1.setLayout(null);
- //f2
- f2.setVisible(false);
- f2.setSize(1366,768);
- f2.setLayout(null);
- //f3
- f3.setVisible(false);
- f3.setSize(1366,768);
- f3.setLayout(null);
- //f4
- f4.setVisible(false);
- f4.setSize(1366,768);
- f4.setLayout(null);
- //add(f1)
- f1.add(jail);
- f1.add(User);
- f1.add(Pass);
- f1.add(BLogin);
- f1.add(TUser);
- f1.add(TPass);
- //clock
- f2.add(c1);
- c1.setBounds(0,650,200,50);
- f3.add(c2);
- c2.setBounds(0,650,200,50);
- f4.add(c3);
- c3.setBounds(0,650,200,50);
- System.out.println("-------- MySQL JDBC Connection Testing ------------");
- try {
- Class.forName("com.mysql.cj.jdbc.Driver");
- } catch (ClassNotFoundException e) {
- System.out.println("Where is your MySQL JDBC Driver?");
- e.printStackTrace();
- return;
- }
- System.out.println("MySQL JDBC Driver Registered!");
- Connection connection = null;
- try {
- connection = DriverManager
- .getConnection("jdbc:mysql://localhost:3306/prison?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC", "root", "");
- } catch (SQLException e) {
- System.out.println("Connection Failed! Check output console");
- e.printStackTrace();
- return;
- }
- if (connection != null) {
- System.out.println("You made it, take control your database now!");
- } else {
- System.out.println("Failed to make connection!");
- }
- }
- public static void video() throws IOException {
- Desktop.getDesktop().open(new File("C:\\Users\\jayjay matabang\\Desktop\\vid.mp4"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement