Advertisement
RigWeak

Untitled

Apr 26th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 187.68 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.awt.event.*;
  3. import java.awt.*;
  4. import javax.swing.table.*;
  5. import javax.imageio.ImageIO;
  6. import java.io.*;
  7. import java.io.File;
  8. import java.io.IOException;
  9. import java.sql.*;
  10.  
  11.  
  12.  
  13. public class JailManagement {
  14.  
  15. public static final String jdriver = "com.mysql.cj.jdbc.Driver";
  16. public static final String dburl = "jdbc:mysql://localhost:3306/prison?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
  17. public static final String userdb = "root";
  18. public static final String passdb = "";
  19.  
  20.  
  21. public static void main(String args[]){
  22.  
  23. ClockPane c1 = new ClockPane();
  24. ClockPane c2 = new ClockPane();
  25. ClockPane c3 = new ClockPane();
  26. ClockPane c4 = new ClockPane();
  27. ClockPane c5 = new ClockPane();
  28.  
  29.  
  30.  
  31.  
  32.  
  33. //f1
  34. JFrame f1 = new JFrame();
  35. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  36. f1.setIconImage(icon.getImage());
  37. //f2
  38. JFrame f2 = new JFrame();
  39. ImageIcon icon1 = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  40. f2.setIconImage(icon.getImage());
  41.  
  42. //f3
  43. JFrame f3 = new JFrame();
  44. ImageIcon icon2 = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  45. f3.setIconImage(icon.getImage());
  46.  
  47. //f4
  48. JFrame f4 = new JFrame();
  49. ImageIcon icon3 = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  50. f4.setIconImage(icon.getImage());
  51.  
  52. //Login
  53.  
  54.  
  55. JLabel jail = new JLabel("Jail Management System");
  56. jail.setBounds(468,265,440,50);
  57. jail.setFont(new Font("Times New Roman",Font.BOLD,40));
  58. jail.setForeground(Color.WHITE);
  59.  
  60.  
  61. JLabel User = new JLabel("Username");
  62. User.setBounds(620,340,150,30);
  63. User.setFont(new Font("Times New Roman",Font.BOLD,25));
  64. User.setForeground(Color.WHITE);
  65.  
  66. JLabel Pass = new JLabel("Password");
  67. Pass.setBounds(620,415,150,30);
  68. Pass.setFont(new Font("Times New Roman",Font.BOLD,25));
  69. Pass.setForeground(Color.WHITE);
  70.  
  71.  
  72. JTextField TUser = new JTextField();
  73. TUser.setBounds(570,380,200,30);
  74.  
  75. JPasswordField TPass = new JPasswordField();
  76. TPass.setBounds(570,450,200,30);
  77.  
  78. JButton BLogin = new JButton ("Login");
  79. BLogin.setBounds(570,510,200,30);
  80.  
  81.  
  82. try{
  83. f1.setContentPane(new JLabel(new ImageIcon(ImageIO.read(new File("C:\\Users\\jayjay matabang\\Desktop\\pic4.png")))));
  84. }
  85. catch(IOException b){
  86. b.printStackTrace();
  87. }
  88.  
  89. BLogin.addKeyListener(new KeyAdapter(){
  90. public void keyPressed(KeyEvent w){
  91. if(w.getKeyCode()==KeyEvent.VK_ENTER){
  92. BLogin.doClick();
  93. }
  94. }
  95. });
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102. BLogin.addActionListener(new ActionListener() {
  103.  
  104. public void actionPerformed(ActionEvent e) {
  105. String a = TUser.getText();
  106. String b = TPass.getText();
  107.  
  108.  
  109. if (a.equals("jm")&& b.equals("gwapo")){
  110. f1.setVisible(false);
  111. f2.setVisible(true);
  112. JOptionPane.showMessageDialog(f1,"Welcome to Jail Management System","Information",JOptionPane.INFORMATION_MESSAGE);
  113. }
  114. else if(a.equals("mukha")&& b.equals("123")){
  115. f1.setVisible(false);
  116. f2.setVisible(true);
  117. JOptionPane.showMessageDialog(f1,"Welcome to Jail Management System","Information",JOptionPane.INFORMATION_MESSAGE);
  118.  
  119. }
  120. else if (a.equals("")&&b.equals("")){
  121. JOptionPane.showMessageDialog(f1,"Please Type Username and Password","Information",JOptionPane.INFORMATION_MESSAGE);
  122.  
  123. }
  124. else {
  125. JOptionPane.showMessageDialog(f1,"Wrong Username and Password!","Warning",JOptionPane.ERROR_MESSAGE);
  126. }
  127.  
  128. }
  129. });
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137. //HomePage
  138.  
  139. //tour
  140. JButton tour = new JButton("Tour");
  141. tour.setBounds(1180,600,150,75);
  142. tour.setFont(new Font("Times New Roman",Font.BOLD,20));
  143. tour.setBackground(Color.LIGHT_GRAY);
  144. tour.setForeground(Color.BLACK);
  145. f2.add(tour);
  146.  
  147. tour.addKeyListener(new KeyAdapter(){
  148. public void keyPressed(KeyEvent w){
  149. if(w.getKeyCode()==KeyEvent.VK_T){
  150. BLogin.doClick();
  151. }
  152. }
  153. });
  154.  
  155. tour.addActionListener(new ActionListener() {
  156.  
  157. public void actionPerformed(ActionEvent e) {
  158. JFrame f16 = new JFrame();
  159. f16.setVisible(true);
  160. f2.setVisible(false);
  161. f16.setLayout(null);
  162. f16.setSize(1366,768);
  163. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  164. f16.setIconImage(icon.getImage());
  165.  
  166. f16.add(c4);
  167. c4.setBounds(0,650,200,50);
  168.  
  169.  
  170.  
  171.  
  172.  
  173. JButton rule = new JButton("Rule");
  174. rule.setBounds(1180,135,150,75);
  175. rule.setFont(new Font("Times New Roman",Font.BOLD,20));
  176. rule.setBackground(Color.LIGHT_GRAY);
  177. rule.setForeground(Color.BLACK);
  178. f16.add(rule);
  179. JButton Watch = new JButton("Watch");
  180. Watch.setBounds(1000,135,150,75);
  181. Watch.setFont(new Font("Times New Roman",Font.BOLD,20));
  182. Watch.setBackground(Color.LIGHT_GRAY);
  183. Watch.setForeground(Color.BLACK);
  184. f16.add(Watch);
  185.  
  186. JLabel p1 = new JLabel();
  187. p1.setBounds(45,20,140,83);
  188. p1.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
  189. f16.add(p1);
  190. JLabel p2 = new JLabel();
  191. p2.setBounds(1150,20,140,83);
  192. p2.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
  193. f16.add(p2);
  194.  
  195. JLabel tl1 = new JLabel("Jail Gallery");
  196. tl1.setBounds(485,30,450,70);
  197. tl1.setFont(new Font("Times new Roman",Font.BOLD,75));
  198. tl1.setForeground(Color.WHITE);
  199. f16.add(tl1);
  200.  
  201. //Gallery
  202. JLabel p3 = new JLabel();
  203. p3.setBounds(0,230,320,350);
  204. p3.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\fac1.jpg"));
  205. f16.add(p3);
  206. JLabel p4 = new JLabel();
  207. p4.setBounds(321,230,340,350);
  208. p4.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\fac6.jpg"));
  209. f16.add(p4);
  210. JLabel p5 = new JLabel();
  211. p5.setBounds(662,230,340,350);
  212. p5.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\fac10.jpg"));
  213. f16.add(p5);
  214. JLabel p6 = new JLabel();
  215. p6.setBounds(1003,230,360,350);
  216. p6.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\fac77.jpg"));
  217. f16.add(p6);
  218.  
  219. JPanel t1 = new JPanel();
  220. t1.setBounds(0,0,1366,120);
  221. t1.setBackground(Color.BLACK);
  222. t1.setBorder(BorderFactory.createEtchedBorder(1));
  223. f16.add(t1);
  224.  
  225. Watch.addKeyListener(new KeyAdapter(){
  226. public void keyPressed(KeyEvent w){
  227. if(w.getKeyCode()==KeyEvent.VK_W){
  228. Watch.doClick();
  229. }
  230. }
  231. });
  232. Watch.addActionListener(new ActionListener() {
  233.  
  234. public void actionPerformed(ActionEvent e) {
  235.  
  236.  
  237. try {
  238. video();
  239. } catch (IOException ex) {
  240. ex.printStackTrace();
  241. }
  242.  
  243.  
  244.  
  245. }
  246. });
  247. rule.addKeyListener(new KeyAdapter(){
  248. public void keyPressed(KeyEvent w){
  249. if(w.getKeyCode()==KeyEvent.VK_R){
  250. rule.doClick();
  251. }
  252. }
  253. });
  254. rule.addActionListener(new ActionListener() {
  255.  
  256. public void actionPerformed(ActionEvent e) {
  257.  
  258. JFrame f17 = new JFrame();
  259. f17.setVisible(true);
  260. f17.setLayout(null);
  261. f17.setSize(500,300);
  262. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  263. f17.setIconImage(icon.getImage());
  264.  
  265.  
  266. JLabel p7 = new JLabel();
  267. p7.setBounds(0,0,480,270);
  268. p7.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\tg1.gif"));
  269. f17.add(p7);
  270.  
  271.  
  272. }
  273. });
  274.  
  275.  
  276. JButton Back = new JButton("Back");
  277. Back.setBounds(1180,600,150,75);
  278. Back.setBackground(Color.LIGHT_GRAY);
  279. Back.setForeground(Color.BLACK);
  280. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  281. f16.add(Back);
  282.  
  283. Back.addActionListener(new ActionListener() {
  284.  
  285. public void actionPerformed(ActionEvent e) {
  286. f16.setVisible(false);
  287. f2.setVisible(true);
  288.  
  289.  
  290. }
  291. });
  292. Back.addKeyListener(new KeyAdapter(){
  293. public void keyPressed(KeyEvent w){
  294. if(w.getKeyCode()==KeyEvent.VK_B){
  295. Back.doClick();
  296. }
  297. }
  298. });
  299.  
  300.  
  301.  
  302.  
  303. }
  304. });
  305.  
  306.  
  307. JLabel lp2 = new JLabel();
  308. lp2.setBounds(45,20,140,83);
  309. lp2.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
  310. f2.add(lp2);
  311. JLabel lp7 = new JLabel();
  312. lp7.setBounds(1150,20,140,83);
  313. lp7.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
  314. f2.add(lp7);
  315. JButton BHome = new JButton("Home");
  316. BHome.setBounds(270,20,150,75);
  317. BHome.setFont(new Font("Times New Roman",Font.BOLD,20));
  318. BHome.setBackground(Color.LIGHT_GRAY);
  319. BHome.setForeground(Color.BLACK);
  320. JButton BPrisoner = new JButton("Prisoner");
  321. BPrisoner.setBounds(485,20,150,75);
  322. BPrisoner.setFont(new Font("Times New Roman",Font.BOLD,20));
  323. BPrisoner.setBackground(Color.LIGHT_GRAY);
  324. BPrisoner.setForeground(Color.BLACK);
  325. JLabel lp8 = new JLabel();
  326. lp8.setBounds(45,20,140,83);
  327. lp8.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
  328. f3.add(lp8);
  329. JLabel lp9 = new JLabel();
  330. lp9.setBounds(1150,20,140,83);
  331. lp9.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
  332. f3.add(lp9);
  333. JButton BRoom = new JButton("Room");
  334. BRoom.setBounds(695,20,150,75);
  335. BRoom.setBackground(Color.LIGHT_GRAY);
  336. BRoom.setForeground(Color.BLACK);
  337. BRoom.setFont(new Font("Times New Roman",Font.BOLD,20));
  338. JButton BLogout = new JButton("Logout");
  339. BLogout.setBounds(900,20,150,75);
  340. BLogout.setFont(new Font("Times New Roman",Font.BOLD,20));
  341. BLogout.setBackground(Color.LIGHT_GRAY);
  342. BLogout.setForeground(Color.BLACK);
  343. JLabel lp3 = new JLabel();
  344. lp3.setBounds(1120,30,175,75);
  345. lp3.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic1.png"));
  346. f2.add(lp3);
  347. JPanel jpl = new JPanel();
  348. jpl.setBounds(0,0,1366,120);
  349. jpl.setBackground(Color.BLACK);
  350. jpl.setBorder(BorderFactory.createEtchedBorder(1));
  351. f2.add(BHome);
  352. f2.add(BPrisoner);
  353. f2.add(BRoom);
  354. f2.add(BLogout);
  355. f2.add(jpl);
  356.  
  357.  
  358. //Logout
  359. BLogout.addKeyListener(new KeyAdapter(){
  360. public void keyPressed(KeyEvent w){
  361. if(w.getKeyCode()==KeyEvent.VK_L){
  362. BLogout.doClick();
  363. }
  364. }
  365. });
  366. BLogout.addActionListener(new ActionListener() {
  367.  
  368. public void actionPerformed(ActionEvent e) {
  369. int n = JOptionPane.showConfirmDialog(
  370. f2, "Would you like to exit the program?",
  371. "Are you sure?",
  372. JOptionPane.YES_NO_OPTION);
  373. if (n == JOptionPane.YES_OPTION) {
  374. f2.setVisible(false);
  375. f1.setVisible(true);
  376. TUser.setText("");
  377. TPass.setText("");
  378. }
  379. else {
  380. f1.setVisible(false);
  381. f2.setVisible(true);
  382. }
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390. }
  391. });
  392.  
  393. JLabel tp = new JLabel("Jail Mangement Cooperation");
  394. tp.setBounds(390,0,900,350);
  395. tp.setFont(new Font("Times New Roman",Font.BOLD,48));
  396. f2.add(tp);
  397. JLabel lp = new JLabel();
  398. lp.setBounds(450,0,1000,900);
  399. lp.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png"));
  400. f2.add(lp);
  401.  
  402. BPrisoner.addKeyListener(new KeyAdapter(){
  403. public void keyPressed(KeyEvent w){
  404. if(w.getKeyCode()==KeyEvent.VK_P){
  405. BPrisoner.doClick();
  406. }
  407. }
  408. });
  409. BHome.addKeyListener(new KeyAdapter(){
  410. public void keyPressed(KeyEvent w){
  411. if(w.getKeyCode()==KeyEvent.VK_H){
  412. BHome.doClick();
  413. }
  414. }
  415. });
  416. BRoom.addKeyListener(new KeyAdapter(){
  417. public void keyPressed(KeyEvent w){
  418. if(w.getKeyCode()==KeyEvent.VK_R){
  419. BRoom.doClick();
  420. }
  421. }
  422. });
  423.  
  424.  
  425.  
  426.  
  427. //Prisoner Page
  428.  
  429.  
  430. BPrisoner.addActionListener(new ActionListener() {
  431.  
  432. public void actionPerformed(ActionEvent e) {
  433. f2.setVisible(false);
  434. f3.setVisible(true);
  435. f4.setVisible(false);
  436.  
  437.  
  438. JButton BHome = new JButton("Home");
  439. BHome.setBounds(270,20,150,75);
  440. BHome.setFont(new Font("Times New Roman",Font.BOLD,20));
  441. BHome.setBackground(Color.LIGHT_GRAY);
  442. BHome.setForeground(Color.BLACK);
  443. //home
  444. BHome.addActionListener(new ActionListener() {
  445.  
  446. public void actionPerformed(ActionEvent e) {
  447.  
  448. f3.setVisible(false);
  449. f2.setVisible(true);
  450. f4.setVisible(false);
  451.  
  452.  
  453. }
  454. });
  455. JButton BPrisoner = new JButton("Prisoner");
  456. BPrisoner.setBounds(485,20,150,75);
  457. BPrisoner.setBackground(Color.LIGHT_GRAY);
  458. BPrisoner.setForeground(Color.BLACK);
  459. BPrisoner.setFont(new Font("Times New Roman",Font.BOLD,20));
  460. JButton BRoom = new JButton("Room");
  461. BRoom.setBounds(695,20,150,75);
  462. BRoom.setFont(new Font("Times New Roman",Font.BOLD,20));
  463. BRoom.setBackground(Color.LIGHT_GRAY);
  464. BRoom.setForeground(Color.BLACK);
  465. BRoom.addActionListener(new ActionListener() {
  466.  
  467. public void actionPerformed(ActionEvent e) {
  468.  
  469. f3.setVisible(false);
  470. f2.setVisible(false);
  471. f4.setVisible(true);
  472.  
  473.  
  474. }
  475. });
  476. BPrisoner.addKeyListener(new KeyAdapter(){
  477. public void keyPressed(KeyEvent w){
  478. if(w.getKeyCode()==KeyEvent.VK_P){
  479. BPrisoner.doClick();
  480. }
  481. }
  482. });
  483. BHome.addKeyListener(new KeyAdapter(){
  484. public void keyPressed(KeyEvent w){
  485. if(w.getKeyCode()==KeyEvent.VK_H){
  486. BHome.doClick();
  487. }
  488. }
  489. });
  490. BRoom.addKeyListener(new KeyAdapter(){
  491. public void keyPressed(KeyEvent w){
  492. if(w.getKeyCode()==KeyEvent.VK_R){
  493. BRoom.doClick();
  494. }
  495. }
  496. });
  497.  
  498. JTable table = new JTable();
  499. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  500. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  501. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  502.  
  503. DefaultTableModel model = new DefaultTableModel();
  504. model.setColumnIdentifiers(columns);
  505. table.setModel(model);
  506.  
  507.  
  508. table.setBackground(Color.LIGHT_GRAY);
  509. table.setForeground(Color.RED);
  510. Font font = (new Font("Times New Roman",Font.BOLD,20));
  511. table.setFont(font);
  512. table.setRowHeight(30);
  513.  
  514. //JScrollPane
  515. JScrollPane pane = new JScrollPane(table);
  516. pane.setBounds(0,230,1366,350);
  517. f3.add(pane);
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524. JButton BLogout = new JButton("Logout");
  525. BLogout.setBounds(900,20,150,75);
  526. BLogout.setFont(new Font("Times New Roman",Font.BOLD,20));
  527. BLogout.setBackground(Color.LIGHT_GRAY);
  528. BLogout.setForeground(Color.BLACK);
  529. //Logout
  530. BLogout.addKeyListener(new KeyAdapter(){
  531. public void keyPressed(KeyEvent w){
  532. if(w.getKeyCode()==KeyEvent.VK_L){
  533. BLogout.doClick();
  534. }
  535. }
  536. });
  537. BLogout.addActionListener(new ActionListener() {
  538.  
  539. public void actionPerformed(ActionEvent e) {
  540. int n = JOptionPane.showConfirmDialog(
  541. f2, "Would you like to exit the program?",
  542. "Are you sure?",
  543. JOptionPane.YES_NO_OPTION);
  544. if (n == JOptionPane.YES_OPTION) {
  545. f3.setVisible(false);
  546. f1.setVisible(true);
  547. TUser.setText("");
  548. TPass.setText("");
  549. }
  550. else {
  551. f1.setVisible(false);
  552. f3.setVisible(true);
  553. }
  554. }
  555. });
  556.  
  557. BLogout.addKeyListener(new KeyAdapter(){
  558. public void keyPressed(KeyEvent w){
  559. if(w.getKeyCode()==KeyEvent.VK_L){
  560. BLogout.doClick();
  561. }
  562. }
  563. });
  564.  
  565. JPanel jpl = new JPanel();
  566. jpl.setBounds(0,0,1366,120);
  567. jpl.setBackground(Color.BLACK);
  568. jpl.setBorder(BorderFactory.createEtchedBorder(1));
  569. f3.add(BHome);
  570. f3.add(BPrisoner);
  571. f3.add(BRoom);
  572. f3.add(BLogout);
  573. f3.add(jpl);
  574.  
  575.  
  576.  
  577.  
  578.  
  579. }
  580. });
  581. // view
  582.  
  583. JButton VRoom = new JButton("Room");
  584. VRoom.setBounds(1000,135,150,75);
  585. VRoom.setBackground(Color.LIGHT_GRAY);
  586. VRoom.setForeground(Color.BLACK);
  587. VRoom.setFont(new Font("Times New Roman",Font.BOLD,20));
  588. JButton Bview = new JButton("View");
  589. Bview.setBounds(1180,135,150,75);
  590. Bview.setFont(new Font("Times New Roman",Font.BOLD,20));
  591. Bview.setBackground(Color.LIGHT_GRAY);
  592. Bview.setForeground(Color.BLACK);
  593.  
  594. f3.add(VRoom);
  595. f3.add(Bview);
  596.  
  597.  
  598. Bview.addKeyListener(new KeyAdapter(){
  599. public void keyPressed(KeyEvent w){
  600. if(w.getKeyCode()==KeyEvent.VK_V){
  601. Bview.doClick();
  602. }
  603. }
  604. });
  605.  
  606.  
  607. Bview.addActionListener(new ActionListener() {
  608.  
  609. public void actionPerformed(ActionEvent e) {
  610.  
  611. Frame f15 = new JFrame();
  612. f15.setVisible(true);
  613. f3.setVisible(false);
  614. f15.setSize(1366,768);
  615. f15.setLayout(null);
  616. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  617. f15.setIconImage(icon.getImage());
  618. f15.add(c5);
  619. c5.setBounds(0,650,200,50);
  620.  
  621.  
  622. //Button View
  623. JLabel vl1 = new JLabel("Prisoner List");
  624. vl1.setBounds(485,30,450,70);
  625. vl1.setFont(new Font("Times new Roman",Font.BOLD,80));
  626. vl1.setForeground(Color.WHITE);
  627. f15.add(vl1);
  628.  
  629.  
  630. JTable table = new JTable();
  631. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  632. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  633. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  634. DefaultTableModel model = new DefaultTableModel();
  635. model.setColumnIdentifiers(columns);
  636. table.setModel(model);
  637.  
  638.  
  639. table.setBackground(Color.LIGHT_GRAY);
  640. table.setForeground(Color.RED);
  641. Font font = (new Font("Times New Roman",Font.BOLD,20));
  642. table.setFont(font);
  643. table.setRowHeight(30);
  644.  
  645. //JScrollPane
  646. JScrollPane pane = new JScrollPane(table);
  647. pane.setBounds(0,230,1366,350);
  648. f15.add(pane);
  649.  
  650. //release
  651. JButton Release = new JButton("Release");
  652. Release.setBounds(1180,135,150,75);
  653. Release.setFont(new Font("Times New Roman",Font.BOLD,20));
  654. Release.setBackground(Color.LIGHT_GRAY);
  655. Release.setForeground(Color.BLACK);
  656. f15.add(Release);
  657.  
  658. //Archieve
  659. JButton ar = new JButton("Archive");
  660. ar.setBounds(1000,135,150,75);
  661. ar.setFont(new Font("Times New Roman",Font.BOLD,20));
  662. ar.setBackground(Color.LIGHT_GRAY);
  663. ar.setForeground(Color.BLACK);
  664. f15.add(ar);
  665.  
  666. JPanel vp1 = new JPanel();
  667. f15.add(vp1);
  668. vp1.setBounds(0,0,1366,120);
  669. vp1.setBackground(Color.BLACK);
  670. vp1.setBorder(BorderFactory.createEtchedBorder(1));
  671.  
  672.  
  673.  
  674. JButton Back = new JButton("Back");
  675. Back.setBounds(1180,600,150,75);
  676. Back.setBackground(Color.LIGHT_GRAY);
  677. Back.setForeground(Color.BLACK);
  678. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  679. f15.add(Back);
  680.  
  681.  
  682. Back.addKeyListener(new KeyAdapter(){
  683. public void keyPressed(KeyEvent w){
  684. if(w.getKeyCode()==KeyEvent.VK_B){
  685. Back.doClick();
  686. }
  687. }
  688. });
  689.  
  690.  
  691. Back.addActionListener(new ActionListener() {
  692.  
  693. public void actionPerformed(ActionEvent e) {
  694. f15.setVisible(false);
  695. f3.setVisible(true);
  696.  
  697.  
  698. }
  699. });
  700.  
  701.  
  702.  
  703. }
  704. });
  705.  
  706.  
  707.  
  708.  
  709.  
  710. VRoom.addActionListener(new ActionListener() {
  711.  
  712. public void actionPerformed(ActionEvent e) {
  713.  
  714. f3.setVisible(false);
  715. f4.setVisible(true);
  716. }
  717. });
  718.  
  719. VRoom.addKeyListener(new KeyAdapter(){
  720. public void keyPressed(KeyEvent w){
  721. if(w.getKeyCode()==KeyEvent.VK_R){
  722. VRoom.doClick();
  723. }
  724. }
  725. });
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733. //back
  734.  
  735. JButton Back = new JButton("Back");
  736. Back.setBounds(1180,600,150,75);
  737. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  738. Back.setBackground(Color.LIGHT_GRAY);
  739. Back.setForeground(Color.BLACK);
  740. f3.add(Back);
  741.  
  742.  
  743.  
  744. Back.addActionListener(new ActionListener() {
  745.  
  746. public void actionPerformed(ActionEvent e) {
  747. f3.setVisible(false);
  748. f2.setVisible(true);
  749. f4.setVisible(false);
  750.  
  751.  
  752.  
  753. }
  754. });
  755.  
  756. Back.addKeyListener(new KeyAdapter(){
  757. public void keyPressed(KeyEvent w){
  758. if(w.getKeyCode()==KeyEvent.VK_B){
  759. Back.doClick();
  760. }
  761. }
  762. });
  763.  
  764.  
  765. //Room Page
  766.  
  767. BRoom.addActionListener(new ActionListener() {
  768.  
  769. public void actionPerformed(ActionEvent e) {
  770. f2.setVisible(false);
  771. f3.setVisible(false);
  772. f4.setVisible(true);
  773.  
  774.  
  775. JLabel lp10 = new JLabel();
  776. lp10.setBounds(45,20,140,83);
  777. lp10.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
  778. f4.add(lp10);
  779. JLabel lp11 = new JLabel();
  780. lp11.setBounds(1150,20,140,83);
  781. lp11.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\pic22.png"));
  782. f4.add(lp11);
  783.  
  784.  
  785.  
  786. JButton BHome = new JButton("Home");
  787. BHome.setBounds(270,20,150,75);
  788. BHome.setBackground(Color.LIGHT_GRAY);
  789. BHome.setForeground(Color.BLACK);
  790. BHome.setFont(new Font("Times New Roman",Font.BOLD,20));
  791. //home
  792. BHome.addActionListener(new ActionListener() {
  793.  
  794. public void actionPerformed(ActionEvent e) {
  795.  
  796. f3.setVisible(false);
  797. f2.setVisible(true);
  798. f4.setVisible(false);
  799.  
  800.  
  801. }
  802. });
  803. JButton BPrisoner = new JButton("Prisoner");
  804. BPrisoner.setBounds(485,20,150,75);
  805. BPrisoner.setFont(new Font("Times New Roman",Font.BOLD,20));
  806. BPrisoner.setBackground(Color.LIGHT_GRAY);
  807. BPrisoner.setForeground(Color.BLACK);
  808. BPrisoner.addActionListener(new ActionListener() {
  809.  
  810. public void actionPerformed(ActionEvent e) {
  811.  
  812. f3.setVisible(true);
  813. f2.setVisible(false);
  814. f4.setVisible(false);
  815.  
  816.  
  817. }
  818. });
  819. JButton BRoom = new JButton("Room");
  820. BRoom.setBounds(695,20,150,75);
  821. BRoom.setFont(new Font("Times New Roman",Font.BOLD,20));
  822. BRoom.setBackground(Color.LIGHT_GRAY);
  823. BRoom.setForeground(Color.BLACK);
  824. JButton BLogout = new JButton("Logout");
  825. BLogout.setBounds(900,20,150,75);
  826. BLogout.setFont(new Font("Times New Roman",Font.BOLD,20));
  827. BLogout.setBackground(Color.LIGHT_GRAY);
  828. BLogout.setForeground(Color.BLACK);
  829. //Logout
  830. BLogout.addKeyListener(new KeyAdapter(){
  831. public void keyPressed(KeyEvent w){
  832. if(w.getKeyCode()==KeyEvent.VK_L){
  833. BLogout.doClick();
  834. }
  835. }
  836. });
  837. BPrisoner.addKeyListener(new KeyAdapter(){
  838. public void keyPressed(KeyEvent w){
  839. if(w.getKeyCode()==KeyEvent.VK_P){
  840. BPrisoner.doClick();
  841. }
  842. }
  843. });
  844. BHome.addKeyListener(new KeyAdapter(){
  845. public void keyPressed(KeyEvent w){
  846. if(w.getKeyCode()==KeyEvent.VK_H){
  847. BHome.doClick();
  848. }
  849. }
  850. });
  851. BRoom.addKeyListener(new KeyAdapter(){
  852. public void keyPressed(KeyEvent w){
  853. if(w.getKeyCode()==KeyEvent.VK_R){
  854. BRoom.doClick();
  855. }
  856. }
  857. });
  858.  
  859.  
  860. BLogout.addActionListener(new ActionListener() {
  861.  
  862. public void actionPerformed(ActionEvent e) {
  863. int n = JOptionPane.showConfirmDialog(
  864. f2, "Would you like to exit the program?",
  865. "Are you sure?",
  866. JOptionPane.YES_NO_OPTION);
  867. if (n == JOptionPane.YES_OPTION) {
  868. f4.setVisible(false);
  869. f1.setVisible(true);
  870. TUser.setText("");
  871. TPass.setText("");
  872. }
  873. else {
  874. f1.setVisible(false);
  875. f4.setVisible(true);
  876. }
  877. }
  878. });
  879. JLabel z = new JLabel("Room List");
  880. z.setBounds(485,140,450,70);
  881. z.setFont(new Font("Times New Roman",Font.BOLD,90));
  882. f4.add(z);
  883.  
  884.  
  885.  
  886. JPanel jpl = new JPanel();
  887. jpl.setBounds(0,0,1366,120);
  888. jpl.setBackground(Color.BLACK);
  889. jpl.setBorder(BorderFactory.createEtchedBorder(1));
  890. f4.add(BHome);
  891. f4.add(BPrisoner);
  892. f4.add(BRoom);
  893. f4.add(BLogout);
  894. f4.add(jpl);
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901. }
  902. });
  903.  
  904. //Room List
  905.  
  906.  
  907. JButton r1 = new JButton("Cell One");
  908. r1.setBounds(218,300,198,45);
  909. r1.setFont(new Font("Times New Roman",Font.BOLD,20));
  910. r1.setBackground(Color.LIGHT_GRAY);
  911. r1.setForeground(Color.BLACK);
  912. JButton r2 = new JButton("Cell Two");
  913. r2.setBounds(218,351,198,47);
  914. r2.setBackground(Color.LIGHT_GRAY);
  915. r2.setForeground(Color.BLACK);
  916. r2.setFont(new Font("Times New Roman",Font.BOLD,20));
  917. JButton r3 = new JButton("Cell Three");
  918. r3.setBounds(218,400,198,45);
  919. r3.setFont(new Font("Times New Roman",Font.BOLD,20));
  920. r3.setBackground(Color.LIGHT_GRAY);
  921. r3.setForeground(Color.BLACK);
  922. JButton r4 = new JButton("Cell Four");
  923. r4.setBounds(218,448,198,45);
  924. r4.setFont(new Font("Times New Roman",Font.BOLD,20));
  925. r4.setBackground(Color.LIGHT_GRAY);
  926. r4.setForeground(Color.BLACK);
  927. JButton r5 = new JButton("Cell Five");
  928. r5.setBounds(960,300,198,45);
  929. r5.setFont(new Font("Times New Roman",Font.BOLD,20));
  930. r5.setBackground(Color.LIGHT_GRAY);
  931. r5.setForeground(Color.BLACK);
  932. JButton r6 = new JButton("Cell Six");
  933. r6.setBounds(960,350,198,47);
  934. r6.setFont(new Font("Times New Roman",Font.BOLD,20));
  935. r6.setBackground(Color.LIGHT_GRAY);
  936. r6.setForeground(Color.BLACK);
  937. JButton r7 = new JButton("Cell Seven");
  938. r7.setBounds(960,400,198,45);
  939. r7.setFont(new Font("Times New Roman",Font.BOLD,20));
  940. r7.setBackground(Color.LIGHT_GRAY);
  941. r7.setForeground(Color.BLACK);
  942. JButton r8 = new JButton("Cell Eight");
  943. r8.setBounds(960,448,198,45);
  944. r8.setFont(new Font("Times New Roman",Font.BOLD,20));
  945. r8.setBackground(Color.LIGHT_GRAY);
  946. r8.setForeground(Color.BLACK);
  947. JButton r9 = new JButton("Cell Nine");
  948. r9.setBounds(500,311,177,66);
  949. r9.setFont(new Font("Times New Roman",Font.BOLD,20));
  950. r9.setBackground(Color.LIGHT_GRAY);
  951. r9.setForeground(Color.BLACK);
  952. JButton r10 = new JButton("Cell Ten");
  953. r10.setBounds(681,311,181,66);
  954. r10.setFont(new Font("Times New Roman",Font.BOLD,20));
  955. r10.setBackground(Color.LIGHT_GRAY);
  956. r10.setForeground(Color.BLACK);
  957.  
  958. f4.add(r1);
  959. f4.add(r2);
  960. f4.add(r3);
  961. f4.add(r4);
  962. f4.add(r5);
  963. f4.add(r6);
  964. f4.add(r7);
  965. f4.add(r8);
  966. f4.add(r9);
  967. f4.add(r10);
  968. JLabel lp12 = new JLabel();
  969. lp12.setBounds(0,230,1366,350);
  970. lp12.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\jm.jpg"));
  971. f4.add(lp12);
  972.  
  973. BPrisoner.addKeyListener(new KeyAdapter(){
  974. public void keyPressed(KeyEvent w){
  975. if(w.getKeyCode()==KeyEvent.VK_P){
  976. BPrisoner.doClick();
  977. }
  978. }
  979. });
  980. BHome.addKeyListener(new KeyAdapter(){
  981. public void keyPressed(KeyEvent w){
  982. if(w.getKeyCode()==KeyEvent.VK_H){
  983. BHome.doClick();
  984. }
  985. }
  986. });
  987. BRoom.addKeyListener(new KeyAdapter(){
  988. public void keyPressed(KeyEvent w){
  989. if(w.getKeyCode()==KeyEvent.VK_R){
  990. BRoom.doClick();
  991. }
  992. }
  993. });
  994.  
  995.  
  996. r1.addKeyListener(new KeyAdapter(){
  997. public void keyPressed(KeyEvent w){
  998. if(w.getKeyCode()==KeyEvent.VK_1){
  999. r1.doClick();
  1000. }
  1001. }
  1002. });
  1003. r1.addActionListener(new ActionListener() {
  1004.  
  1005. public void actionPerformed(ActionEvent e) {
  1006.  
  1007.  
  1008.  
  1009. Frame f5 = new JFrame();
  1010. f5.setVisible(true);
  1011. f4.setVisible(false);
  1012. f5.setSize(1366,768);
  1013. f5.setLayout(null);
  1014. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  1015. f5.setIconImage(icon.getImage());
  1016. f5.add(c5);
  1017. c5.setBounds(0,650,200,50);
  1018.  
  1019. //B-1
  1020. JLabel rl1 = new JLabel("Cell One");
  1021. rl1.setBounds(485,30,450,70);
  1022. rl1.setFont(new Font("Times new Roman",Font.BOLD,80));
  1023. rl1.setForeground(Color.WHITE);
  1024. f5.add(rl1);
  1025.  
  1026. JButton a1 = new JButton("Add");
  1027. a1.setBounds(1180,135,150,75);
  1028. a1.setFont(new Font("Times New Roman",Font.BOLD,20));
  1029. a1.setBackground(Color.LIGHT_GRAY);
  1030. a1.setForeground(Color.BLACK);
  1031. f5.add(a1);
  1032.  
  1033. JButton d1 = new JButton("Delete");
  1034. d1.setBounds(1000,135,150,75);
  1035. d1.setFont(new Font("Times New Roman",Font.BOLD,20));
  1036. d1.setBackground(Color.LIGHT_GRAY);
  1037. d1.setForeground(Color.BLACK);
  1038. f5.add(d1);
  1039.  
  1040. JButton u1 = new JButton("Edit");
  1041. u1.setBounds(820,135,150,75);
  1042. u1.setFont(new Font("Times New Roman",Font.BOLD,20));
  1043. u1.setBackground(Color.LIGHT_GRAY);
  1044. u1.setForeground(Color.BLACK);
  1045. f5.add(u1);
  1046.  
  1047. JPanel rp1 = new JPanel();
  1048. f5.add(rp1);
  1049. rp1.setBounds(0,0,1366,120);
  1050. rp1.setBackground(Color.BLACK);
  1051. rp1.setBorder(BorderFactory.createEtchedBorder(1));
  1052.  
  1053.  
  1054. JTable table = new JTable();
  1055. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  1056. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  1057. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  1058. DefaultTableModel model = new DefaultTableModel();
  1059. model.setColumnIdentifiers(columns);
  1060. table.setModel(model);
  1061.  
  1062.  
  1063. table.setBackground(Color.LIGHT_GRAY);
  1064. table.setForeground(Color.BLACK);
  1065. Font font = (new Font("Times New Roman",Font.BOLD,20));
  1066. table.setFont(font);
  1067. table.setRowHeight(30);
  1068.  
  1069. //JScrollPane
  1070. JScrollPane pane = new JScrollPane(table);
  1071. pane.setBounds(0,230,1366,350);
  1072. f5.add(pane);
  1073.  
  1074.  
  1075.  
  1076. JButton Back = new JButton("Back");
  1077. Back.setBounds(1180,600,150,75);
  1078. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  1079. Back.setBackground(Color.LIGHT_GRAY);
  1080. Back.setForeground(Color.BLACK);
  1081. f5.add(Back);
  1082.  
  1083.  
  1084. Back.addKeyListener(new KeyAdapter(){
  1085. public void keyPressed(KeyEvent w){
  1086. if(w.getKeyCode()==KeyEvent.VK_B){
  1087. Back.doClick();
  1088. }
  1089. }
  1090. });
  1091. Back.addActionListener(new ActionListener() {
  1092.  
  1093. public void actionPerformed(ActionEvent e) {
  1094. f5.setVisible(false);
  1095. f4.setVisible(true);
  1096.  
  1097.  
  1098. }
  1099. });
  1100.  
  1101.  
  1102. //ADD-1
  1103. a1.addKeyListener(new KeyAdapter(){
  1104. public void keyPressed(KeyEvent w){
  1105. if(w.getKeyCode()==KeyEvent.VK_A){
  1106. a1.doClick();
  1107. }
  1108. }
  1109. });
  1110. a1.addActionListener(new ActionListener() {
  1111.  
  1112. public void actionPerformed(ActionEvent e) {
  1113.  
  1114. Frame f15 = new JFrame();
  1115. f15.setVisible(true);
  1116. f5.setVisible(false);
  1117. f15.setSize(1366,768);
  1118. f15.setLayout(null);
  1119. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  1120. f15.setIconImage(icon.getImage());
  1121. f15.add(c5);
  1122. c5.setBounds(0,650,200,50);
  1123.  
  1124.  
  1125.  
  1126. JPanel rp16 = new JPanel();
  1127. rp16.setBounds(0,0,1366,120);
  1128. rp16.setBackground(Color.BLACK);
  1129. rp16.setBorder(BorderFactory.createEtchedBorder(1));
  1130. f15.add(rp16);
  1131.  
  1132.  
  1133. JLabel rl5 = new JLabel("Prisoner Fill Up Form");
  1134. rl5.setBounds(485,30,450,70);
  1135. rl5.setFont(new Font("Times new Roman",Font.BOLD,80));
  1136. rl5.setForeground(Color.WHITE);
  1137. rp16.add(rl5);
  1138. JPanel rp26 = new JPanel();
  1139. rp26.setBounds(12,130,1325,450);
  1140. rp26.setBackground(Color.BLACK);
  1141. rp26.setBorder(BorderFactory.createEtchedBorder());
  1142. f15.add(rp26);
  1143.  
  1144. JLabel r140 = new JLabel();
  1145. r140.setBounds(15,15,130,130);
  1146. r140.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
  1147. rp26.add(r140);
  1148.  
  1149. //Prisoner aydi:
  1150.  
  1151.  
  1152. JLabel r119 = new JLabel ("FIRSTNAME:");
  1153. r119.setBounds(183,40,200,50);
  1154. r119.setFont(new Font("Times new Roman",Font.BOLD,20));
  1155. r119.setForeground(Color.WHITE);
  1156. JTextField tf96 = new JTextField ();
  1157. tf96.setBounds(180,85,210,30);
  1158. rp26.add(tf96);
  1159. rp26.add(r119);
  1160. JLabel r120 = new JLabel ("MI:");
  1161. r120.setBounds(413,40,200,50);
  1162. r120.setFont(new Font("Times new Roman",Font.BOLD,20));
  1163. r120.setForeground(Color.WHITE);
  1164. JTextField tf97 = new JTextField ();
  1165. tf97.setBounds(410,85,80,30);
  1166. rp26.add(tf97);
  1167. rp26.add(r120);
  1168. JLabel r121 = new JLabel ("LASTNAME:");
  1169. r121.setBounds(518,40,200,50);
  1170. r121.setFont(new Font("Times new Roman",Font.BOLD,20));
  1171. r121.setForeground(Color.WHITE);
  1172. JTextField tf98 = new JTextField ();
  1173. tf98.setBounds(515,85,210,30);
  1174. rp26.add(tf98);
  1175. rp26.add(r121);
  1176. JLabel r122 = new JLabel ("SEX:");
  1177. r122.setBounds(751,40,200,50);
  1178. r122.setFont(new Font("Times new Roman",Font.BOLD,20));
  1179. r122.setForeground(Color.WHITE);
  1180. JTextField tf99 = new JTextField ();
  1181. tf99.setBounds(750,85,90,30);
  1182. rp26.add(tf99);
  1183. rp26.add(r122);
  1184. JLabel r123 = new JLabel ("AGE:");
  1185. r123.setBounds(861,40,200,50);
  1186. r123.setFont(new Font("Times new Roman",Font.BOLD,20));
  1187. r123.setForeground(Color.WHITE);
  1188. JTextField tf100 = new JTextField ();
  1189. tf100.setBounds(860,85,60,30);
  1190. rp26.add(tf100);
  1191. rp26.add(r123);
  1192. JLabel r124 = new JLabel ("ADDRESS:");
  1193. r124.setBounds(951,40,200,50);
  1194. r124.setFont(new Font("Times new Roman",Font.BOLD,20));
  1195. r124.setForeground(Color.WHITE);
  1196. JTextField tf101 = new JTextField ();
  1197. tf101.setBounds(950,85,355,30);
  1198. rp26.add(tf101);
  1199. rp26.add(r124);
  1200. JLabel r125 = new JLabel ("DATE OF BIRTH:");
  1201. r125.setBounds(17,150,200,50);
  1202. r125.setFont(new Font("Times new Roman",Font.BOLD,20));
  1203. r125.setForeground(Color.WHITE);
  1204. JTextField tf102 = new JTextField ();
  1205. tf102.setBounds(15,195,210,30);
  1206. rp26.add(tf102);
  1207. rp26.add(r125);
  1208. JLabel r126 = new JLabel ("NATIONALITY:");
  1209. r126.setBounds(247,150,200,50);
  1210. r126.setFont(new Font("Times new Roman",Font.BOLD,20));
  1211. r126.setForeground(Color.WHITE);
  1212. JTextField tf103 = new JTextField ();
  1213. tf103.setBounds(245,195,210,30);
  1214. rp26.add(tf103);
  1215. rp26.add(r126);
  1216. JLabel r127 = new JLabel ("HEIGHT:");
  1217. r127.setBounds(482,150,200,50);
  1218. r127.setFont(new Font("Times new Roman",Font.BOLD,20));
  1219. r127.setForeground(Color.WHITE);
  1220. JTextField tf104 = new JTextField ();
  1221. tf104.setBounds(480,195,120,30);
  1222. rp26.add(tf104);
  1223. rp26.add(r127);
  1224. JLabel r128 = new JLabel ("WEIGHT:");
  1225. r128.setBounds(636,150,200,50);
  1226. r128.setFont(new Font("Times new Roman",Font.BOLD,20));
  1227. r128.setForeground(Color.WHITE);
  1228. JTextField tf105 = new JTextField ();
  1229. tf105.setBounds(630,195,120,30);
  1230. rp26.add(tf105);
  1231. rp26.add(r128);
  1232. JLabel r129 = new JLabel ("EYE COLOR:");
  1233. r129.setBounds(787,150,200,50);
  1234. r129.setFont(new Font("Times new Roman",Font.BOLD,20));
  1235. r129.setForeground(Color.WHITE);
  1236. JTextField tf106 = new JTextField ();
  1237. tf106.setBounds(785 ,195,190,30);
  1238. rp26.add(tf106);
  1239. rp26.add(r129);
  1240. JLabel r130 = new JLabel ("PHONE NUMBER:");
  1241. r130.setBounds(997,150,200,50);
  1242. r130.setFont(new Font("Times new Roman",Font.BOLD,20));
  1243. r130.setForeground(Color.WHITE);
  1244. JTextField tf107 = new JTextField ();
  1245. tf107.setBounds(995,195,310,30);
  1246. rp26.add(tf107);
  1247. rp26.add(r130);
  1248. JLabel r131 = new JLabel ("LANGUAGE:");
  1249. r131.setBounds(16,250,200,50);
  1250. r131.setFont(new Font("Times new Roman",Font.BOLD,20));
  1251. r131.setForeground(Color.WHITE);
  1252. JTextField tf108 = new JTextField ();
  1253. tf108.setBounds(15,295,210,30);
  1254. rp26.add(tf108);
  1255. rp26.add(r131);
  1256. JLabel r132 = new JLabel ("DATE OF CAPTURE:");
  1257. r132.setBounds(247,250,200,50);
  1258. r132.setFont(new Font("Times new Roman",Font.BOLD,20));
  1259. r132.setForeground(Color.WHITE);
  1260. JTextField tf109 = new JTextField ();
  1261. tf109.setBounds(245,295,210,30);
  1262. rp26.add(tf109);
  1263. rp26.add(r132);
  1264. JLabel r133 = new JLabel ("PLACE OF CAPTURE:");
  1265. r133.setBounds(482,250,220,50);
  1266. r133.setFont(new Font("Times new Roman",Font.BOLD,20));
  1267. r133.setForeground(Color.WHITE);
  1268. JTextField tf110 = new JTextField ();
  1269. tf110.setBounds(480,295,320,30);
  1270. rp26.add(tf110);
  1271. rp26.add(r133);
  1272. JLabel r134 = new JLabel ("CIVILLIAN OCCUPATION:");
  1273. r134.setBounds(827,250,270,50);
  1274. r134.setFont(new Font("Times new Roman",Font.BOLD,20));
  1275. r134.setForeground(Color.WHITE);
  1276. JTextField tf111 = new JTextField ();
  1277. tf111.setBounds(825,295,480,30);
  1278. rp26.add(tf111);
  1279. rp26.add(r134);
  1280. JLabel r135 = new JLabel ("PHYSICAL CONDITION:");
  1281. r135.setBounds(16,350,260,50);
  1282. r135.setFont(new Font("Times new Roman",Font.BOLD,20));
  1283. r135.setForeground(Color.WHITE);
  1284. JTextField tf112 = new JTextField ();
  1285. tf112.setBounds(15,395,260,30);
  1286. rp26.add(tf112);
  1287. rp26.add(r135);
  1288. JLabel r136 = new JLabel ("DAYS IN JAIL:");
  1289. r136.setBounds(302,350,250,50);
  1290. r136.setFont(new Font("Times new Roman",Font.BOLD,20));
  1291. r136.setForeground(Color.WHITE);
  1292. JTextField tf113 = new JTextField ();
  1293. tf113.setBounds(300,395,180,30);
  1294. rp26.add(tf113);
  1295. rp26.add(r136);
  1296. JLabel r137 = new JLabel ("ARRIVAL OF PRISONER:");
  1297. r137.setBounds(502,350,280,50);
  1298. r137.setFont(new Font("Times new Roman",Font.BOLD,20));
  1299. r137.setForeground(Color.WHITE);
  1300. JTextField tf114 = new JTextField ();
  1301. tf114.setBounds(500,395,280,30);
  1302. rp26.add(tf114);
  1303. rp26.add(r137);
  1304. JLabel r138 = new JLabel ("DATE/TIME:");
  1305. r138.setBounds(802,350,250,50);
  1306. r138.setFont(new Font("Times new Roman",Font.BOLD,20));
  1307. r138.setForeground(Color.WHITE);
  1308. JTextField tf115 = new JTextField ();
  1309. tf115.setBounds(800,395,150,30);
  1310. rp26.add(tf115);
  1311. rp26.add(r138);
  1312. JLabel r139 = new JLabel ("ARRIVAL OFFICER:");
  1313. r139.setBounds(972,350,250,50);
  1314. r139.setFont(new Font("Times new Roman",Font.BOLD,20));
  1315. r139.setForeground(Color.WHITE);
  1316. JTextField tf116 = new JTextField ();
  1317. tf116.setBounds(970,395,335,30);
  1318. rp26.add(tf116);
  1319. rp26.add(r139);
  1320. rp26.setLayout(null);
  1321.  
  1322.  
  1323. JButton Back = new JButton("Back");
  1324. Back.setBounds(1180,600,150,75);
  1325. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  1326. Back.setBackground(Color.LIGHT_GRAY);
  1327. Back.setForeground(Color.BLACK);
  1328. f15.add(Back);
  1329.  
  1330.  
  1331. Back.addKeyListener(new KeyAdapter(){
  1332. public void keyPressed(KeyEvent w){
  1333. if(w.getKeyCode()==KeyEvent.VK_B){
  1334. Back.doClick();
  1335. }
  1336. }
  1337. });
  1338. Back.addActionListener(new ActionListener() {
  1339.  
  1340. public void actionPerformed(ActionEvent e) {
  1341. f15.setVisible(false);
  1342. f5.setVisible(true);
  1343.  
  1344.  
  1345. }
  1346. });
  1347.  
  1348.  
  1349. //update
  1350. JButton update = new JButton("Update");
  1351. update.setBounds(820,600,150,75);
  1352. update.setFont(new Font("Times New Roman",Font.BOLD,20));
  1353. update.setBackground(Color.LIGHT_GRAY);
  1354. update.setForeground(Color.BLACK);
  1355. f15.add(update);
  1356.  
  1357.  
  1358.  
  1359. //Save
  1360. JButton Save = new JButton("Save");
  1361. Save.setBounds(1000,600,150,75);
  1362. Save.setFont(new Font("Times New Roman",Font.BOLD,20));
  1363. Save.setBackground(Color.LIGHT_GRAY);
  1364. Save.setForeground(Color.BLACK);
  1365. f15.add(Save);
  1366.  
  1367. u1.addKeyListener(new KeyAdapter(){
  1368. public void keyPressed(KeyEvent w){
  1369. if(w.getKeyCode()==KeyEvent.VK_E){
  1370. u1.doClick();
  1371. }
  1372.  
  1373.  
  1374. }
  1375. });
  1376. u1.addActionListener(new ActionListener(){
  1377.  
  1378. public void actionPerformed(ActionEvent e) {
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384. f15.setVisible(true);
  1385. f5.setVisible(false);
  1386. }
  1387.  
  1388.  
  1389. });
  1390.  
  1391.  
  1392. //UPDATE FUNCTION
  1393.  
  1394. update.addKeyListener(new KeyAdapter(){
  1395. public void keyPressed(KeyEvent w){
  1396.  
  1397.  
  1398. f15.setVisible(false);
  1399. f5.setVisible(true);
  1400.  
  1401. JOptionPane.showMessageDialog(f5,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
  1402.  
  1403.  
  1404. }
  1405.  
  1406.  
  1407. });
  1408.  
  1409.  
  1410. //ADD FUNCTION
  1411. Save.addKeyListener(new KeyAdapter(){
  1412. public void keyPressed(KeyEvent w){
  1413. if(w.getKeyCode()==KeyEvent.VK_S){
  1414. Save.doClick();
  1415.  
  1416. }
  1417. }
  1418. });
  1419.  
  1420. Save.addActionListener(new ActionListener() {
  1421.  
  1422. public void actionPerformed(ActionEvent e) {
  1423. int n = JOptionPane.showConfirmDialog(
  1424. null, "Would you like to ADD This Row?",
  1425. "Are you sure?",
  1426. JOptionPane.YES_NO_OPTION);
  1427. if (n == JOptionPane.YES_OPTION){
  1428.  
  1429. try {
  1430. Connection con = DriverManager.getConnection(dburl, userdb, passdb);
  1431. 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()+"')";
  1432. Statement st = con.createStatement();
  1433. st.executeUpdate(squery);
  1434. } catch (Exception ex) {
  1435. System.out.println(ex);
  1436. System.out.println("Failed ");
  1437. }
  1438.  
  1439.  
  1440.  
  1441.  
  1442. f15.setVisible(false);
  1443. f5.setVisible(true);
  1444. JOptionPane.showMessageDialog(f5,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  1445. }
  1446.  
  1447. }
  1448. });
  1449.  
  1450. //DELETE FUNCTION
  1451.  
  1452. d1.addKeyListener(new KeyAdapter(){
  1453. public void keyPressed(KeyEvent w){
  1454. if(w.getKeyCode()==KeyEvent.VK_D){
  1455. d1.doClick();
  1456.  
  1457. }
  1458. }
  1459. });
  1460.  
  1461.  
  1462. d1.addActionListener(new ActionListener(){
  1463. public void actionPerformed(ActionEvent e) {
  1464. int n = JOptionPane.showConfirmDialog(
  1465. null, "Would you like to DELETE This Row?",
  1466. "Are you sure?",
  1467. JOptionPane.YES_NO_OPTION);
  1468.  
  1469.  
  1470.  
  1471.  
  1472. if (n == JOptionPane.YES_OPTION) {
  1473.  
  1474. JOptionPane.showMessageDialog(f5,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  1475. }
  1476. }
  1477.  
  1478.  
  1479.  
  1480. });
  1481.  
  1482.  
  1483.  
  1484.  
  1485. }
  1486. });
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495. }
  1496. });
  1497.  
  1498.  
  1499. r2.addKeyListener(new KeyAdapter(){
  1500. public void keyPressed(KeyEvent w){
  1501. if(w.getKeyCode()==KeyEvent.VK_2){
  1502. r2.doClick();
  1503. }
  1504.  
  1505.  
  1506. }
  1507. });
  1508.  
  1509. //B2
  1510. r2.addActionListener(new ActionListener() {
  1511.  
  1512. public void actionPerformed(ActionEvent e) {
  1513.  
  1514. Frame f6 = new JFrame();
  1515. f6.setVisible(true);
  1516. f4.setVisible(false);
  1517. f6.setSize(1366,768);
  1518. f6.setLayout(null);
  1519. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  1520. f6.setIconImage(icon.getImage());
  1521. f6.add(c5);
  1522. c5.setBounds(0,650,200,50);
  1523.  
  1524.  
  1525. JLabel rl2 = new JLabel("Cell Two");
  1526. rl2.setBounds(485,30,450,70);
  1527. rl2.setFont(new Font("Times new Roman",Font.BOLD,80));
  1528. rl2.setForeground(Color.WHITE);
  1529. f6.add(rl2);
  1530.  
  1531. JButton a2 = new JButton("Add");
  1532. a2.setBounds(1180,135,150,75);
  1533. a2.setFont(new Font("Times New Roman",Font.BOLD,20));
  1534. a2.setBackground(Color.LIGHT_GRAY);
  1535. a2.setForeground(Color.BLACK);
  1536. f6.add(a2);
  1537.  
  1538.  
  1539. JButton d2 = new JButton("Delete");
  1540. d2.setBounds(1000,135,150,75);
  1541. d2.setFont(new Font("Times New Roman",Font.BOLD,20));
  1542. d2.setBackground(Color.LIGHT_GRAY);
  1543. d2.setForeground(Color.BLACK);
  1544. f6.add(d2);
  1545.  
  1546. JButton u2 = new JButton("Edit");
  1547. u2.setBounds(820,135,150,75);
  1548. u2.setFont(new Font("Times New Roman",Font.BOLD,20));
  1549. u2.setBackground(Color.LIGHT_GRAY);
  1550. u2.setForeground(Color.BLACK);
  1551. f6.add(u2);
  1552.  
  1553. JPanel rp17 = new JPanel();
  1554. f6.add(rp17);
  1555. rp17.setBounds(0,0,1366,120);
  1556. rp17.setBackground(Color.BLACK);
  1557. rp17.setBorder(BorderFactory.createEtchedBorder(1));
  1558.  
  1559.  
  1560. JTable table = new JTable();
  1561. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  1562. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  1563. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  1564. DefaultTableModel model = new DefaultTableModel();
  1565. model.setColumnIdentifiers(columns);
  1566. table.setModel(model);
  1567.  
  1568.  
  1569. table.setBackground(Color.LIGHT_GRAY);
  1570. table.setForeground(Color.BLACK);
  1571. Font font =(new Font("Times New Roman",Font.BOLD,20));
  1572. table.setFont(font);
  1573. table.setRowHeight(30);
  1574.  
  1575. //JScrollPane
  1576. JScrollPane pane = new JScrollPane(table);
  1577. pane.setBounds(0,230,1366,350);
  1578. f6.add(pane);
  1579.  
  1580.  
  1581.  
  1582. JButton Back = new JButton("Back");
  1583. Back.setBounds(1180,600,150,75);
  1584. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  1585. Back.setBackground(Color.LIGHT_GRAY);
  1586. Back.setForeground(Color.BLACK);
  1587. f6.add(Back);
  1588.  
  1589. Back.addKeyListener(new KeyAdapter(){
  1590. public void keyPressed(KeyEvent w){
  1591. if(w.getKeyCode()==KeyEvent.VK_B){
  1592. Back.doClick();
  1593. }
  1594.  
  1595.  
  1596. }
  1597. });
  1598.  
  1599. Back.addActionListener(new ActionListener() {
  1600.  
  1601. public void actionPerformed(ActionEvent e) {
  1602. f6.setVisible(false);
  1603. f4.setVisible(true);
  1604.  
  1605.  
  1606. }
  1607. });
  1608. a2.addKeyListener(new KeyAdapter(){
  1609. public void keyPressed(KeyEvent w){
  1610. if(w.getKeyCode()==KeyEvent.VK_A){
  1611. a2.doClick();
  1612. }
  1613.  
  1614.  
  1615. }
  1616. });
  1617.  
  1618. //ADD-2
  1619.  
  1620. a2.addActionListener(new ActionListener() {
  1621.  
  1622. public void actionPerformed(ActionEvent e) {
  1623.  
  1624. Frame f16 = new JFrame();
  1625. f16.setVisible(true);
  1626. f6.setVisible(false);
  1627. f16.setSize(1366,768);
  1628. f16.setLayout(null);
  1629. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  1630. f16.setIconImage(icon.getImage());
  1631. f16.add(c5);
  1632. c5.setBounds(0,650,200,50);
  1633.  
  1634.  
  1635.  
  1636. JPanel rp17 = new JPanel();
  1637. rp17.setBounds(0,0,1366,120);
  1638. rp17.setBackground(Color.BLACK);
  1639. rp17.setBorder(BorderFactory.createEtchedBorder(1));
  1640. f16.add(rp17);
  1641.  
  1642.  
  1643. JLabel rl6 = new JLabel("Prisoner Fill Up Form");
  1644. rl6.setBounds(485,30,450,70);
  1645. rl6.setFont(new Font("Times new Roman",Font.BOLD,80));
  1646. rl6.setForeground(Color.WHITE);
  1647. rp17.add(rl6);
  1648. JPanel rp27 = new JPanel();
  1649. rp27.setBounds(12,130,1325,450);
  1650. rp27.setBackground(Color.BLACK);
  1651. rp27.setBorder(BorderFactory.createEtchedBorder());
  1652. f16.add(rp27);
  1653.  
  1654. JLabel r141 = new JLabel();
  1655. r141.setBounds(15,15,130,130);
  1656. r141.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
  1657. rp27.add(r141);
  1658.  
  1659.  
  1660.  
  1661. //Prisoner aydi:
  1662.  
  1663. JLabel r142 = new JLabel ("FIRSTNAME:");
  1664. r142.setBounds(183,40,200,50);
  1665. r142.setFont(new Font("Times new Roman",Font.BOLD,20));
  1666. r142.setForeground(Color.WHITE);
  1667. JTextField tf117 = new JTextField ();
  1668. tf117.setBounds(180,85,210,30);
  1669. rp27.add(tf117);
  1670. rp27.add(r142);
  1671. JLabel r143 = new JLabel ("MI:");
  1672. r143.setBounds(413,40,200,50);
  1673. r143.setFont(new Font("Times new Roman",Font.BOLD,20));
  1674. r143.setForeground(Color.WHITE);
  1675. JTextField tf118 = new JTextField ();
  1676. tf118.setBounds(410,85,80,30);
  1677. rp27.add(tf118);
  1678. rp27.add(r143);
  1679. JLabel r144 = new JLabel ("LASTNAME:");
  1680. r144.setBounds(518,40,200,50);
  1681. r144.setFont(new Font("Times new Roman",Font.BOLD,20));
  1682. r144.setForeground(Color.WHITE);
  1683. JTextField tf119 = new JTextField ();
  1684. tf119.setBounds(515,85,210,30);
  1685. rp27.add(tf119);
  1686. rp27.add(r144);
  1687. JLabel r145 = new JLabel ("SEX:");
  1688. r145.setBounds(751,40,200,50);
  1689. r145.setFont(new Font("Times new Roman",Font.BOLD,20));
  1690. r145.setForeground(Color.WHITE);
  1691. JTextField tf120 = new JTextField ();
  1692. tf120.setBounds(750,85,90,30);
  1693. rp27.add(tf120);
  1694. rp27.add(r145);
  1695. JLabel r146 = new JLabel ("AGE:");
  1696. r146.setBounds(861,40,200,50);
  1697. r146.setFont(new Font("Times new Roman",Font.BOLD,20));
  1698. r146.setForeground(Color.WHITE);
  1699. JTextField tf121 = new JTextField ();
  1700. tf121.setBounds(860,85,60,30);
  1701. rp27.add(tf121);
  1702. rp27.add(r146);
  1703. JLabel r147 = new JLabel ("ADDRESS:");
  1704. r147.setBounds(951,40,200,50);
  1705. r147.setFont(new Font("Times new Roman",Font.BOLD,20));
  1706. r147.setForeground(Color.WHITE);
  1707. JTextField tf122 = new JTextField ();
  1708. tf122.setBounds(950,85,355,30);
  1709. rp27.add(tf122);
  1710. rp27.add(r147);
  1711. JLabel r148 = new JLabel ("DATE OF BIRTH:");
  1712. r148.setBounds(17,150,200,50);
  1713. r148.setFont(new Font("Times new Roman",Font.BOLD,20));
  1714. r148.setForeground(Color.WHITE);
  1715. JTextField tf123 = new JTextField ();
  1716. tf123.setBounds(15,195,210,30);
  1717. rp27.add(tf123);
  1718. rp27.add(r148);
  1719. JLabel r149 = new JLabel ("NATIONALITY:");
  1720. r149.setBounds(247,150,200,50);
  1721. r149.setFont(new Font("Times new Roman",Font.BOLD,20));
  1722. r149.setForeground(Color.WHITE);
  1723. JTextField tf124 = new JTextField ();
  1724. tf124.setBounds(245,195,210,30);
  1725. rp27.add(tf124);
  1726. rp27.add(r149);
  1727. JLabel r150 = new JLabel ("HEIGHT:");
  1728. r150.setBounds(482,150,200,50);
  1729. r150.setFont(new Font("Times new Roman",Font.BOLD,20));
  1730. r150.setForeground(Color.WHITE);
  1731. JTextField tf125 = new JTextField ();
  1732. tf125.setBounds(480,195,120,30);
  1733. rp27.add(tf125);
  1734. rp27.add(r150);
  1735. JLabel r151 = new JLabel ("WEIGHT:");
  1736. r151.setBounds(636,150,200,50);
  1737. r151.setFont(new Font("Times new Roman",Font.BOLD,20));
  1738. r151.setForeground(Color.WHITE);
  1739. JTextField tf126 = new JTextField ();
  1740. tf126.setBounds(630,195,120,30);
  1741. rp27.add(tf126);
  1742. rp27.add(r151);
  1743. JLabel r152 = new JLabel ("EYE COLOR:");
  1744. r152.setBounds(787,150,200,50);
  1745. r152.setFont(new Font("Times new Roman",Font.BOLD,20));
  1746. r152.setForeground(Color.WHITE);
  1747. JTextField tf127 = new JTextField ();
  1748. tf127.setBounds(785 ,195,190,30);
  1749. rp27.add(tf127);
  1750. rp27.add(r152);
  1751. JLabel r153 = new JLabel ("PHONE NUMBER:");
  1752. r153.setBounds(997,150,200,50);
  1753. r153.setFont(new Font("Times new Roman",Font.BOLD,20));
  1754. r153.setForeground(Color.WHITE);
  1755. JTextField tf128 = new JTextField ();
  1756. tf128.setBounds(995,195,310,30);
  1757. rp27.add(tf128);
  1758. rp27.add(r153);
  1759. JLabel r154 = new JLabel ("LANGUAGE:");
  1760. r154.setBounds(16,250,200,50);
  1761. r154.setFont(new Font("Times new Roman",Font.BOLD,20));
  1762. r154.setForeground(Color.WHITE);
  1763. JTextField tf129 = new JTextField ();
  1764. tf129.setBounds(15,295,210,30);
  1765. rp27.add(tf129);
  1766. rp27.add(r154);
  1767. JLabel r155 = new JLabel ("DATE OF CAPTURE:");
  1768. r155.setBounds(247,250,200,50);
  1769. r155.setFont(new Font("Times new Roman",Font.BOLD,20));
  1770. r155.setForeground(Color.WHITE);
  1771. JTextField tf130 = new JTextField ();
  1772. tf130.setBounds(245,295,210,30);
  1773. rp27.add(tf130);
  1774. rp27.add(r155);
  1775. JLabel r156 = new JLabel ("PLACE OF CAPTURE:");
  1776. r156.setBounds(482,250,220,50);
  1777. r156.setFont(new Font("Times new Roman",Font.BOLD,20));
  1778. r156.setForeground(Color.WHITE);
  1779. JTextField tf131 = new JTextField ();
  1780. tf131.setBounds(480,295,320,30);
  1781. rp27.add(tf131);
  1782. rp27.add(r156);
  1783. JLabel r157 = new JLabel ("CIVILLIAN OCCUPATION:");
  1784. r157.setBounds(827,250,270,50);
  1785. r157.setFont(new Font("Times new Roman",Font.BOLD,20));
  1786. r157.setForeground(Color.WHITE);
  1787. JTextField tf132 = new JTextField ();
  1788. tf132.setBounds(825,295,480,30);
  1789. rp27.add(tf132);
  1790. rp27.add(r157);
  1791. JLabel r158 = new JLabel ("PHYSICAL CONDITION:");
  1792. r158.setBounds(16,350,260,50);
  1793. r158.setFont(new Font("Times new Roman",Font.BOLD,20));
  1794. r158.setForeground(Color.WHITE);
  1795. JTextField tf133 = new JTextField ();
  1796. tf133.setBounds(15,395,260,30);
  1797. rp27.add(tf133);
  1798. rp27.add(r158);
  1799. JLabel r159 = new JLabel ("DAYS IN JAIL:");
  1800. r159.setBounds(302,350,250,50);
  1801. r159.setFont(new Font("Times new Roman",Font.BOLD,20));
  1802. r159.setForeground(Color.WHITE);
  1803. JTextField tf134 = new JTextField ();
  1804. tf134.setBounds(300,395,180,30);
  1805. rp27.add(tf134);
  1806. rp27.add(r159);
  1807. JLabel r160 = new JLabel ("ARRIVAL OF PRISONER:");
  1808. r160.setBounds(502,350,280,50);
  1809. r160.setFont(new Font("Times new Roman",Font.BOLD,20));
  1810. r160.setForeground(Color.WHITE);
  1811. JTextField tf135 = new JTextField ();
  1812. tf135.setBounds(500,395,280,30);
  1813. rp27.add(tf135);
  1814. rp27.add(r160);
  1815. JLabel r161 = new JLabel ("DATE/TIME:");
  1816. r161.setBounds(802,350,250,50);
  1817. r161.setFont(new Font("Times new Roman",Font.BOLD,20));
  1818. r161.setForeground(Color.WHITE);
  1819. JTextField tf136 = new JTextField ();
  1820. tf136.setBounds(800,395,150,30);
  1821. rp27.add(tf136);
  1822. rp27.add(r161);
  1823. JLabel r162 = new JLabel ("ARRIVAL OFFICER:");
  1824. r162.setBounds(972,350,250,50);
  1825. r162.setFont(new Font("Times new Roman",Font.BOLD,20));
  1826. r162.setForeground(Color.WHITE);
  1827. JTextField tf137 = new JTextField ();
  1828. tf137.setBounds(970,395,335,30);
  1829. rp27.add(tf137);
  1830. rp27.add(r162);
  1831. rp27.setLayout(null);
  1832.  
  1833.  
  1834. JButton Back = new JButton("Back");
  1835. Back.setBounds(1180,600,150,75);
  1836. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  1837. Back.setBackground(Color.LIGHT_GRAY);
  1838. Back.setForeground(Color.BLACK);
  1839. f16.add(Back);
  1840.  
  1841.  
  1842.  
  1843. Back.addActionListener(new ActionListener() {
  1844.  
  1845. public void actionPerformed(ActionEvent e) {
  1846. f16.setVisible(false);
  1847. f6.setVisible(true);
  1848.  
  1849.  
  1850. }
  1851. });
  1852.  
  1853. //update
  1854. JButton update = new JButton("Update");
  1855. update.setBounds(820,600,150,75);
  1856. update.setFont(new Font("Times New Roman",Font.BOLD,20));
  1857. update.setBackground(Color.LIGHT_GRAY);
  1858. update.setForeground(Color.BLACK);
  1859. f16.add(update);
  1860.  
  1861.  
  1862.  
  1863. //Save
  1864. JButton Save = new JButton("Save");
  1865. Save.setBounds(1000,600,150,75);
  1866. Save.setFont(new Font("Times New Roman",Font.BOLD,20));
  1867. Save.setBackground(Color.LIGHT_GRAY);
  1868. Save.setForeground(Color.BLACK);
  1869. f16.add(Save);
  1870.  
  1871.  
  1872. u2.addKeyListener(new KeyAdapter(){
  1873. public void keyPressed(KeyEvent w){
  1874. if(w.getKeyCode()==KeyEvent.VK_E){
  1875. u2.doClick();
  1876. }
  1877.  
  1878.  
  1879. }
  1880. });
  1881. u2.addActionListener(new ActionListener() {
  1882.  
  1883. public void actionPerformed(ActionEvent e) {
  1884.  
  1885.  
  1886.  
  1887.  
  1888. f16.setVisible(true);
  1889. f6.setVisible(false);
  1890.  
  1891.  
  1892.  
  1893. }
  1894. });
  1895.  
  1896.  
  1897. //UPDATE FUNCTION
  1898. update.addKeyListener(new KeyAdapter(){
  1899. public void keyPressed(KeyEvent w){
  1900. if(w.getKeyCode()==KeyEvent.VK_U){
  1901. update.doClick();
  1902. }
  1903.  
  1904.  
  1905. }
  1906. });
  1907. update.addActionListener(new ActionListener(){
  1908. public void actionPerformed(ActionEvent e) {
  1909. int n = JOptionPane.showConfirmDialog(
  1910. null, "Would you like to UPDATE This Row?",
  1911. "Are you sure?",
  1912. JOptionPane.YES_NO_OPTION);
  1913. if (n == JOptionPane.YES_OPTION){
  1914.  
  1915. f16.setVisible(false);
  1916. f6.setVisible(true);
  1917.  
  1918. JOptionPane.showMessageDialog(f6,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
  1919.  
  1920.  
  1921. }
  1922.  
  1923.  
  1924. }
  1925. });
  1926.  
  1927.  
  1928. //ADD FUNCTION
  1929.  
  1930. Save.addKeyListener(new KeyAdapter(){
  1931. public void keyPressed(KeyEvent w){
  1932. if(w.getKeyCode()==KeyEvent.VK_S){
  1933. Save.doClick();
  1934. }
  1935.  
  1936.  
  1937. }
  1938. });
  1939. Save.addActionListener(new ActionListener() {
  1940.  
  1941. public void actionPerformed(ActionEvent e) {
  1942. int n = JOptionPane.showConfirmDialog(
  1943. null, "Would you like to ADD This Row?",
  1944. "Are you sure?",
  1945. JOptionPane.YES_NO_OPTION);
  1946. if (n == JOptionPane.YES_OPTION){
  1947.  
  1948.  
  1949.  
  1950.  
  1951. f16.setVisible(false);
  1952. f6.setVisible(true);
  1953.  
  1954. JOptionPane.showMessageDialog(f6,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  1955. }
  1956.  
  1957. }
  1958. });
  1959.  
  1960. //DELETE FUNCTION
  1961. d2.addKeyListener(new KeyAdapter(){
  1962. public void keyPressed(KeyEvent w){
  1963. if(w.getKeyCode()==KeyEvent.VK_D){
  1964. d2.doClick();
  1965. }
  1966.  
  1967.  
  1968. }
  1969. });
  1970. d2.addActionListener(new ActionListener(){
  1971. public void actionPerformed(ActionEvent e) {
  1972. int n = JOptionPane.showConfirmDialog(
  1973. null, "Would you like to DELETE This Row?",
  1974. "Are you sure?",
  1975. JOptionPane.YES_NO_OPTION);
  1976. if (n == JOptionPane.YES_OPTION) {
  1977.  
  1978.  
  1979. JOptionPane.showMessageDialog(f6,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  1980. }
  1981. }
  1982.  
  1983.  
  1984.  
  1985. });
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991. }
  1992. });
  1993.  
  1994. }
  1995. });
  1996.  
  1997. //B3
  1998. r3.addKeyListener(new KeyAdapter(){
  1999. public void keyPressed(KeyEvent w){
  2000. if(w.getKeyCode()==KeyEvent.VK_3){
  2001. r3.doClick();
  2002. }
  2003.  
  2004.  
  2005. }
  2006. });
  2007. r3.addActionListener(new ActionListener() {
  2008.  
  2009. public void actionPerformed(ActionEvent e) {
  2010.  
  2011.  
  2012.  
  2013. Frame f7 = new JFrame();
  2014. f7.setVisible(true);
  2015. f4.setVisible(false);
  2016. f7.setSize(1366,768);
  2017. f7.setLayout(null);
  2018. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  2019. f7.setIconImage(icon.getImage());
  2020. f7.add(c5);
  2021. c5.setBounds(0,650,200,50);
  2022.  
  2023.  
  2024.  
  2025. JLabel rl3 = new JLabel("Cell Three");
  2026. rl3.setBounds(485,30,450,70);
  2027. rl3.setFont(new Font("Times new Roman",Font.BOLD,80));
  2028. rl3.setForeground(Color.WHITE);
  2029. f7.add(rl3);
  2030.  
  2031. JButton a3 = new JButton("Add");
  2032. a3.setBounds(1180,135,150,75);
  2033. a3.setFont(new Font("Times New Roman",Font.BOLD,20));
  2034. a3.setBackground(Color.LIGHT_GRAY);
  2035. a3.setForeground(Color.BLACK);
  2036. f7.add(a3);
  2037.  
  2038. JButton d3 = new JButton("Delete");
  2039. d3.setBounds(1000,135,150,75);
  2040. d3.setFont(new Font("Times New Roman",Font.BOLD,20));
  2041. d3.setBackground(Color.LIGHT_GRAY);
  2042. d3.setForeground(Color.BLACK);
  2043. f7.add(d3);
  2044.  
  2045. JButton u3 = new JButton("Edit");
  2046. u3.setBounds(820,135,150,75);
  2047. u3.setFont(new Font("Times New Roman",Font.BOLD,20));
  2048. u3.setBackground(Color.LIGHT_GRAY);
  2049. u3.setForeground(Color.BLACK);
  2050. f7.add(u3);
  2051.  
  2052. JPanel rp3 = new JPanel();
  2053. f7.add(rp3);
  2054. rp3.setBounds(0,0,1366,120);
  2055. rp3.setBackground(Color.BLACK);
  2056. rp3.setBorder(BorderFactory.createEtchedBorder(1));
  2057.  
  2058.  
  2059. JTable table = new JTable();
  2060. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  2061. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  2062. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  2063. DefaultTableModel model = new DefaultTableModel();
  2064. model.setColumnIdentifiers(columns);
  2065. table.setModel(model);
  2066.  
  2067.  
  2068. table.setBackground(Color.LIGHT_GRAY);
  2069. table.setForeground(Color.BLACK);
  2070. Font font =(new Font("Times New Roman",Font.BOLD,20));
  2071. table.setFont(font);
  2072. table.setRowHeight(30);
  2073.  
  2074. //JScrollPane
  2075. JScrollPane pane = new JScrollPane(table);
  2076. pane.setBounds(0,230,1366,350);
  2077. f7.add(pane);
  2078.  
  2079.  
  2080.  
  2081. JButton Back = new JButton("Back");
  2082. Back.setBounds(1180,600,150,75);
  2083. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  2084. Back.setBackground(Color.LIGHT_GRAY);
  2085. Back.setForeground(Color.BLACK);
  2086. f7.add(Back);
  2087.  
  2088. Back.addKeyListener(new KeyAdapter(){
  2089. public void keyPressed(KeyEvent w){
  2090. if(w.getKeyCode()==KeyEvent.VK_B){
  2091. Back.doClick();
  2092. }
  2093. }
  2094. });
  2095.  
  2096. Back.addActionListener(new ActionListener() {
  2097.  
  2098. public void actionPerformed(ActionEvent e) {
  2099. f7.setVisible(false);
  2100. f4.setVisible(true);
  2101.  
  2102.  
  2103. }
  2104. });
  2105.  
  2106. //ADD-3
  2107.  
  2108. a3.addKeyListener(new KeyAdapter(){
  2109. public void keyPressed(KeyEvent w){
  2110. if(w.getKeyCode()==KeyEvent.VK_A){
  2111. a3.doClick();
  2112. }
  2113.  
  2114.  
  2115. }
  2116. });
  2117.  
  2118. a3.addActionListener(new ActionListener() {
  2119.  
  2120. public void actionPerformed(ActionEvent e) {
  2121.  
  2122. Frame f17 = new JFrame();
  2123. f17.setVisible(true);
  2124. f7.setVisible(false);
  2125. f17.setSize(1366,768);
  2126. f17.setLayout(null);
  2127. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  2128. f17.setIconImage(icon.getImage());
  2129. f17.add(c5);
  2130. c5.setBounds(0,650,200,50);
  2131.  
  2132.  
  2133.  
  2134. JPanel rp18 = new JPanel();
  2135. rp18.setBounds(0,0,1366,120);
  2136. rp18.setBackground(Color.BLACK);
  2137. rp18.setBorder(BorderFactory.createEtchedBorder(1));
  2138. f17.add(rp18);
  2139.  
  2140.  
  2141. JLabel rl7 = new JLabel("Prisoner Fill Up Form");
  2142. rl7.setBounds(485,30,450,70);
  2143. rl7.setFont(new Font("Times new Roman",Font.BOLD,80));
  2144. rl7.setForeground(Color.WHITE);
  2145. rp18.add(rl7);
  2146. JPanel rp28 = new JPanel();
  2147. rp28.setBounds(12,130,1325,450);
  2148. rp28.setBackground(Color.BLACK);
  2149. rp28.setBorder(BorderFactory.createEtchedBorder());
  2150. f17.add(rp28);
  2151.  
  2152. JLabel r140 = new JLabel();
  2153. r140.setBounds(15,15,130,130);
  2154. r140.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
  2155. rp28.add(r140);
  2156.  
  2157.  
  2158.  
  2159. //Prisoner aydi:
  2160.  
  2161. JLabel r163 = new JLabel ("FIRSTNAME:");
  2162. r163.setBounds(183,40,200,50);
  2163. r163.setFont(new Font("Times new Roman",Font.BOLD,20));
  2164. r163.setForeground(Color.WHITE);
  2165. JTextField tf138 = new JTextField ();
  2166. tf138.setBounds(180,85,210,30);
  2167. rp28.add(tf138);
  2168. rp28.add(r163);
  2169. JLabel r164 = new JLabel ("MI:");
  2170. r164.setBounds(413,40,200,50);
  2171. r164.setFont(new Font("Times new Roman",Font.BOLD,20));
  2172. r164.setForeground(Color.WHITE);
  2173. JTextField tf139 = new JTextField ();
  2174. tf139.setBounds(410,85,80,30);
  2175. rp28.add(tf139);
  2176. rp28.add(r164);
  2177. JLabel r165 = new JLabel ("LASTNAME:");
  2178. r165.setBounds(518,40,200,50);
  2179. r165.setFont(new Font("Times new Roman",Font.BOLD,20));
  2180. r165.setForeground(Color.WHITE);
  2181. JTextField tf140 = new JTextField ();
  2182. tf140.setBounds(515,85,210,30);
  2183. rp28.add(tf140);
  2184. rp28.add(r165);
  2185. JLabel r166 = new JLabel ("SEX:");
  2186. r166.setBounds(751,40,200,50);
  2187. r166.setFont(new Font("Times new Roman",Font.BOLD,20));
  2188. r166.setForeground(Color.WHITE);
  2189. JTextField tf141 = new JTextField ();
  2190. tf141.setBounds(750,85,90,30);
  2191. rp28.add(tf141);
  2192. rp28.add(r166);
  2193. JLabel r167 = new JLabel ("AGE:");
  2194. r167.setBounds(861,40,200,50);
  2195. r167.setFont(new Font("Times new Roman",Font.BOLD,20));
  2196. r167.setForeground(Color.WHITE);
  2197. JTextField tf142 = new JTextField ();
  2198. tf142.setBounds(860,85,60,30);
  2199. rp28.add(tf142);
  2200. rp28.add(r167);
  2201. JLabel r168 = new JLabel ("ADDRESS:");
  2202. r168.setBounds(951,40,200,50);
  2203. r168.setFont(new Font("Times new Roman",Font.BOLD,20));
  2204. r168.setForeground(Color.WHITE);
  2205. JTextField tf143 = new JTextField ();
  2206. tf143.setBounds(950,85,355,30);
  2207. rp28.add(tf143);
  2208. rp28.add(r168);
  2209. JLabel r169 = new JLabel ("DATE OF BIRTH:");
  2210. r169.setBounds(17,150,200,50);
  2211. r169.setFont(new Font("Times new Roman",Font.BOLD,20));
  2212. r169.setForeground(Color.WHITE);
  2213. JTextField tf144 = new JTextField ();
  2214. tf144.setBounds(15,195,210,30);
  2215. rp28.add(tf144);
  2216. rp28.add(r169);
  2217. JLabel r170 = new JLabel ("NATIONALITY:");
  2218. r170.setBounds(247,150,200,50);
  2219. r170.setFont(new Font("Times new Roman",Font.BOLD,20));
  2220. r170.setForeground(Color.WHITE);
  2221. JTextField tf145 = new JTextField ();
  2222. tf145.setBounds(245,195,210,30);
  2223. rp28.add(tf145);
  2224. rp28.add(r170);
  2225. JLabel r171 = new JLabel ("HEIGHT:");
  2226. r171.setBounds(482,150,200,50);
  2227. r171.setFont(new Font("Times new Roman",Font.BOLD,20));
  2228. r171.setForeground(Color.WHITE);
  2229. JTextField tf146 = new JTextField ();
  2230. tf146.setBounds(480,195,120,30);
  2231. rp28.add(tf146);
  2232. rp28.add(r171);
  2233. JLabel r172 = new JLabel ("WEIGHT:");
  2234. r172.setBounds(636,150,200,50);
  2235. r172.setFont(new Font("Times new Roman",Font.BOLD,20));
  2236. r172.setForeground(Color.WHITE);
  2237. JTextField tf147 = new JTextField ();
  2238. tf147.setBounds(630,195,120,30);
  2239. rp28.add(tf147);
  2240. rp28.add(r172);
  2241. JLabel r173 = new JLabel ("EYE COLOR:");
  2242. r173.setBounds(787,150,200,50);
  2243. r173.setFont(new Font("Times new Roman",Font.BOLD,20));
  2244. r173.setForeground(Color.WHITE);
  2245. JTextField tf148 = new JTextField ();
  2246. tf148.setBounds(785 ,195,190,30);
  2247. rp28.add(tf148);
  2248. rp28.add(r173);
  2249. JLabel r174 = new JLabel ("PHONE NUMBER:");
  2250. r174.setBounds(997,150,200,50);
  2251. r174.setFont(new Font("Times new Roman",Font.BOLD,20));
  2252. r174.setForeground(Color.WHITE);
  2253. JTextField tf149 = new JTextField ();
  2254. tf149.setBounds(995,195,310,30);
  2255. rp28.add(tf149);
  2256. rp28.add(r174);
  2257. JLabel r175 = new JLabel ("LANGUAGE:");
  2258. r175.setBounds(16,250,200,50);
  2259. r175.setFont(new Font("Times new Roman",Font.BOLD,20));
  2260. r175.setForeground(Color.WHITE);
  2261. JTextField tf150 = new JTextField ();
  2262. tf150.setBounds(15,295,210,30);
  2263. rp28.add(tf150);
  2264. rp28.add(r175);
  2265. JLabel r176 = new JLabel ("DATE OF CAPTURE:");
  2266. r176.setBounds(247,250,200,50);
  2267. r176.setFont(new Font("Times new Roman",Font.BOLD,20));
  2268. r176.setForeground(Color.WHITE);
  2269. JTextField tf151 = new JTextField ();
  2270. tf151.setBounds(245,295,210,30);
  2271. rp28.add(tf151);
  2272. rp28.add(r176);
  2273. JLabel r177 = new JLabel ("PLACE OF CAPTURE:");
  2274. r177.setBounds(482,250,220,50);
  2275. r177.setFont(new Font("Times new Roman",Font.BOLD,20));
  2276. r177.setForeground(Color.WHITE);
  2277. JTextField tf152 = new JTextField ();
  2278. tf152.setBounds(480,295,320,30);
  2279. rp28.add(tf152);
  2280. rp28.add(r177);
  2281. JLabel r178 = new JLabel ("CIVILLIAN OCCUPATION:");
  2282. r178.setBounds(827,250,270,50);
  2283. r178.setFont(new Font("Times new Roman",Font.BOLD,20));
  2284. r178.setForeground(Color.WHITE);
  2285. JTextField tf153 = new JTextField ();
  2286. tf153.setBounds(825,295,480,30);
  2287. rp28.add(tf153);
  2288. rp28.add(r178);
  2289. JLabel r179 = new JLabel ("PHYSICAL CONDITION:");
  2290. r179.setBounds(16,350,260,50);
  2291. r179.setFont(new Font("Times new Roman",Font.BOLD,20));
  2292. r179.setForeground(Color.WHITE);
  2293. JTextField tf154 = new JTextField ();
  2294. tf154.setBounds(15,395,260,30);
  2295. rp28.add(tf154);
  2296. rp28.add(r179);
  2297. JLabel r180 = new JLabel ("DAYS IN JAIL:");
  2298. r180.setBounds(302,350,250,50);
  2299. r180.setFont(new Font("Times new Roman",Font.BOLD,20));
  2300. r180.setForeground(Color.WHITE);
  2301. JTextField tf155 = new JTextField ();
  2302. tf155.setBounds(300,395,180,30);
  2303. rp28.add(tf155);
  2304. rp28.add(r180);
  2305. JLabel r181 = new JLabel ("ARRIVAL OF PRISONER:");
  2306. r181.setBounds(502,350,280,50);
  2307. r181.setFont(new Font("Times new Roman",Font.BOLD,20));
  2308. r181.setForeground(Color.WHITE);
  2309. JTextField tf156 = new JTextField ();
  2310. tf156.setBounds(500,395,280,30);
  2311. rp28.add(tf156);
  2312. rp28.add(r181);
  2313. JLabel r182 = new JLabel ("DATE/TIME:");
  2314. r182.setBounds(802,350,250,50);
  2315. r182.setFont(new Font("Times new Roman",Font.BOLD,20));
  2316. r182.setForeground(Color.WHITE);
  2317. JTextField tf157 = new JTextField ();
  2318. tf157.setBounds(800,395,150,30);
  2319. rp28.add(tf157);
  2320. rp28.add(r182);
  2321. JLabel r183 = new JLabel ("ARRIVAL OFFICER:");
  2322. r183.setBounds(972,350,250,50);
  2323. r183.setFont(new Font("Times new Roman",Font.BOLD,20));
  2324. r183.setForeground(Color.WHITE);
  2325. JTextField tf158 = new JTextField ();
  2326. tf158.setBounds(970,395,335,30);
  2327. rp28.add(tf158);
  2328. rp28.add(r183);
  2329. rp28.setLayout(null);
  2330.  
  2331.  
  2332. JButton Back = new JButton("Back");
  2333. Back.setBounds(1180,600,150,75);
  2334. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  2335.  
  2336. f17.add(Back);
  2337. Back.setBackground(Color.LIGHT_GRAY);
  2338. Back.setForeground(Color.BLACK);
  2339. Back.addKeyListener(new KeyAdapter(){
  2340. public void keyPressed(KeyEvent w){
  2341. if(w.getKeyCode()==KeyEvent.VK_B){
  2342. Back.doClick();
  2343. }
  2344. }
  2345. });
  2346. Back.addActionListener(new ActionListener() {
  2347.  
  2348. public void actionPerformed(ActionEvent e) {
  2349. f17.setVisible(false);
  2350. f7.setVisible(true);
  2351.  
  2352.  
  2353. }
  2354. });
  2355.  
  2356. //update
  2357. JButton update = new JButton("Update");
  2358. update.setBounds(820,600,150,75);
  2359. update.setFont(new Font("Times New Roman",Font.BOLD,20));
  2360. update.setBackground(Color.LIGHT_GRAY);
  2361. update.setForeground(Color.BLACK);
  2362. f17.add(update);
  2363.  
  2364.  
  2365.  
  2366. //Save
  2367. JButton Save = new JButton("Save");
  2368. Save.setBounds(1000,600,150,75);
  2369. Save.setFont(new Font("Times New Roman",Font.BOLD,20));
  2370. Save.setBackground(Color.LIGHT_GRAY);
  2371. Save.setForeground(Color.BLACK);
  2372. f17.add(Save);
  2373.  
  2374. u3.addKeyListener(new KeyAdapter(){
  2375. public void keyPressed(KeyEvent w){
  2376. if(w.getKeyCode()==KeyEvent.VK_E){
  2377. u3.doClick();
  2378. }
  2379.  
  2380.  
  2381. }
  2382. });
  2383. u3.addActionListener(new ActionListener() {
  2384.  
  2385. public void actionPerformed(ActionEvent e) {
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391. f17.setVisible(true);
  2392. f7.setVisible(false);
  2393.  
  2394.  
  2395.  
  2396. }
  2397. });
  2398.  
  2399. //UPDATE FUNCTION
  2400.  
  2401. update.addKeyListener(new KeyAdapter(){
  2402. public void keyPressed(KeyEvent w){
  2403. if(w.getKeyCode()==KeyEvent.VK_U){
  2404. update.doClick();
  2405. }
  2406.  
  2407.  
  2408. }
  2409. });
  2410.  
  2411. update.addActionListener(new ActionListener(){
  2412. public void actionPerformed(ActionEvent e) {
  2413. int n = JOptionPane.showConfirmDialog(
  2414. null, "Would you like to UPDATE This Row?",
  2415. "Are you sure?",
  2416. JOptionPane.YES_NO_OPTION);
  2417. if (n == JOptionPane.YES_OPTION){
  2418.  
  2419. f17.setVisible(false);
  2420. f7.setVisible(true);
  2421.  
  2422. JOptionPane.showMessageDialog(f7,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
  2423.  
  2424.  
  2425.  
  2426. }
  2427.  
  2428. }
  2429. });
  2430.  
  2431.  
  2432. //ADD FUNCTION
  2433.  
  2434. Save.addKeyListener(new KeyAdapter(){
  2435. public void keyPressed(KeyEvent w){
  2436. if(w.getKeyCode()==KeyEvent.VK_S){
  2437. Save.doClick();
  2438. }
  2439.  
  2440.  
  2441. }
  2442. });
  2443. Save.addActionListener(new ActionListener() {
  2444.  
  2445. public void actionPerformed(ActionEvent e) {
  2446. int n = JOptionPane.showConfirmDialog(
  2447. null, "Would you like to ADD This Row?",
  2448. "Are you sure?",
  2449. JOptionPane.YES_NO_OPTION);
  2450. if (n == JOptionPane.YES_OPTION){
  2451.  
  2452.  
  2453.  
  2454.  
  2455. JOptionPane.showMessageDialog(f7,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  2456.  
  2457. f17.setVisible(false);
  2458. f7.setVisible(true);
  2459. }
  2460.  
  2461. }
  2462. });
  2463.  
  2464. //DELETE FUNCTION
  2465. d3.addKeyListener(new KeyAdapter(){
  2466. public void keyPressed(KeyEvent w){
  2467. if(w.getKeyCode()==KeyEvent.VK_D){
  2468. d3.doClick();
  2469. }
  2470.  
  2471.  
  2472. }
  2473. });
  2474. d3.addActionListener(new ActionListener(){
  2475. public void actionPerformed(ActionEvent e) {
  2476. int n = JOptionPane.showConfirmDialog(
  2477. null, "Would you like to DELETE This Row?",
  2478. "Are you sure?",
  2479. JOptionPane.YES_NO_OPTION);
  2480. if (n == JOptionPane.YES_OPTION) {
  2481.  
  2482.  
  2483. JOptionPane.showMessageDialog(f7,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  2484. }
  2485. }
  2486.  
  2487.  
  2488.  
  2489. });
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495. }
  2496. });
  2497.  
  2498. }
  2499. });
  2500.  
  2501. //B4
  2502. r4.addKeyListener(new KeyAdapter(){
  2503. public void keyPressed(KeyEvent w){
  2504. if(w.getKeyCode()==KeyEvent.VK_4){
  2505. r4.doClick();
  2506. }
  2507.  
  2508.  
  2509. }
  2510. });
  2511.  
  2512. r4.addActionListener(new ActionListener() {
  2513.  
  2514. public void actionPerformed(ActionEvent e) {
  2515.  
  2516. Frame f8 = new JFrame();
  2517. f8.setVisible(true);
  2518. f4.setVisible(false);
  2519. f8.setSize(1366,768);
  2520. f8.setLayout(null);
  2521. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  2522. f8.setIconImage(icon.getImage());
  2523. f8.add(c5);
  2524. c5.setBounds(0,650,200,50);
  2525.  
  2526.  
  2527.  
  2528. JLabel rl4 = new JLabel("Cell Four");
  2529. rl4.setBounds(485,30,450,70);
  2530. rl4.setFont(new Font("Times new Roman",Font.BOLD,80));
  2531. rl4.setForeground(Color.WHITE);
  2532. f8.add(rl4);
  2533.  
  2534. JButton a4 = new JButton("Add");
  2535. a4.setBounds(1180,135,150,75);
  2536. a4.setFont(new Font("Times New Roman",Font.BOLD,20));
  2537. a4.setBackground(Color.LIGHT_GRAY);
  2538. a4.setForeground(Color.BLACK);
  2539. f8.add(a4);
  2540.  
  2541. JButton d4 = new JButton("Delete");
  2542. d4.setBounds(1000,135,150,75);
  2543. d4.setFont(new Font("Times New Roman",Font.BOLD,20));
  2544. d4.setBackground(Color.LIGHT_GRAY);
  2545. d4.setForeground(Color.BLACK);
  2546. f8.add(d4);
  2547.  
  2548. JButton u4 = new JButton("Edit");
  2549. u4.setBounds(820,135,150,75);
  2550. u4.setFont(new Font("Times New Roman",Font.BOLD,20));
  2551. u4.setBackground(Color.LIGHT_GRAY);
  2552. u4.setForeground(Color.BLACK);
  2553. f8.add(u4);
  2554.  
  2555. JPanel rp4 = new JPanel();
  2556. f8.add(rp4);
  2557. rp4.setBounds(0,0,1366,120);
  2558. rp4.setBackground(Color.BLACK);
  2559. rp4.setBorder(BorderFactory.createEtchedBorder(1));
  2560.  
  2561.  
  2562. JTable table = new JTable();
  2563. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  2564. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  2565. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  2566. DefaultTableModel model = new DefaultTableModel();
  2567. model.setColumnIdentifiers(columns);
  2568. table.setModel(model);
  2569.  
  2570.  
  2571. table.setBackground(Color.LIGHT_GRAY);
  2572. table.setForeground(Color.BLACK);
  2573. Font font = (new Font("Times New Roman",Font.BOLD,20));
  2574. table.setFont(font);
  2575. table.setRowHeight(30);
  2576.  
  2577. //JScrollPane
  2578. JScrollPane pane = new JScrollPane(table);
  2579. pane.setBounds(0,230,1366,350);
  2580. f8.add(pane);
  2581.  
  2582.  
  2583.  
  2584. JButton Back = new JButton("Back");
  2585. Back.setBounds(1180,600,150,75);
  2586. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  2587. Back.setBackground(Color.LIGHT_GRAY);
  2588. Back.setForeground(Color.BLACK);
  2589. f8.add(Back);
  2590.  
  2591. Back.addKeyListener(new KeyAdapter(){
  2592. public void keyPressed(KeyEvent w){
  2593. if(w.getKeyCode()==KeyEvent.VK_B){
  2594. Back.doClick();
  2595. }
  2596. }
  2597. });
  2598.  
  2599. Back.addActionListener(new ActionListener() {
  2600.  
  2601. public void actionPerformed(ActionEvent e) {
  2602. f8.setVisible(false);
  2603. f4.setVisible(true);
  2604.  
  2605.  
  2606. }
  2607. });
  2608.  
  2609. //ADD-4
  2610. u4.addKeyListener(new KeyAdapter(){
  2611. public void keyPressed(KeyEvent w){
  2612. if(w.getKeyCode()==KeyEvent.VK_E){
  2613. u4.doClick();
  2614. }
  2615.  
  2616.  
  2617. }
  2618. });
  2619.  
  2620. a4.addActionListener(new ActionListener() {
  2621.  
  2622. public void actionPerformed(ActionEvent e) {
  2623.  
  2624. Frame f18 = new JFrame();
  2625. f18.setVisible(true);
  2626. f8.setVisible(false);
  2627. f18.setSize(1366,768);
  2628. f18.setLayout(null);
  2629. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  2630. f18.setIconImage(icon.getImage());
  2631. f18.add(c5);
  2632. c5.setBounds(0,650,200,50);
  2633.  
  2634.  
  2635.  
  2636. JPanel rp19 = new JPanel();
  2637. rp19.setBounds(0,0,1366,120);
  2638. rp19.setBackground(Color.BLACK);
  2639. rp19.setBorder(BorderFactory.createEtchedBorder(1));
  2640. f18.add(rp19);
  2641.  
  2642.  
  2643. JLabel rl8 = new JLabel("Prisoner Fill Up Form");
  2644. rl8.setBounds(485,30,450,70);
  2645. rl8.setFont(new Font("Times new Roman",Font.BOLD,80));
  2646. rl8.setForeground(Color.WHITE);
  2647. rp19.add(rl8);
  2648.  
  2649. JPanel rp29 = new JPanel();
  2650. rp29.setBounds(12,130,1325,450);
  2651. rp29.setBackground(Color.BLACK);
  2652. rp29.setBorder(BorderFactory.createEtchedBorder());
  2653. f18.add(rp29);
  2654.  
  2655. JLabel r141 = new JLabel();
  2656. r141.setBounds(15,15,130,130);
  2657. r141.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
  2658. rp29.add(r141);
  2659.  
  2660.  
  2661. //Prisoner aydi:
  2662.  
  2663.  
  2664.  
  2665. JLabel r184 = new JLabel ("FIRSTNAME:");
  2666. r184.setBounds(183,40,200,50);
  2667. r184.setFont(new Font("Times new Roman",Font.BOLD,20));
  2668. r184.setForeground(Color.WHITE);
  2669. JTextField tf159 = new JTextField ();
  2670. tf159.setBounds(180,85,210,30);
  2671. rp29.add(tf159);
  2672. rp29.add(r184);
  2673. JLabel r185 = new JLabel ("MI:");
  2674. r185.setBounds(413,40,200,50);
  2675. r185.setFont(new Font("Times new Roman",Font.BOLD,20));
  2676. r185.setForeground(Color.WHITE);
  2677. JTextField tf160 = new JTextField ();
  2678. tf160.setBounds(410,85,80,30);
  2679. rp29.add(tf160);
  2680. rp29.add(r185);
  2681. JLabel r186 = new JLabel ("LASTNAME:");
  2682. r186.setBounds(518,40,200,50);
  2683. r186.setFont(new Font("Times new Roman",Font.BOLD,20));
  2684. r186.setForeground(Color.WHITE);
  2685. JTextField tf161 = new JTextField ();
  2686. tf161.setBounds(515,85,210,30);
  2687. rp29.add(tf161);
  2688. rp29.add(r186);
  2689. JLabel r187 = new JLabel ("SEX:");
  2690. r187.setBounds(751,40,200,50);
  2691. r187.setFont(new Font("Times new Roman",Font.BOLD,20));
  2692. r187.setForeground(Color.WHITE);
  2693. JTextField tf162 = new JTextField ();
  2694. tf162.setBounds(750,85,90,30);
  2695. rp29.add(tf162);
  2696. rp29.add(r187);
  2697. JLabel r188 = new JLabel ("AGE:");
  2698. r188.setBounds(861,40,200,50);
  2699. r188.setFont(new Font("Times new Roman",Font.BOLD,20));
  2700. r188.setForeground(Color.WHITE);
  2701. JTextField tf163 = new JTextField ();
  2702. tf163.setBounds(860,85,60,30);
  2703. rp29.add(tf163);
  2704. rp29.add(r188);
  2705. JLabel r189 = new JLabel ("ADDRESS:");
  2706. r189.setBounds(951,40,200,50);
  2707. r189.setFont(new Font("Times new Roman",Font.BOLD,20));
  2708. r189.setForeground(Color.WHITE);
  2709. JTextField tf164 = new JTextField ();
  2710. tf164.setBounds(950,85,355,30);
  2711. rp29.add(tf164);
  2712. rp29.add(r189);
  2713. JLabel r190 = new JLabel ("DATE OF BIRTH:");
  2714. r190.setBounds(17,150,200,50);
  2715. r190.setFont(new Font("Times new Roman",Font.BOLD,20));
  2716. r190.setForeground(Color.WHITE);
  2717. JTextField tf165 = new JTextField ();
  2718. tf165.setBounds(15,195,210,30);
  2719. rp29.add(tf165);
  2720. rp29.add(r190);
  2721. JLabel r191 = new JLabel ("NATIONALITY:");
  2722. r191.setBounds(247,150,200,50);
  2723. r191.setFont(new Font("Times new Roman",Font.BOLD,20));
  2724. r191.setForeground(Color.WHITE);
  2725. JTextField tf166 = new JTextField ();
  2726. tf166.setBounds(245,195,210,30);
  2727. rp29.add(tf166);
  2728. rp29.add(r191);
  2729. JLabel r192 = new JLabel ("HEIGHT:");
  2730. r192.setBounds(482,150,200,50);
  2731. r192.setFont(new Font("Times new Roman",Font.BOLD,20));
  2732. r192.setForeground(Color.WHITE);
  2733. JTextField tf167 = new JTextField ();
  2734. tf167.setBounds(480,195,120,30);
  2735. rp29.add(tf167);
  2736. rp29.add(r192);
  2737. JLabel r193 = new JLabel ("WEIGHT:");
  2738. r193.setBounds(636,150,200,50);
  2739. r193.setFont(new Font("Times new Roman",Font.BOLD,20));
  2740. r193.setForeground(Color.WHITE);
  2741. JTextField tf168 = new JTextField ();
  2742. tf168.setBounds(630,195,120,30);
  2743. rp29.add(tf168);
  2744. rp29.add(r193);
  2745. JLabel r194 = new JLabel ("EYE COLOR:");
  2746. r194.setBounds(787,150,200,50);
  2747. r194.setFont(new Font("Times new Roman",Font.BOLD,20));
  2748. r194.setForeground(Color.WHITE);
  2749. JTextField tf169 = new JTextField ();
  2750. tf169.setBounds(785 ,195,190,30);
  2751. rp29.add(tf169);
  2752. rp29.add(r194);
  2753. JLabel r195 = new JLabel ("PHONE NUMBER:");
  2754. r195.setBounds(997,150,200,50);
  2755. r195.setFont(new Font("Times new Roman",Font.BOLD,20));
  2756. r195.setForeground(Color.WHITE);
  2757. JTextField tf170 = new JTextField ();
  2758. tf170.setBounds(995,195,310,30);
  2759. rp29.add(tf170);
  2760. rp29.add(r195);
  2761. JLabel r196 = new JLabel ("LANGUAGE:");
  2762. r196.setBounds(16,250,200,50);
  2763. r196.setFont(new Font("Times new Roman",Font.BOLD,20));
  2764. r196.setForeground(Color.WHITE);
  2765. JTextField tf171 = new JTextField ();
  2766. tf171.setBounds(15,295,210,30);
  2767. rp29.add(tf171);
  2768. rp29.add(r196);
  2769. JLabel r197 = new JLabel ("DATE OF CAPTURE:");
  2770. r197.setBounds(247,250,200,50);
  2771. r197.setFont(new Font("Times new Roman",Font.BOLD,20));
  2772. r197.setForeground(Color.WHITE);
  2773. JTextField tf172 = new JTextField ();
  2774. tf172.setBounds(245,295,210,30);
  2775. rp29.add(tf172);
  2776. rp29.add(r197);
  2777. JLabel r198 = new JLabel ("PLACE OF CAPTURE:");
  2778. r198.setBounds(482,250,220,50);
  2779. r198.setFont(new Font("Times new Roman",Font.BOLD,20));
  2780. r198.setForeground(Color.WHITE);
  2781. JTextField tf173 = new JTextField ();
  2782. tf173.setBounds(480,295,320,30);
  2783. rp29.add(tf173);
  2784. rp29.add(r198);
  2785. JLabel r199 = new JLabel ("CIVILLIAN OCCUPATION:");
  2786. r199.setBounds(827,250,270,50);
  2787. r199.setFont(new Font("Times new Roman",Font.BOLD,20));
  2788. r199.setForeground(Color.WHITE);
  2789. JTextField tf174 = new JTextField ();
  2790. tf174.setBounds(825,295,480,30);
  2791. rp29.add(tf174);
  2792. rp29.add(r199);
  2793. JLabel r200 = new JLabel ("PHYSICAL CONDITION:");
  2794. r200.setBounds(16,350,260,50);
  2795. r200.setFont(new Font("Times new Roman",Font.BOLD,20));
  2796. r200.setForeground(Color.WHITE);
  2797. JTextField tf175 = new JTextField ();
  2798. tf175.setBounds(15,395,260,30);
  2799. rp29.add(tf175);
  2800. rp29.add(r200);
  2801. JLabel r201 = new JLabel ("DAYS IN JAIL:");
  2802. r201.setBounds(302,350,250,50);
  2803. r201.setFont(new Font("Times new Roman",Font.BOLD,20));
  2804. r201.setForeground(Color.WHITE);
  2805. JTextField tf176 = new JTextField ();
  2806. tf176.setBounds(300,395,180,30);
  2807. rp29.add(tf176);
  2808. rp29.add(r201);
  2809. JLabel r202 = new JLabel ("ARRIVAL OF PRISONER:");
  2810. r202.setBounds(502,350,280,50);
  2811. r202.setFont(new Font("Times new Roman",Font.BOLD,20));
  2812. r202.setForeground(Color.WHITE);
  2813. JTextField tf177 = new JTextField ();
  2814. tf177.setBounds(500,395,280,30);
  2815. rp29.add(tf177);
  2816. rp29.add(r202);
  2817. JLabel r203 = new JLabel ("DATE/TIME:");
  2818. r203.setBounds(802,350,250,50);
  2819. r203.setFont(new Font("Times new Roman",Font.BOLD,20));
  2820. r203.setForeground(Color.WHITE);
  2821. JTextField tf178 = new JTextField ();
  2822. tf178.setBounds(800,395,150,30);
  2823. rp29.add(tf178);
  2824. rp29.add(r203);
  2825. JLabel r204 = new JLabel ("ARRIVAL OFFICER:");
  2826. r204.setBounds(972,350,250,50);
  2827. r204.setFont(new Font("Times new Roman",Font.BOLD,20));
  2828. r204.setForeground(Color.WHITE);
  2829. JTextField tf179 = new JTextField ();
  2830. tf179.setBounds(970,395,335,30);
  2831. rp29.add(tf179);
  2832. rp29.add(r204);
  2833. rp29.setLayout(null);
  2834.  
  2835.  
  2836. JButton Back = new JButton("Back");
  2837. Back.setBounds(1180,600,150,75);
  2838. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  2839. Back.setBackground(Color.LIGHT_GRAY);
  2840. Back.setForeground(Color.BLACK);
  2841. f18.add(Back);
  2842.  
  2843. Back.addKeyListener(new KeyAdapter(){
  2844. public void keyPressed(KeyEvent w){
  2845. if(w.getKeyCode()==KeyEvent.VK_B){
  2846. Back.doClick();
  2847. }
  2848.  
  2849.  
  2850. }
  2851. });
  2852.  
  2853. Back.addActionListener(new ActionListener() {
  2854.  
  2855. public void actionPerformed(ActionEvent e) {
  2856. f18.setVisible(false);
  2857. f8.setVisible(true);
  2858.  
  2859.  
  2860. }
  2861. });
  2862.  
  2863. //update
  2864. JButton update = new JButton("Update");
  2865. update.setBounds(820,600,150,75);
  2866. update.setFont(new Font("Times New Roman",Font.BOLD,20));
  2867. update.setBackground(Color.LIGHT_GRAY);
  2868. update.setForeground(Color.BLACK);
  2869. f18.add(update);
  2870.  
  2871.  
  2872.  
  2873. //Save
  2874. JButton Save = new JButton("Save");
  2875. Save.setBounds(1000,600,150,75);
  2876. Save.setFont(new Font("Times New Roman",Font.BOLD,20));
  2877. Save.setBackground(Color.LIGHT_GRAY);
  2878. Save.setForeground(Color.BLACK);
  2879. f18.add(Save);
  2880.  
  2881.  
  2882. u4.addKeyListener(new KeyAdapter(){
  2883. public void keyPressed(KeyEvent w){
  2884. if(w.getKeyCode()==KeyEvent.VK_E){
  2885. u4.doClick();
  2886. }
  2887.  
  2888.  
  2889. }
  2890. });
  2891. u4.addActionListener(new ActionListener() {
  2892.  
  2893. public void actionPerformed(ActionEvent e) {
  2894.  
  2895.  
  2896.  
  2897.  
  2898. f18.setVisible(true);
  2899. f8.setVisible(false);
  2900.  
  2901.  
  2902.  
  2903. }
  2904. });
  2905.  
  2906. //UPDATE FUNCTION
  2907. update.addKeyListener(new KeyAdapter(){
  2908. public void keyPressed(KeyEvent w){
  2909. if(w.getKeyCode()==KeyEvent.VK_U){
  2910. update.doClick();
  2911. }
  2912. }
  2913. });
  2914.  
  2915. update.addActionListener(new ActionListener(){
  2916. public void actionPerformed(ActionEvent e) {
  2917. int n = JOptionPane.showConfirmDialog(
  2918. f2, "Would you like to UPDATE This Row?",
  2919. "Are you sure?",
  2920. JOptionPane.YES_NO_OPTION);
  2921. if (n == JOptionPane.YES_OPTION){
  2922.  
  2923. f18.setVisible(false);
  2924. f8.setVisible(true);
  2925.  
  2926. JOptionPane.showMessageDialog(f8,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
  2927.  
  2928.  
  2929. }
  2930.  
  2931.  
  2932. }
  2933. });
  2934.  
  2935.  
  2936. //ADD FUNCTION
  2937. Save.addKeyListener(new KeyAdapter(){
  2938. public void keyPressed(KeyEvent w){
  2939. if(w.getKeyCode()==KeyEvent.VK_S){
  2940. Save.doClick();
  2941. }
  2942. }
  2943. });
  2944. Save.addActionListener(new ActionListener() {
  2945.  
  2946. public void actionPerformed(ActionEvent e) {
  2947. int n = JOptionPane.showConfirmDialog(
  2948. null, "Would you like to ADD This Row?",
  2949. "Are you sure?",
  2950. JOptionPane.YES_NO_OPTION);
  2951. if (n == JOptionPane.YES_OPTION){
  2952.  
  2953.  
  2954.  
  2955. f18.setVisible(false);
  2956. f8.setVisible(true);
  2957. JOptionPane.showMessageDialog(f8,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  2958. }
  2959.  
  2960. }
  2961. });
  2962.  
  2963. //DELETE FUNCTION
  2964. d4.addKeyListener(new KeyAdapter(){
  2965. public void keyPressed(KeyEvent w){
  2966. if(w.getKeyCode()==KeyEvent.VK_D){
  2967. d4.doClick();
  2968. }
  2969. }
  2970. });
  2971. d4.addActionListener(new ActionListener(){
  2972. public void actionPerformed(ActionEvent e) {
  2973. int n = JOptionPane.showConfirmDialog(
  2974. null, "Would you like to DELETE This Row?",
  2975. "Are you sure?",
  2976. JOptionPane.YES_NO_OPTION);
  2977. if (n == JOptionPane.YES_OPTION) {
  2978.  
  2979.  
  2980. JOptionPane.showMessageDialog(f8,"Delected Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  2981. }
  2982.  
  2983.  
  2984.  
  2985. }
  2986. });
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993. }
  2994. });
  2995.  
  2996. }
  2997. });
  2998.  
  2999.  
  3000. //B5
  3001. r5.addKeyListener(new KeyAdapter(){
  3002. public void keyPressed(KeyEvent w){
  3003. if(w.getKeyCode()==KeyEvent.VK_5){
  3004. r5.doClick();
  3005. }
  3006. }
  3007. });
  3008.  
  3009. r5.addActionListener(new ActionListener() {
  3010.  
  3011. public void actionPerformed(ActionEvent e) {
  3012.  
  3013.  
  3014.  
  3015. Frame f9 = new JFrame();
  3016. f9.setVisible(true);
  3017. f4.setVisible(false);
  3018. f9.setSize(1366,768);
  3019. f9.setLayout(null);
  3020. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  3021. f9.setIconImage(icon.getImage());
  3022. f9.add(c5);
  3023. c5.setBounds(0,650,200,50);
  3024.  
  3025.  
  3026.  
  3027. JLabel rl5 = new JLabel("Cell Five");
  3028. rl5.setBounds(485,30,450,70);
  3029. rl5.setFont(new Font("Times new Roman",Font.BOLD,80));
  3030. rl5.setForeground(Color.WHITE);
  3031. f9.add(rl5);
  3032.  
  3033. JButton a5 = new JButton("Add");
  3034. a5.setBounds(1180,135,150,75);
  3035. a5.setFont(new Font("Times New Roman",Font.BOLD,20));
  3036. a5.setBackground(Color.LIGHT_GRAY);
  3037. a5.setForeground(Color.BLACK);
  3038. f9.add(a5);
  3039.  
  3040.  
  3041. JButton d5 = new JButton("Delete");
  3042. d5.setBounds(1000,135,150,75);
  3043. d5.setFont(new Font("Times New Roman",Font.BOLD,20));
  3044. d5.setBackground(Color.LIGHT_GRAY);
  3045. d5.setForeground(Color.BLACK);
  3046. f9.add(d5);
  3047.  
  3048. JButton u5 = new JButton("Edit");
  3049. u5.setBounds(820,135,150,75);
  3050. u5.setFont(new Font("Times New Roman",Font.BOLD,20));
  3051. u5.setBackground(Color.LIGHT_GRAY);
  3052. u5.setForeground(Color.BLACK);
  3053. f9.add(u5);
  3054.  
  3055. JPanel rp5 = new JPanel();
  3056. f9.add(rp5);
  3057. rp5.setBounds(0,0,1366,120);
  3058. rp5.setBackground(Color.BLACK);
  3059. rp5.setBorder(BorderFactory.createEtchedBorder(1));
  3060.  
  3061. JTable table = new JTable();
  3062. Object[] columns ={"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  3063. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  3064. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  3065. DefaultTableModel model = new DefaultTableModel();
  3066. model.setColumnIdentifiers(columns);
  3067. table.setModel(model);
  3068.  
  3069.  
  3070. table.setBackground(Color.LIGHT_GRAY);
  3071. table.setForeground(Color.BLACK);
  3072. Font font =(new Font("Times New Roman",Font.BOLD,20));
  3073. table.setFont(font);
  3074. table.setRowHeight(30);
  3075.  
  3076. //JScrollPane
  3077. JScrollPane pane = new JScrollPane(table);
  3078. pane.setBounds(0,230,1366,350);
  3079. f9.add(pane);
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085. JButton Back = new JButton("Back");
  3086. Back.setBounds(1180,600,150,75);
  3087. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  3088. Back.setBackground(Color.LIGHT_GRAY);
  3089. Back.setForeground(Color.BLACK);
  3090. f9.add(Back);
  3091. Back.addKeyListener(new KeyAdapter(){
  3092. public void keyPressed(KeyEvent w){
  3093. if(w.getKeyCode()==KeyEvent.VK_B){
  3094. Back.doClick();
  3095. }
  3096. }
  3097. });
  3098.  
  3099. Back.addActionListener(new ActionListener() {
  3100.  
  3101. public void actionPerformed(ActionEvent e) {
  3102. f9.setVisible(false);
  3103. f4.setVisible(true);
  3104.  
  3105.  
  3106. }
  3107. });
  3108.  
  3109. //ADD-5
  3110.  
  3111. a5.addKeyListener(new KeyAdapter(){
  3112. public void keyPressed(KeyEvent w){
  3113. if(w.getKeyCode()==KeyEvent.VK_A){
  3114. a5.doClick();
  3115. }
  3116. }
  3117. });
  3118.  
  3119. a5.addActionListener(new ActionListener() {
  3120.  
  3121. public void actionPerformed(ActionEvent e) {
  3122.  
  3123. Frame f19 = new JFrame();
  3124. f19.setVisible(true);
  3125. f9.setVisible(false);
  3126. f19.setSize(1366,768);
  3127. f19.setLayout(null);
  3128. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  3129. f19.setIconImage(icon.getImage());
  3130. f19.add(c5);
  3131. c5.setBounds(0,650,200,50);
  3132.  
  3133.  
  3134.  
  3135. JPanel rp20 = new JPanel();
  3136. rp20.setBounds(0,0,1366,120);
  3137. rp20.setBackground(Color.BLACK);
  3138. rp20.setBorder(BorderFactory.createEtchedBorder(1));
  3139. f19.add(rp20);
  3140.  
  3141. JLabel r900 = new JLabel("Prisoner Fill Up Form");
  3142. r900.setBounds(485,30,450,70);
  3143. r900.setFont(new Font("Times new Roman",Font.BOLD,80));
  3144. r900.setForeground(Color.WHITE);
  3145. rp20.add(r900);
  3146.  
  3147.  
  3148. JPanel rp30 = new JPanel();
  3149. rp30.setBounds(12,130,1325,450);
  3150. rp30.setBackground(Color.BLACK);
  3151. rp30.setBorder(BorderFactory.createEtchedBorder());
  3152. f19.add(rp30);
  3153.  
  3154. JLabel r142 = new JLabel();
  3155. r142.setBounds(15,15,130,130);
  3156. r142.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
  3157. rp30.add(r142);
  3158.  
  3159.  
  3160. //Prisoner aydi:
  3161.  
  3162. JLabel r205 = new JLabel ("FIRSTNAME:");
  3163. r205.setBounds(183,40,200,50);
  3164. r205.setFont(new Font("Times new Roman",Font.BOLD,20));
  3165. r205.setForeground(Color.WHITE);
  3166. JTextField tf180 = new JTextField ();
  3167. tf180.setBounds(180,85,210,30);
  3168. rp30.add(tf180);
  3169. rp30.add(r205);
  3170. JLabel r206 = new JLabel ("MI:");
  3171. r206.setBounds(413,40,200,50);
  3172. r206.setFont(new Font("Times new Roman",Font.BOLD,20));
  3173. r206.setForeground(Color.WHITE);
  3174. JTextField tf181 = new JTextField ();
  3175. tf181.setBounds(410,85,80,30);
  3176. rp30.add(tf181);
  3177. rp30.add(r206);
  3178. JLabel r207 = new JLabel ("LASTNAME:");
  3179. r207.setBounds(518,40,200,50);
  3180. r207.setFont(new Font("Times new Roman",Font.BOLD,20));
  3181. r207.setForeground(Color.WHITE);
  3182. JTextField tf182 = new JTextField ();
  3183. tf182.setBounds(515,85,210,30);
  3184. rp30.add(tf182);
  3185. rp30.add(r207);
  3186. JLabel r208 = new JLabel ("SEX:");
  3187. r208.setBounds(751,40,200,50);
  3188. r208.setFont(new Font("Times new Roman",Font.BOLD,20));
  3189. r208.setForeground(Color.WHITE);
  3190. JTextField tf183 = new JTextField ();
  3191. tf183.setBounds(750,85,90,30);
  3192. rp30.add(tf183);
  3193. rp30.add(r208);
  3194. JLabel r209 = new JLabel ("AGE:");
  3195. r209.setBounds(861,40,200,50);
  3196. r209.setFont(new Font("Times new Roman",Font.BOLD,20));
  3197. r209.setForeground(Color.WHITE);
  3198. JTextField tf184 = new JTextField ();
  3199. tf184.setBounds(860,85,60,30);
  3200. rp30.add(tf184);
  3201. rp30.add(r209);
  3202. JLabel r210 = new JLabel ("ADDRESS:");
  3203. r210.setBounds(951,40,200,50);
  3204. r210.setFont(new Font("Times new Roman",Font.BOLD,20));
  3205. r210.setForeground(Color.WHITE);
  3206. JTextField tf185 = new JTextField ();
  3207. tf185.setBounds(950,85,355,30);
  3208. rp30.add(tf185);
  3209. rp30.add(r210);
  3210. JLabel r211 = new JLabel ("DATE OF BIRTH:");
  3211. r211.setBounds(17,150,200,50);
  3212. r211.setFont(new Font("Times new Roman",Font.BOLD,20));
  3213. r211.setForeground(Color.WHITE);
  3214. JTextField tf186 = new JTextField ();
  3215. tf186.setBounds(15,195,210,30);
  3216. rp30.add(tf186);
  3217. rp30.add(r211);
  3218. JLabel r212 = new JLabel ("NATIONALITY:");
  3219. r212.setBounds(247,150,200,50);
  3220. r212.setFont(new Font("Times new Roman",Font.BOLD,20));
  3221. r212.setForeground(Color.WHITE);
  3222. JTextField tf187 = new JTextField ();
  3223. tf187.setBounds(245,195,210,30);
  3224. rp30.add(tf187);
  3225. rp30.add(r212);
  3226. JLabel r213 = new JLabel ("HEIGHT:");
  3227. r213.setBounds(482,150,200,50);
  3228. r213.setFont(new Font("Times new Roman",Font.BOLD,20));
  3229. r213.setForeground(Color.WHITE);
  3230. JTextField tf188 = new JTextField ();
  3231. tf188.setBounds(480,195,120,30);
  3232. rp30.add(tf188);
  3233. rp30.add(r213);
  3234. JLabel r214 = new JLabel ("WEIGHT:");
  3235. r214.setBounds(636,150,200,50);
  3236. r214.setFont(new Font("Times new Roman",Font.BOLD,20));
  3237. r214.setForeground(Color.WHITE);
  3238. JTextField tf189 = new JTextField ();
  3239. tf189.setBounds(630,195,120,30);
  3240. rp30.add(tf189);
  3241. rp30.add(r214);
  3242. JLabel r215 = new JLabel ("EYE COLOR:");
  3243. r215.setBounds(787,150,200,50);
  3244. r215.setFont(new Font("Times new Roman",Font.BOLD,20));
  3245. r215.setForeground(Color.WHITE);
  3246. JTextField tf190 = new JTextField ();
  3247. tf190.setBounds(785 ,195,190,30);
  3248. rp30.add(tf190);
  3249. rp30.add(r215);
  3250. JLabel r216 = new JLabel ("PHONE NUMBER:");
  3251. r216.setBounds(997,150,200,50);
  3252. r216.setFont(new Font("Times new Roman",Font.BOLD,20));
  3253. r216.setForeground(Color.WHITE);
  3254. JTextField tf191 = new JTextField ();
  3255. tf191.setBounds(995,195,310,30);
  3256. rp30.add(tf191);
  3257. rp30.add(r216);
  3258. JLabel r217 = new JLabel ("LANGUAGE:");
  3259. r217.setBounds(16,250,200,50);
  3260. r217.setFont(new Font("Times new Roman",Font.BOLD,20));
  3261. r217.setForeground(Color.WHITE);
  3262. JTextField tf192 = new JTextField ();
  3263. tf192.setBounds(15,295,210,30);
  3264. rp30.add(tf192);
  3265. rp30.add(r217);
  3266. JLabel r218 = new JLabel ("DATE OF CAPTURE:");
  3267. r218.setBounds(247,250,200,50);
  3268. r218.setFont(new Font("Times new Roman",Font.BOLD,20));
  3269. r218.setForeground(Color.WHITE);
  3270. JTextField tf193 = new JTextField ();
  3271. tf193.setBounds(245,295,210,30);
  3272. rp30.add(tf193);
  3273. rp30.add(r218);
  3274. JLabel r219 = new JLabel ("PLACE OF CAPTURE:");
  3275. r219.setBounds(482,250,220,50);
  3276. r219.setFont(new Font("Times new Roman",Font.BOLD,20));
  3277. r219.setForeground(Color.WHITE);
  3278. JTextField tf194 = new JTextField ();
  3279. tf194.setBounds(480,295,320,30);
  3280. rp30.add(tf194);
  3281. rp30.add(r219);
  3282. JLabel r220 = new JLabel ("CIVILLIAN OCCUPATION:");
  3283. r220.setBounds(827,250,270,50);
  3284. r220.setFont(new Font("Times new Roman",Font.BOLD,20));
  3285. r220.setForeground(Color.WHITE);
  3286. JTextField tf195 = new JTextField ();
  3287. tf195.setBounds(825,295,480,30);
  3288. rp30.add(tf195);
  3289. rp30.add(r220);
  3290. JLabel r221 = new JLabel ("PHYSICAL CONDITION:");
  3291. r221.setBounds(16,350,260,50);
  3292. r221.setFont(new Font("Times new Roman",Font.BOLD,20));
  3293. r221.setForeground(Color.WHITE);
  3294. JTextField tf196 = new JTextField ();
  3295. tf196.setBounds(15,395,260,30);
  3296. rp30.add(tf196);
  3297. rp30.add(r221);
  3298. JLabel r222 = new JLabel ("DAYS IN JAIL:");
  3299. r222.setBounds(302,350,250,50);
  3300. r222.setFont(new Font("Times new Roman",Font.BOLD,20));
  3301. r222.setForeground(Color.WHITE);
  3302. JTextField tf197 = new JTextField ();
  3303. tf197.setBounds(300,395,180,30);
  3304. rp30.add(tf197);
  3305. rp30.add(r222);
  3306. JLabel r223 = new JLabel ("ARRIVAL OF PRISONER:");
  3307. r223.setBounds(502,350,280,50);
  3308. r223.setFont(new Font("Times new Roman",Font.BOLD,20));
  3309. r223.setForeground(Color.WHITE);
  3310. JTextField tf198 = new JTextField ();
  3311. tf198.setBounds(500,395,280,30);
  3312. rp30.add(tf198);
  3313. rp30.add(r223);
  3314. JLabel r224 = new JLabel ("DATE/TIME:");
  3315. r224.setBounds(802,350,250,50);
  3316. r224.setFont(new Font("Times new Roman",Font.BOLD,20));
  3317. r224.setForeground(Color.WHITE);
  3318. JTextField tf199 = new JTextField ();
  3319. tf199.setBounds(800,395,150,30);
  3320. rp30.add(tf199);
  3321. rp30.add(r224);
  3322. JLabel r225 = new JLabel ("ARRIVAL OFFICER:");
  3323. r225.setBounds(972,350,250,50);
  3324. r225.setFont(new Font("Times new Roman",Font.BOLD,20));
  3325. r225.setForeground(Color.WHITE);
  3326. JTextField tf200 = new JTextField ();
  3327. tf200.setBounds(970,395,335,30);
  3328. rp30.add(tf200);
  3329. rp30.add(r225);
  3330. rp30.setLayout(null);
  3331.  
  3332.  
  3333. JButton Back = new JButton("Back");
  3334. Back.setBounds(1180,600,150,75);
  3335. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  3336. Back.setBackground(Color.LIGHT_GRAY);
  3337. Back.setForeground(Color.BLACK);
  3338. f19.add(Back);
  3339.  
  3340. Back.addKeyListener(new KeyAdapter(){
  3341. public void keyPressed(KeyEvent w){
  3342. if(w.getKeyCode()==KeyEvent.VK_B){
  3343. Back.doClick();
  3344. }
  3345. }
  3346. });
  3347.  
  3348. Back.addActionListener(new ActionListener() {
  3349.  
  3350. public void actionPerformed(ActionEvent e) {
  3351. f19.setVisible(false);
  3352. f9.setVisible(true);
  3353.  
  3354.  
  3355. }
  3356. });
  3357.  
  3358. //update
  3359. JButton update = new JButton("Update");
  3360. update.setBounds(820,600,150,75);
  3361. update.setFont(new Font("Times New Roman",Font.BOLD,20));
  3362. update.setBackground(Color.LIGHT_GRAY);
  3363. update.setForeground(Color.BLACK);
  3364. f19.add(update);
  3365.  
  3366.  
  3367.  
  3368. //Save
  3369. JButton Save = new JButton("Save");
  3370. Save.setBounds(1000,600,150,75);
  3371. Save.setFont(new Font("Times New Roman",Font.BOLD,20));
  3372. Save.setBackground(Color.LIGHT_GRAY);
  3373. Save.setForeground(Color.BLACK);
  3374. f19.add(Save);
  3375.  
  3376.  
  3377. u5.addKeyListener(new KeyAdapter(){
  3378. public void keyPressed(KeyEvent w){
  3379. if(w.getKeyCode()==KeyEvent.VK_E){
  3380. u5.doClick();
  3381. }
  3382.  
  3383.  
  3384. }
  3385. });
  3386. u5.addActionListener(new ActionListener() {
  3387.  
  3388. public void actionPerformed(ActionEvent e) {
  3389.  
  3390.  
  3391.  
  3392.  
  3393. f19.setVisible(true);
  3394. f9.setVisible(false);
  3395.  
  3396.  
  3397.  
  3398.  
  3399. }
  3400. });
  3401.  
  3402. //UPDATE FUNCTION
  3403. update.addKeyListener(new KeyAdapter(){
  3404. public void keyPressed(KeyEvent w){
  3405. if(w.getKeyCode()==KeyEvent.VK_U){
  3406. update.doClick();
  3407. }
  3408. }
  3409. });
  3410. update.addActionListener(new ActionListener(){
  3411. public void actionPerformed(ActionEvent e) {
  3412. int n = JOptionPane.showConfirmDialog(
  3413. f2, "Would you like to UPDATE This Row?",
  3414. "Are you sure?",
  3415. JOptionPane.YES_NO_OPTION);
  3416. if (n == JOptionPane.YES_OPTION){
  3417.  
  3418.  
  3419. f19.setVisible(false);
  3420. f9.setVisible(true);
  3421.  
  3422. JOptionPane.showMessageDialog(f9,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
  3423.  
  3424.  
  3425.  
  3426. }
  3427.  
  3428. }
  3429. });
  3430.  
  3431.  
  3432. //ADD FUNCTION
  3433. Save.addKeyListener(new KeyAdapter(){
  3434. public void keyPressed(KeyEvent w){
  3435. if(w.getKeyCode()==KeyEvent.VK_S){
  3436. Save.doClick();
  3437. }
  3438. }
  3439. });
  3440. Save.addActionListener(new ActionListener() {
  3441.  
  3442. public void actionPerformed(ActionEvent e) {
  3443. int n = JOptionPane.showConfirmDialog(
  3444. null, "Would you like to ADD This Row?",
  3445. "Are you sure?",
  3446. JOptionPane.YES_NO_OPTION);
  3447. if (n == JOptionPane.YES_OPTION){
  3448.  
  3449.  
  3450.  
  3451. f19.setVisible(false);
  3452. f9.setVisible(true);
  3453.  
  3454. JOptionPane.showMessageDialog(f9,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  3455.  
  3456. }
  3457.  
  3458. }
  3459. });
  3460.  
  3461. //DELETE FUNCTION
  3462. d5.addKeyListener(new KeyAdapter(){
  3463. public void keyPressed(KeyEvent w){
  3464. if(w.getKeyCode()==KeyEvent.VK_D){
  3465. d5.doClick();
  3466. }
  3467. }
  3468. });
  3469. d5.addActionListener(new ActionListener(){
  3470. public void actionPerformed(ActionEvent e) {
  3471. int n = JOptionPane.showConfirmDialog(
  3472. null, "Would you like to DELETE This Row?",
  3473. "Are you sure?",
  3474. JOptionPane.YES_NO_OPTION);
  3475. if (n == JOptionPane.YES_OPTION) {
  3476.  
  3477.  
  3478. JOptionPane.showMessageDialog(f9,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  3479.  
  3480. }
  3481.  
  3482.  
  3483. }
  3484. });
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490. }
  3491. });
  3492.  
  3493. }
  3494. });
  3495.  
  3496. //B6
  3497. r6.addKeyListener(new KeyAdapter(){
  3498. public void keyPressed(KeyEvent w){
  3499. if(w.getKeyCode()==KeyEvent.VK_6){
  3500. r6.doClick();
  3501. }
  3502. }
  3503. });
  3504.  
  3505. r6.addActionListener(new ActionListener() {
  3506.  
  3507. public void actionPerformed(ActionEvent e) {
  3508.  
  3509. Frame f10 = new JFrame();
  3510. f10.setVisible(true);
  3511. f4.setVisible(false);
  3512. f10.setSize(1366,768);
  3513. f10.setLayout(null);
  3514. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  3515. f10.setIconImage(icon.getImage());
  3516. f10.add(c5);
  3517. c5.setBounds(0,650,200,50);
  3518.  
  3519.  
  3520.  
  3521. JLabel rl6 = new JLabel("Cell Six");
  3522. rl6.setBounds(485,30,450,70);
  3523. rl6.setFont(new Font("Times new Roman",Font.BOLD,80));
  3524. rl6.setForeground(Color.WHITE);
  3525. f10.add(rl6);
  3526.  
  3527. JButton a6 = new JButton("Add");
  3528. a6.setBounds(1180,135,150,75);
  3529. a6.setFont(new Font("Times New Roman",Font.BOLD,20));
  3530. a6.setBackground(Color.LIGHT_GRAY);
  3531. a6.setForeground(Color.BLACK);
  3532. f10.add(a6);
  3533.  
  3534.  
  3535. JButton d6 = new JButton("Delete");
  3536. d6.setBounds(1000,135,150,75);
  3537. d6.setFont(new Font("Times New Roman",Font.BOLD,20));
  3538. d6.setBackground(Color.LIGHT_GRAY);
  3539. d6.setForeground(Color.BLACK);
  3540. f10.add(d6);
  3541.  
  3542. JButton u6 = new JButton("Edit");
  3543. u6.setBounds(820,135,150,75);
  3544. u6.setFont(new Font("Times New Roman",Font.BOLD,20));
  3545. u6.setBackground(Color.LIGHT_GRAY);
  3546. u6.setForeground(Color.BLACK);
  3547. f10.add(u6);
  3548.  
  3549. JPanel rp6 = new JPanel();
  3550. f10.add(rp6);
  3551. rp6.setBounds(0,0,1366,120);
  3552. rp6.setBackground(Color.BLACK);
  3553. rp6.setBorder(BorderFactory.createEtchedBorder(1));
  3554.  
  3555. JTable table = new JTable();
  3556. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  3557. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  3558. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  3559. DefaultTableModel model = new DefaultTableModel();
  3560. model.setColumnIdentifiers(columns);
  3561. table.setModel(model);
  3562.  
  3563.  
  3564. table.setBackground(Color.LIGHT_GRAY);
  3565. table.setForeground(Color.BLACK);
  3566. Font font = (new Font("Times New Roman",Font.BOLD,20));
  3567. table.setFont(font);
  3568. table.setRowHeight(30);
  3569.  
  3570. //JScrollPane
  3571. JScrollPane pane = new JScrollPane(table);
  3572. pane.setBounds(0,230,1366,350);
  3573. f10.add(pane);
  3574.  
  3575.  
  3576.  
  3577. JButton Back = new JButton("Back");
  3578. Back.setBounds(1180,600,150,75);
  3579. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  3580. Back.setBackground(Color.LIGHT_GRAY);
  3581. Back.setForeground(Color.BLACK);
  3582. f10.add(Back);
  3583. Back.addKeyListener(new KeyAdapter(){
  3584. public void keyPressed(KeyEvent w){
  3585. if(w.getKeyCode()==KeyEvent.VK_B){
  3586. Back.doClick();
  3587. }
  3588. }
  3589. });
  3590.  
  3591. Back.addActionListener(new ActionListener() {
  3592.  
  3593. public void actionPerformed(ActionEvent e) {
  3594. f10.setVisible(false);
  3595. f4.setVisible(true);
  3596.  
  3597.  
  3598. }
  3599. });
  3600.  
  3601. //ADD-6
  3602. a6.addKeyListener(new KeyAdapter(){
  3603. public void keyPressed(KeyEvent w){
  3604. if(w.getKeyCode()==KeyEvent.VK_A){
  3605. a6.doClick();
  3606. }
  3607. }
  3608. });
  3609.  
  3610. a6.addActionListener(new ActionListener() {
  3611.  
  3612. public void actionPerformed(ActionEvent e) {
  3613.  
  3614. Frame f20 = new JFrame();
  3615. f20.setVisible(true);
  3616. f10.setVisible(false);
  3617. f20.setSize(1366,768);
  3618. f20.setLayout(null);
  3619. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  3620. f20.setIconImage(icon.getImage());
  3621. f20.add(c5);
  3622. c5.setBounds(0,650,200,50);
  3623.  
  3624.  
  3625.  
  3626. JPanel rp21 = new JPanel();
  3627. rp21.setBounds(0,0,1366,120);
  3628. rp21.setBackground(Color.BLACK);
  3629. rp21.setBorder(BorderFactory.createEtchedBorder(1));
  3630. f20.add(rp21);
  3631.  
  3632.  
  3633. JLabel r20 = new JLabel("Prisoner Fill Up Form");
  3634. r20.setBounds(485,30,450,70);
  3635. r20.setFont(new Font("Times new Roman",Font.BOLD,80));
  3636. r20.setForeground(Color.WHITE);
  3637. rp21.add(r20);
  3638.  
  3639. JPanel rp31 = new JPanel();
  3640. rp31.setBounds(12,130,1325,450);
  3641. rp31.setBackground(Color.BLACK);
  3642. rp31.setBorder(BorderFactory.createEtchedBorder());
  3643. f20.add(rp31);
  3644.  
  3645. JLabel r143 = new JLabel();
  3646. r143.setBounds(15,15,130,130);
  3647. r143.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
  3648. rp31.add(r143);
  3649.  
  3650.  
  3651. //Prisoner aydi:
  3652.  
  3653.  
  3654. JLabel r226 = new JLabel ("FIRSTNAME:");
  3655. r226.setBounds(183,40,200,50);
  3656. r226.setFont(new Font("Times new Roman",Font.BOLD,20));
  3657. r226.setForeground(Color.WHITE);
  3658. JTextField tf201 = new JTextField ();
  3659. tf201.setBounds(180,85,210,30);
  3660. rp31.add(tf201);
  3661. rp31.add(r226);
  3662. JLabel r227 = new JLabel ("MI:");
  3663. r227.setBounds(413,40,200,50);
  3664. r227.setFont(new Font("Times new Roman",Font.BOLD,20));
  3665. r227.setForeground(Color.WHITE);
  3666. JTextField tf202 = new JTextField ();
  3667. tf202.setBounds(410,85,80,30);
  3668. rp31.add(tf202);
  3669. rp31.add(r227);
  3670. JLabel r228 = new JLabel ("LASTNAME:");
  3671. r228.setBounds(518,40,200,50);
  3672. r228.setFont(new Font("Times new Roman",Font.BOLD,20));
  3673. r228.setForeground(Color.WHITE);
  3674. JTextField tf203 = new JTextField ();
  3675. tf203.setBounds(515,85,210,30);
  3676. rp31.add(tf203);
  3677. rp31.add(r228);
  3678. JLabel r229 = new JLabel ("SEX:");
  3679. r229.setBounds(751,40,200,50);
  3680. r229.setFont(new Font("Times new Roman",Font.BOLD,20));
  3681. r229.setForeground(Color.WHITE);
  3682. JTextField tf204 = new JTextField ();
  3683. tf204.setBounds(750,85,90,30);
  3684. rp31.add(tf204);
  3685. rp31.add(r229);
  3686. JLabel r230 = new JLabel ("AGE:");
  3687. r230.setBounds(861,40,200,50);
  3688. r230.setFont(new Font("Times new Roman",Font.BOLD,20));
  3689. r230.setForeground(Color.WHITE);
  3690. JTextField tf205 = new JTextField ();
  3691. tf205.setBounds(860,85,60,30);
  3692. rp31.add(tf205);
  3693. rp31.add(r230);
  3694. JLabel r231 = new JLabel ("ADDRESS:");
  3695. r231.setBounds(951,40,200,50);
  3696. r231.setFont(new Font("Times new Roman",Font.BOLD,20));
  3697. r231.setForeground(Color.WHITE);
  3698. JTextField tf206 = new JTextField ();
  3699. tf206.setBounds(950,85,355,30);
  3700. rp31.add(tf206);
  3701. rp31.add(r231);
  3702. JLabel r232 = new JLabel ("DATE OF BIRTH:");
  3703. r232.setBounds(17,150,200,50);
  3704. r232.setFont(new Font("Times new Roman",Font.BOLD,20));
  3705. r232.setForeground(Color.WHITE);
  3706. JTextField tf207 = new JTextField ();
  3707. tf207.setBounds(15,195,210,30);
  3708. rp31.add(tf207);
  3709. rp31.add(r232);
  3710. JLabel r233 = new JLabel ("NATIONALITY:");
  3711. r233.setBounds(247,150,200,50);
  3712. r233.setFont(new Font("Times new Roman",Font.BOLD,20));
  3713. r233.setForeground(Color.WHITE);
  3714. JTextField tf208 = new JTextField ();
  3715. tf208.setBounds(245,195,210,30);
  3716. rp31.add(tf208);
  3717. rp31.add(r233);
  3718. JLabel r234 = new JLabel ("HEIGHT:");
  3719. r234.setBounds(482,150,200,50);
  3720. r234.setFont(new Font("Times new Roman",Font.BOLD,20));
  3721. r234.setForeground(Color.WHITE);
  3722. JTextField tf209 = new JTextField ();
  3723. tf209.setBounds(480,195,120,30);
  3724. rp31.add(tf209);
  3725. rp31.add(r234);
  3726. JLabel r235 = new JLabel ("WEIGHT:");
  3727. r235.setBounds(636,150,200,50);
  3728. r235.setFont(new Font("Times new Roman",Font.BOLD,20));
  3729. r235.setForeground(Color.WHITE);
  3730. JTextField tf210 = new JTextField ();
  3731. tf210.setBounds(630,195,120,30);
  3732. rp31.add(tf210);
  3733. rp31.add(r235);
  3734. JLabel r236 = new JLabel ("EYE COLOR:");
  3735. r236.setBounds(787,150,200,50);
  3736. r236.setFont(new Font("Times new Roman",Font.BOLD,20));
  3737. r236.setForeground(Color.WHITE);
  3738. JTextField tf211 = new JTextField ();
  3739. tf211.setBounds(785 ,195,190,30);
  3740. rp31.add(tf211);
  3741. rp31.add(r236);
  3742. JLabel r237 = new JLabel ("PHONE NUMBER:");
  3743. r237.setBounds(997,150,200,50);
  3744. r237.setFont(new Font("Times new Roman",Font.BOLD,20));
  3745. r237.setForeground(Color.WHITE);
  3746. JTextField tf212 = new JTextField ();
  3747. tf212.setBounds(995,195,310,30);
  3748. rp31.add(tf212);
  3749. rp31.add(r237);
  3750. JLabel r238 = new JLabel ("LANGUAGE:");
  3751. r238.setBounds(16,250,200,50);
  3752. r238.setFont(new Font("Times new Roman",Font.BOLD,20));
  3753. r238.setForeground(Color.WHITE);
  3754. JTextField tf213 = new JTextField ();
  3755. tf213.setBounds(15,295,210,30);
  3756. rp31.add(tf213);
  3757. rp31.add(r238);
  3758. JLabel r239 = new JLabel ("DATE OF CAPTURE:");
  3759. r239.setBounds(247,250,200,50);
  3760. r239.setFont(new Font("Times new Roman",Font.BOLD,20));
  3761. r239.setForeground(Color.WHITE);
  3762. JTextField tf214 = new JTextField ();
  3763. tf214.setBounds(245,295,210,30);
  3764. rp31.add(tf214);
  3765. rp31.add(r239);
  3766. JLabel r240 = new JLabel ("PLACE OF CAPTURE:");
  3767. r240.setBounds(482,250,220,50);
  3768. r240.setFont(new Font("Times new Roman",Font.BOLD,20));
  3769. r240.setForeground(Color.WHITE);
  3770. JTextField tf215 = new JTextField ();
  3771. tf215.setBounds(480,295,320,30);
  3772. rp31.add(tf215);
  3773. rp31.add(r240);
  3774. JLabel r241 = new JLabel ("CIVILLIAN OCCUPATION:");
  3775. r241.setBounds(827,250,270,50);
  3776. r241.setFont(new Font("Times new Roman",Font.BOLD,20));
  3777. r241.setForeground(Color.WHITE);
  3778. JTextField tf216 = new JTextField ();
  3779. tf216.setBounds(825,295,480,30);
  3780. rp31.add(tf216);
  3781. rp31.add(r241);
  3782. JLabel r242 = new JLabel ("PHYSICAL CONDITION:");
  3783. r242.setBounds(16,350,260,50);
  3784. r242.setFont(new Font("Times new Roman",Font.BOLD,20));
  3785. r242.setForeground(Color.WHITE);
  3786. JTextField tf217 = new JTextField ();
  3787. tf217.setBounds(15,395,260,30);
  3788. rp31.add(tf217);
  3789. rp31.add(r242);
  3790. JLabel r243 = new JLabel ("DAYS IN JAIL:");
  3791. r243.setBounds(302,350,250,50);
  3792. r243.setFont(new Font("Times new Roman",Font.BOLD,20));
  3793. r243.setForeground(Color.WHITE);
  3794. JTextField tf218 = new JTextField ();
  3795. tf218.setBounds(300,395,180,30);
  3796. rp31.add(tf218);
  3797. rp31.add(r243);
  3798. JLabel r244 = new JLabel ("ARRIVAL OF PRISONER:");
  3799. r244.setBounds(502,350,280,50);
  3800. r244.setFont(new Font("Times new Roman",Font.BOLD,20));
  3801. r244.setForeground(Color.WHITE);
  3802. JTextField tf219 = new JTextField ();
  3803. tf219.setBounds(500,395,280,30);
  3804. rp31.add(tf219);
  3805. rp31.add(r244);
  3806. JLabel r245 = new JLabel ("DATE/TIME:");
  3807. r245.setBounds(802,350,250,50);
  3808. r245.setFont(new Font("Times new Roman",Font.BOLD,20));
  3809. r245.setForeground(Color.WHITE);
  3810. JTextField tf220 = new JTextField ();
  3811. tf220.setBounds(800,395,150,30);
  3812. rp31.add(tf220);
  3813. rp31.add(r245);
  3814. JLabel r246 = new JLabel ("ARRIVAL OFFICER:");
  3815. r246.setBounds(972,350,250,50);
  3816. r246.setFont(new Font("Times new Roman",Font.BOLD,20));
  3817. r246.setForeground(Color.WHITE);
  3818. JTextField tf221 = new JTextField ();
  3819. tf221.setBounds(970,395,335,30);
  3820. rp31.add(tf221);
  3821. rp31.add(r246);
  3822. rp31.setLayout(null);
  3823.  
  3824.  
  3825. JButton Back = new JButton("Back");
  3826. Back.setBounds(1180,600,150,75);
  3827. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  3828. Back.setBackground(Color.LIGHT_GRAY);
  3829. Back.setForeground(Color.BLACK);
  3830. f20.add(Back);
  3831.  
  3832.  
  3833. Back.addKeyListener(new KeyAdapter(){
  3834. public void keyPressed(KeyEvent w){
  3835. if(w.getKeyCode()==KeyEvent.VK_B){
  3836. Back.doClick();
  3837. }
  3838. }
  3839. });
  3840. Back.addActionListener(new ActionListener() {
  3841.  
  3842. public void actionPerformed(ActionEvent e) {
  3843. f20.setVisible(false);
  3844. f10.setVisible(true);
  3845.  
  3846.  
  3847. }
  3848. });
  3849.  
  3850. //update
  3851. JButton update = new JButton("Update");
  3852. update.setBounds(820,600,150,75);
  3853. update.setFont(new Font("Times New Roman",Font.BOLD,20));
  3854. update.setBackground(Color.LIGHT_GRAY);
  3855. update.setForeground(Color.BLACK);
  3856. f20.add(update);
  3857.  
  3858.  
  3859.  
  3860. //Save
  3861. JButton Save = new JButton("Save");
  3862. Save.setBounds(1000,600,150,75);
  3863. Save.setFont(new Font("Times New Roman",Font.BOLD,20));
  3864. Save.setBackground(Color.LIGHT_GRAY);
  3865. Save.setForeground(Color.BLACK);
  3866. f20.add(Save);
  3867.  
  3868.  
  3869. u6.addKeyListener(new KeyAdapter(){
  3870. public void keyPressed(KeyEvent w){
  3871. if(w.getKeyCode()==KeyEvent.VK_E){
  3872. u6.doClick();
  3873. }
  3874. }
  3875. });
  3876. u6.addActionListener(new ActionListener() {
  3877.  
  3878. public void actionPerformed(ActionEvent e) {
  3879.  
  3880.  
  3881. f20.setVisible(true);
  3882. f10.setVisible(false);
  3883.  
  3884.  
  3885.  
  3886. }
  3887. });
  3888.  
  3889. //UPDATE FUNCTION
  3890.  
  3891. update.addKeyListener(new KeyAdapter(){
  3892. public void keyPressed(KeyEvent w){
  3893. if(w.getKeyCode()==KeyEvent.VK_U){
  3894. update.doClick();
  3895. }
  3896.  
  3897.  
  3898. }
  3899. });
  3900.  
  3901. update.addActionListener(new ActionListener(){
  3902. public void actionPerformed(ActionEvent e) {
  3903. int n = JOptionPane.showConfirmDialog(
  3904. f2, "Would you like to UPDATE This Row?",
  3905. "Are you sure?",
  3906. JOptionPane.YES_NO_OPTION);
  3907. if (n == JOptionPane.YES_OPTION){
  3908.  
  3909.  
  3910.  
  3911. f20.setVisible(false);
  3912. f10.setVisible(true);
  3913.  
  3914. JOptionPane.showMessageDialog(f10,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
  3915.  
  3916.  
  3917. }
  3918.  
  3919. }
  3920. });
  3921.  
  3922.  
  3923. //ADD FUNCTION
  3924. Save.addKeyListener(new KeyAdapter(){
  3925. public void keyPressed(KeyEvent w){
  3926. if(w.getKeyCode()==KeyEvent.VK_S){
  3927. Save.doClick();
  3928. }
  3929.  
  3930.  
  3931. }
  3932. });
  3933.  
  3934. Save.addActionListener(new ActionListener() {
  3935.  
  3936. public void actionPerformed(ActionEvent e) {
  3937. int n = JOptionPane.showConfirmDialog(
  3938. null, "Would you like to ADD This Row?",
  3939. "Are you sure?",
  3940. JOptionPane.YES_NO_OPTION);
  3941. if (n == JOptionPane.YES_OPTION){
  3942.  
  3943.  
  3944.  
  3945.  
  3946. f20.setVisible(false);
  3947. f10.setVisible(true);
  3948. JOptionPane.showMessageDialog(f10,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  3949.  
  3950. }
  3951.  
  3952. }
  3953. });
  3954.  
  3955. //DELETE FUNCTION
  3956. d6.addKeyListener(new KeyAdapter(){
  3957. public void keyPressed(KeyEvent w){
  3958. if(w.getKeyCode()==KeyEvent.VK_D){
  3959. d6.doClick();
  3960. }
  3961.  
  3962.  
  3963. }
  3964. });
  3965. d6.addActionListener(new ActionListener(){
  3966. public void actionPerformed(ActionEvent e) {
  3967. int n = JOptionPane.showConfirmDialog(
  3968. null, "Would you like to DELETE This Row?",
  3969. "Are you sure?",
  3970. JOptionPane.YES_NO_OPTION);
  3971. if (n == JOptionPane.YES_OPTION) {
  3972.  
  3973.  
  3974. JOptionPane.showMessageDialog(f10,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  3975.  
  3976. }
  3977. }
  3978.  
  3979.  
  3980.  
  3981. });
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987. }
  3988. });
  3989.  
  3990. }
  3991. });
  3992.  
  3993.  
  3994. //B7
  3995. r7.addKeyListener(new KeyAdapter(){
  3996. public void keyPressed(KeyEvent w){
  3997. if(w.getKeyCode()==KeyEvent.VK_7){
  3998. r7.doClick();
  3999. }
  4000.  
  4001.  
  4002. }
  4003. });
  4004. r7.addActionListener(new ActionListener() {
  4005.  
  4006. public void actionPerformed(ActionEvent e) {
  4007.  
  4008.  
  4009.  
  4010. Frame f11 = new JFrame();
  4011. f11.setVisible(true);
  4012. f4.setVisible(false);
  4013. f11.setSize(1366,768);
  4014. f11.setLayout(null);
  4015. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  4016. f11.setIconImage(icon.getImage());
  4017. f11.add(c5);
  4018. c5.setBounds(0,650,200,50);
  4019.  
  4020.  
  4021.  
  4022. JLabel rl7 = new JLabel("Cell Seven");
  4023. rl7.setBounds(485,30,450,70);
  4024. rl7.setFont(new Font("Times new Roman",Font.BOLD,80));
  4025. rl7.setForeground(Color.WHITE);
  4026. f11.add(rl7);
  4027.  
  4028. JButton a7 = new JButton("Add");
  4029. a7.setBounds(1180,135,150,75);
  4030. a7.setFont(new Font("Times New Roman",Font.BOLD,20));
  4031. a7.setBackground(Color.LIGHT_GRAY);
  4032. a7.setForeground(Color.BLACK);
  4033. f11.add(a7);
  4034.  
  4035.  
  4036. JButton d7 = new JButton("Delete");
  4037. d7.setBounds(1000,135,150,75);
  4038. d7.setFont(new Font("Times New Roman",Font.BOLD,20));
  4039. d7.setBackground(Color.LIGHT_GRAY);
  4040. d7.setForeground(Color.BLACK);
  4041. f11.add(d7);
  4042.  
  4043. JButton u7 = new JButton("Edit");
  4044. u7.setBounds(820,135,150,75);
  4045. u7.setFont(new Font("Times New Roman",Font.BOLD,20));
  4046. u7.setBackground(Color.LIGHT_GRAY);
  4047. u7.setForeground(Color.BLACK);
  4048. f11.add(u7);
  4049.  
  4050. JPanel rp7 = new JPanel();
  4051. f11.add(rp7);
  4052. rp7.setBounds(0,0,1366,120);
  4053. rp7.setBackground(Color.BLACK);
  4054. rp7.setBorder(BorderFactory.createEtchedBorder(1));
  4055.  
  4056. JTable table = new JTable();
  4057. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  4058. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  4059. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  4060. DefaultTableModel model = new DefaultTableModel();
  4061. model.setColumnIdentifiers(columns);
  4062. table.setModel(model);
  4063.  
  4064.  
  4065. table.setBackground(Color.LIGHT_GRAY);
  4066. table.setForeground(Color.BLACK);
  4067. Font font = (new Font("Times New Roman",Font.BOLD,20));
  4068. table.setFont(font);
  4069. table.setRowHeight(30);
  4070.  
  4071. //JScrollPane
  4072. JScrollPane pane = new JScrollPane(table);
  4073. pane.setBounds(0,230,1366,350);
  4074. f11.add(pane);
  4075.  
  4076.  
  4077.  
  4078. JButton Back = new JButton("Back");
  4079. Back.setBounds(1180,600,150,75);
  4080. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  4081. Back.setBackground(Color.LIGHT_GRAY);
  4082. Back.setForeground(Color.BLACK);
  4083. f11.add(Back);
  4084.  
  4085. Back.addKeyListener(new KeyAdapter(){
  4086. public void keyPressed(KeyEvent w){
  4087. if(w.getKeyCode()==KeyEvent.VK_B){
  4088. Back.doClick();
  4089. }
  4090.  
  4091.  
  4092. }
  4093. });
  4094.  
  4095. Back.addActionListener(new ActionListener() {
  4096.  
  4097. public void actionPerformed(ActionEvent e) {
  4098. f11.setVisible(false);
  4099. f4.setVisible(true);
  4100.  
  4101.  
  4102. }
  4103. });
  4104.  
  4105. //ADD-7
  4106.  
  4107. a7.addKeyListener(new KeyAdapter(){
  4108. public void keyPressed(KeyEvent w){
  4109. if(w.getKeyCode()==KeyEvent.VK_A){
  4110. a7.doClick();
  4111. }
  4112.  
  4113.  
  4114. }
  4115. });
  4116. a7.addActionListener(new ActionListener() {
  4117.  
  4118. public void actionPerformed(ActionEvent e) {
  4119.  
  4120. Frame f21 = new JFrame();
  4121. f21.setVisible(true);
  4122. f11.setVisible(false);
  4123. f21.setSize(1366,768);
  4124. f21.setLayout(null);
  4125. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  4126. f21.setIconImage(icon.getImage());
  4127. f21.add(c5);
  4128. c5.setBounds(0,650,200,50);
  4129.  
  4130.  
  4131.  
  4132. JPanel rp22 = new JPanel();
  4133. rp22.setBounds(0,0,1366,120);
  4134. rp22.setBackground(Color.BLACK);
  4135. rp22.setBorder(BorderFactory.createEtchedBorder(1));
  4136. f21.add(rp22);
  4137.  
  4138.  
  4139. JLabel r21 = new JLabel("Prisoner Fill Up Form");
  4140. r21.setBounds(485,30,450,70);
  4141. r21.setFont(new Font("Times new Roman",Font.BOLD,80));
  4142. r21.setForeground(Color.WHITE);
  4143. rp22.add(r21);
  4144.  
  4145. JPanel rp32 = new JPanel();
  4146. rp32.setBounds(12,130,1325,450);
  4147. rp32.setBackground(Color.BLACK);
  4148. rp32.setBorder(BorderFactory.createEtchedBorder());
  4149. f21.add(rp32);
  4150.  
  4151. JLabel r144 = new JLabel();
  4152. r144.setBounds(15,15,130,130);
  4153. r144.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
  4154. rp32.add(r144);
  4155.  
  4156.  
  4157. //Prisoner aydi:
  4158.  
  4159.  
  4160. JLabel r247 = new JLabel ("FIRSTNAME:");
  4161. r247.setBounds(183,40,200,50);
  4162. r247.setFont(new Font("Times new Roman",Font.BOLD,20));
  4163. r247.setForeground(Color.WHITE);
  4164. JTextField tf222 = new JTextField ();
  4165. tf222.setBounds(180,85,210,30);
  4166. rp32.add(tf222);
  4167. rp32.add(r247);
  4168. JLabel r248 = new JLabel ("MI:");
  4169. r248.setBounds(413,40,200,50);
  4170. r248.setFont(new Font("Times new Roman",Font.BOLD,20));
  4171. r248.setForeground(Color.WHITE);
  4172. JTextField tf223 = new JTextField ();
  4173. tf223.setBounds(410,85,80,30);
  4174. rp32.add(tf223);
  4175. rp32.add(r248);
  4176. JLabel r249 = new JLabel ("LASTNAME:");
  4177. r249.setBounds(518,40,200,50);
  4178. r249.setFont(new Font("Times new Roman",Font.BOLD,20));
  4179. r249.setForeground(Color.WHITE);
  4180. JTextField tf224 = new JTextField ();
  4181. tf224.setBounds(515,85,210,30);
  4182. rp32.add(tf224);
  4183. rp32.add(r249);
  4184. JLabel r250 = new JLabel ("SEX:");
  4185. r250.setBounds(751,40,200,50);
  4186. r250.setFont(new Font("Times new Roman",Font.BOLD,20));
  4187. r250.setForeground(Color.WHITE);
  4188. JTextField tf225 = new JTextField ();
  4189. tf225.setBounds(750,85,90,30);
  4190. rp32.add(tf225);
  4191. rp32.add(r250);
  4192. JLabel r251 = new JLabel ("AGE:");
  4193. r251.setBounds(861,40,200,50);
  4194. r251.setFont(new Font("Times new Roman",Font.BOLD,20));
  4195. r251.setForeground(Color.WHITE);
  4196. JTextField tf226 = new JTextField ();
  4197. tf226.setBounds(860,85,60,30);
  4198. rp32.add(tf226);
  4199. rp32.add(r251);
  4200. JLabel r252 = new JLabel ("ADDRESS:");
  4201. r252.setBounds(951,40,200,50);
  4202. r252.setFont(new Font("Times new Roman",Font.BOLD,20));
  4203. r252.setForeground(Color.WHITE);
  4204. JTextField tf227 = new JTextField ();
  4205. tf227.setBounds(950,85,355,30);
  4206. rp32.add(tf227);
  4207. rp32.add(r252);
  4208. JLabel r253 = new JLabel ("DATE OF BIRTH:");
  4209. r253.setBounds(17,150,200,50);
  4210. r253.setFont(new Font("Times new Roman",Font.BOLD,20));
  4211. r253.setForeground(Color.WHITE);
  4212. JTextField tf228 = new JTextField ();
  4213. tf228.setBounds(15,195,210,30);
  4214. rp32.add(tf228);
  4215. rp32.add(r253);
  4216. JLabel r254 = new JLabel ("NATIONALITY:");
  4217. r254.setBounds(247,150,200,50);
  4218. r254.setFont(new Font("Times new Roman",Font.BOLD,20));
  4219. r254.setForeground(Color.WHITE);
  4220. JTextField tf229 = new JTextField ();
  4221. tf229.setBounds(245,195,210,30);
  4222. rp32.add(tf229);
  4223. rp32.add(r254);
  4224. JLabel r255 = new JLabel ("HEIGHT:");
  4225. r255.setBounds(482,150,200,50);
  4226. r255.setFont(new Font("Times new Roman",Font.BOLD,20));
  4227. r255.setForeground(Color.WHITE);
  4228. JTextField tf230 = new JTextField ();
  4229. tf230.setBounds(480,195,120,30);
  4230. rp32.add(tf230);
  4231. rp32.add(r255);
  4232. JLabel r256 = new JLabel ("WEIGHT:");
  4233. r256.setBounds(636,150,200,50);
  4234. r256.setFont(new Font("Times new Roman",Font.BOLD,20));
  4235. r256.setForeground(Color.WHITE);
  4236. JTextField tf231 = new JTextField ();
  4237. tf231.setBounds(630,195,120,30);
  4238. rp32.add(tf231);
  4239. rp32.add(r256);
  4240. JLabel r257 = new JLabel ("EYE COLOR:");
  4241. r257.setBounds(787,150,200,50);
  4242. r257.setFont(new Font("Times new Roman",Font.BOLD,20));
  4243. r257.setForeground(Color.WHITE);
  4244. JTextField tf232 = new JTextField ();
  4245. tf232.setBounds(785 ,195,190,30);
  4246. rp32.add(tf232);
  4247. rp32.add(r257);
  4248. JLabel r258 = new JLabel ("PHONE NUMBER:");
  4249. r258.setBounds(997,150,200,50);
  4250. r258.setFont(new Font("Times new Roman",Font.BOLD,20));
  4251. r258.setForeground(Color.WHITE);
  4252. JTextField tf233 = new JTextField ();
  4253. tf233.setBounds(995,195,310,30);
  4254. rp32.add(tf233);
  4255. rp32.add(r258);
  4256. JLabel r259 = new JLabel ("LANGUAGE:");
  4257. r259.setBounds(16,250,200,50);
  4258. r259.setFont(new Font("Times new Roman",Font.BOLD,20));
  4259. r259.setForeground(Color.WHITE);
  4260. JTextField tf234 = new JTextField ();
  4261. tf234.setBounds(15,295,210,30);
  4262. rp32.add(tf234);
  4263. rp32.add(r259);
  4264. JLabel r260 = new JLabel ("DATE OF CAPTURE:");
  4265. r260.setBounds(247,250,200,50);
  4266. r260.setFont(new Font("Times new Roman",Font.BOLD,20));
  4267. r260.setForeground(Color.WHITE);
  4268. JTextField tf235 = new JTextField ();
  4269. tf235.setBounds(245,295,210,30);
  4270. rp32.add(tf235);
  4271. rp32.add(r260);
  4272. JLabel r261 = new JLabel ("PLACE OF CAPTURE:");
  4273. r261.setBounds(482,250,220,50);
  4274. r261.setFont(new Font("Times new Roman",Font.BOLD,20));
  4275. r261.setForeground(Color.WHITE);
  4276. JTextField tf236 = new JTextField ();
  4277. tf236.setBounds(480,295,320,30);
  4278. rp32.add(tf236);
  4279. rp32.add(r261);
  4280. JLabel r262 = new JLabel ("CIVILLIAN OCCUPATION:");
  4281. r262.setBounds(827,250,270,50);
  4282. r262.setFont(new Font("Times new Roman",Font.BOLD,20));
  4283. r262.setForeground(Color.WHITE);
  4284. JTextField tf237 = new JTextField ();
  4285. tf237.setBounds(825,295,480,30);
  4286. rp32.add(tf237);
  4287. rp32.add(r262);
  4288. JLabel r263 = new JLabel ("PHYSICAL CONDITION:");
  4289. r263.setBounds(16,350,260,50);
  4290. r263.setFont(new Font("Times new Roman",Font.BOLD,20));
  4291. r263.setForeground(Color.WHITE);
  4292. JTextField tf238 = new JTextField ();
  4293. tf238.setBounds(15,395,260,30);
  4294. rp32.add(tf238);
  4295. rp32.add(r263);
  4296. JLabel r264 = new JLabel ("DAYS IN JAIL:");
  4297. r264.setBounds(302,350,250,50);
  4298. r264.setFont(new Font("Times new Roman",Font.BOLD,20));
  4299. r264.setForeground(Color.WHITE);
  4300. JTextField tf239 = new JTextField ();
  4301. tf239.setBounds(300,395,180,30);
  4302. rp32.add(tf239);
  4303. rp32.add(r264);
  4304. JLabel r265 = new JLabel ("ARRIVAL OF PRISONER:");
  4305. r265.setBounds(502,350,280,50);
  4306. r265.setFont(new Font("Times new Roman",Font.BOLD,20));
  4307. r265.setForeground(Color.WHITE);
  4308. JTextField tf240 = new JTextField ();
  4309. tf240.setBounds(500,395,280,30);
  4310. rp32.add(tf240);
  4311. rp32.add(r265);
  4312. JLabel r266 = new JLabel ("DATE/TIME:");
  4313. r266.setBounds(802,350,250,50);
  4314. r266.setFont(new Font("Times new Roman",Font.BOLD,20));
  4315. r266.setForeground(Color.WHITE);
  4316. JTextField tf241 = new JTextField ();
  4317. tf241.setBounds(800,395,150,30);
  4318. rp32.add(tf241);
  4319. rp32.add(r266);
  4320. JLabel r267 = new JLabel ("ARRIVAL OFFICER:");
  4321. r267.setBounds(972,350,250,50);
  4322. r267.setFont(new Font("Times new Roman",Font.BOLD,20));
  4323. r267.setForeground(Color.WHITE);
  4324. JTextField tf242 = new JTextField ();
  4325. tf242.setBounds(970,395,335,30);
  4326. rp32.add(tf242);
  4327. rp32.add(r267);
  4328. rp32.setLayout(null);
  4329.  
  4330.  
  4331. JButton Back = new JButton("Back");
  4332. Back.setBounds(1180,600,150,75);
  4333. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  4334. Back.setBackground(Color.LIGHT_GRAY);
  4335. Back.setForeground(Color.BLACK);
  4336. f21.add(Back);
  4337.  
  4338.  
  4339.  
  4340. Back.addKeyListener(new KeyAdapter(){
  4341. public void keyPressed(KeyEvent w){
  4342. if(w.getKeyCode()==KeyEvent.VK_B){
  4343. Back.doClick();
  4344. }
  4345.  
  4346.  
  4347. }
  4348. });
  4349. Back.addActionListener(new ActionListener() {
  4350.  
  4351. public void actionPerformed(ActionEvent e) {
  4352. f21.setVisible(false);
  4353. f11.setVisible(true);
  4354.  
  4355.  
  4356. }
  4357. });
  4358.  
  4359. //update
  4360. JButton update = new JButton("Update");
  4361. update.setBounds(820,600,150,75);
  4362. update.setFont(new Font("Times New Roman",Font.BOLD,20));
  4363. update.setBackground(Color.LIGHT_GRAY);
  4364. update.setForeground(Color.BLACK);
  4365. f21.add(update);
  4366.  
  4367.  
  4368.  
  4369. //Save
  4370. JButton Save = new JButton("Save");
  4371. Save.setBounds(1000,600,150,75);
  4372. Save.setFont(new Font("Times New Roman",Font.BOLD,20));
  4373. Save.setBackground(Color.LIGHT_GRAY);
  4374. Save.setForeground(Color.BLACK);
  4375. f21.add(Save);
  4376.  
  4377.  
  4378. u7.addKeyListener(new KeyAdapter(){
  4379. public void keyPressed(KeyEvent w){
  4380. if(w.getKeyCode()==KeyEvent.VK_E){
  4381. u7.doClick();
  4382. }
  4383.  
  4384.  
  4385. }
  4386. });
  4387. u7.addActionListener(new ActionListener() {
  4388.  
  4389. public void actionPerformed(ActionEvent e) {
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396. f21.setVisible(true);
  4397. f11.setVisible(false);
  4398.  
  4399.  
  4400.  
  4401.  
  4402. }
  4403. });
  4404.  
  4405. //UPDATE FUNCTION
  4406.  
  4407. update.addKeyListener(new KeyAdapter(){
  4408. public void keyPressed(KeyEvent w){
  4409. if(w.getKeyCode()==KeyEvent.VK_U){
  4410. update.doClick();
  4411. }
  4412.  
  4413.  
  4414. }
  4415. });
  4416. update.addActionListener(new ActionListener(){
  4417. public void actionPerformed(ActionEvent e) {
  4418. int n = JOptionPane.showConfirmDialog(
  4419. null, "Would you like to UPDATE This Row?",
  4420. "Are you sure?",
  4421. JOptionPane.YES_NO_OPTION);
  4422. if (n == JOptionPane.YES_OPTION){
  4423.  
  4424.  
  4425. JOptionPane.showMessageDialog(f11,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
  4426.  
  4427.  
  4428. }
  4429.  
  4430. }
  4431. });
  4432.  
  4433.  
  4434. //ADD FUNCTION
  4435.  
  4436. Save.addKeyListener(new KeyAdapter(){
  4437. public void keyPressed(KeyEvent w){
  4438. if(w.getKeyCode()==KeyEvent.VK_S){
  4439. Save.doClick();
  4440. }
  4441.  
  4442.  
  4443. }
  4444. });
  4445. Save.addActionListener(new ActionListener() {
  4446.  
  4447. public void actionPerformed(ActionEvent e) {
  4448. int n = JOptionPane.showConfirmDialog(
  4449. null, "Would you like to ADD This Row?",
  4450. "Are you sure?",
  4451. JOptionPane.YES_NO_OPTION);
  4452. if (n == JOptionPane.YES_OPTION){
  4453.  
  4454.  
  4455.  
  4456.  
  4457. f21.setVisible(false);
  4458. f11.setVisible(true);
  4459. JOptionPane.showMessageDialog(f11,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  4460.  
  4461. }
  4462.  
  4463. }
  4464. });
  4465.  
  4466. //DELETE FUNCTION
  4467.  
  4468. d7.addKeyListener(new KeyAdapter(){
  4469. public void keyPressed(KeyEvent w){
  4470. if(w.getKeyCode()==KeyEvent.VK_D){
  4471. d7.doClick();
  4472. }
  4473.  
  4474.  
  4475. }
  4476. });
  4477. d7.addActionListener(new ActionListener(){
  4478. public void actionPerformed(ActionEvent e) {
  4479. int n = JOptionPane.showConfirmDialog(
  4480. null, "Would you like to DELETE This Row?",
  4481. "Are you sure?",
  4482. JOptionPane.YES_NO_OPTION);
  4483. if (n == JOptionPane.YES_OPTION) {
  4484.  
  4485.  
  4486. JOptionPane.showMessageDialog(f11,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  4487.  
  4488. }
  4489. }
  4490.  
  4491.  
  4492.  
  4493. });
  4494.  
  4495.  
  4496.  
  4497.  
  4498.  
  4499. }
  4500. });
  4501.  
  4502. }
  4503. });
  4504.  
  4505. //B8
  4506.  
  4507.  
  4508. r8.addKeyListener(new KeyAdapter(){
  4509. public void keyPressed(KeyEvent w){
  4510. if(w.getKeyCode()==KeyEvent.VK_8){
  4511. r8.doClick();
  4512. }
  4513.  
  4514.  
  4515. }
  4516. });
  4517.  
  4518. r8.addActionListener(new ActionListener() {
  4519.  
  4520. public void actionPerformed(ActionEvent e) {
  4521.  
  4522. Frame f12 = new JFrame();
  4523. f12.setVisible(true);
  4524. f4.setVisible(false);
  4525. f12.setSize(1366,768);
  4526. f12.setLayout(null);
  4527. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  4528. f12.setIconImage(icon.getImage());
  4529. f12.add(c5);
  4530. c5.setBounds(0,650,200,50);
  4531.  
  4532.  
  4533. JLabel rl8 = new JLabel("Cell Eight");
  4534. rl8.setBounds(485,30,450,70);
  4535. rl8.setFont(new Font("Times new Roman",Font.BOLD,80));
  4536. rl8.setForeground(Color.WHITE);
  4537. f12.add(rl8);
  4538.  
  4539. JButton a8 = new JButton("Add");
  4540. a8.setBounds(1180,135,150,75);
  4541. a8.setFont(new Font("Times New Roman",Font.BOLD,20));
  4542. a8.setBackground(Color.LIGHT_GRAY);
  4543. a8.setForeground(Color.BLACK);
  4544.  
  4545. f12.add(a8);
  4546.  
  4547.  
  4548. JButton d8 = new JButton("Delete");
  4549. d8.setBounds(1000,135,150,75);
  4550. d8.setFont(new Font("Times New Roman",Font.BOLD,20));
  4551. d8.setBackground(Color.LIGHT_GRAY);
  4552. d8.setForeground(Color.BLACK);
  4553. f12.add(d8);
  4554.  
  4555. JButton u8 = new JButton("Edit");
  4556. u8.setBounds(820,135,150,75);
  4557. u8.setFont(new Font("Times New Roman",Font.BOLD,20));
  4558. u8.setBackground(Color.LIGHT_GRAY);
  4559. u8.setForeground(Color.BLACK);
  4560. f12.add(u8);
  4561.  
  4562. JPanel rp8 = new JPanel();
  4563. f12.add(rp8);
  4564. rp8.setBounds(0,0,1366,120);
  4565. rp8.setBackground(Color.BLACK);
  4566. rp8.setBorder(BorderFactory.createEtchedBorder(1));
  4567.  
  4568. JTable table = new JTable();
  4569. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  4570. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  4571. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  4572. DefaultTableModel model = new DefaultTableModel();
  4573. model.setColumnIdentifiers(columns);
  4574. table.setModel(model);
  4575.  
  4576.  
  4577. table.setBackground(Color.LIGHT_GRAY);
  4578. table.setForeground(Color.BLACK);
  4579. Font font =(new Font("Times New Roman",Font.BOLD,20));
  4580. table.setFont(font);
  4581. table.setRowHeight(30);
  4582.  
  4583. //JScrollPane
  4584. JScrollPane pane = new JScrollPane(table);
  4585. pane.setBounds(0,230,1366,350);
  4586. f12.add(pane);
  4587.  
  4588.  
  4589.  
  4590. JButton Back = new JButton("Back");
  4591. Back.setBounds(1180,600,150,75);
  4592. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  4593. Back.setBackground(Color.LIGHT_GRAY);
  4594. Back.setForeground(Color.BLACK);
  4595. f12.add(Back);
  4596.  
  4597.  
  4598. Back.addKeyListener(new KeyAdapter(){
  4599. public void keyPressed(KeyEvent w){
  4600. if(w.getKeyCode()==KeyEvent.VK_B){
  4601. Back.doClick();
  4602. }
  4603.  
  4604.  
  4605. }
  4606. });
  4607.  
  4608. Back.addActionListener(new ActionListener() {
  4609.  
  4610. public void actionPerformed(ActionEvent e) {
  4611. f12.setVisible(false);
  4612. f4.setVisible(true);
  4613.  
  4614.  
  4615. }
  4616. });
  4617.  
  4618. //ADD-8
  4619.  
  4620.  
  4621. a8.addKeyListener(new KeyAdapter(){
  4622. public void keyPressed(KeyEvent w){
  4623. if(w.getKeyCode()==KeyEvent.VK_A){
  4624. a8.doClick();
  4625. }
  4626.  
  4627.  
  4628. }
  4629. });
  4630.  
  4631. a8.addActionListener(new ActionListener() {
  4632.  
  4633. public void actionPerformed(ActionEvent e) {
  4634.  
  4635. Frame f22 = new JFrame();
  4636. f22.setVisible(true);
  4637. f12.setVisible(false);
  4638. f22.setSize(1366,768);
  4639. f22.setLayout(null);
  4640. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  4641. f22.setIconImage(icon.getImage());
  4642. f22.add(c5);
  4643. c5.setBounds(0,650,200,50);
  4644.  
  4645.  
  4646.  
  4647. JPanel rp23 = new JPanel();
  4648. rp23.setBounds(0,0,1366,120);
  4649. rp23.setBackground(Color.BLACK);
  4650. rp23.setBorder(BorderFactory.createEtchedBorder(1));
  4651. f22.add(rp23);
  4652.  
  4653.  
  4654. JLabel r22 = new JLabel("Prisoner Fill Up Form");
  4655. r22.setBounds(485,30,450,70);
  4656. r22.setFont(new Font("Times new Roman",Font.BOLD,80));
  4657. r22.setForeground(Color.WHITE);
  4658. rp23.add(r22);
  4659.  
  4660. JPanel rp33 = new JPanel();
  4661. rp33.setBounds(12,130,1325,450);
  4662. rp33.setBackground(Color.BLACK);
  4663. rp33.setBorder(BorderFactory.createEtchedBorder());
  4664. f22.add(rp33);
  4665.  
  4666. JLabel r146 = new JLabel();
  4667. r146.setBounds(15,15,130,130);
  4668. r146.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
  4669. rp33.add(r146);
  4670.  
  4671.  
  4672. //Prisoner aydi:
  4673.  
  4674.  
  4675. JLabel r268 = new JLabel ("FIRSTNAME:");
  4676. r268.setBounds(183,40,200,50);
  4677. r268.setFont(new Font("Times new Roman",Font.BOLD,20));
  4678. r268.setForeground(Color.WHITE);
  4679. JTextField tf243 = new JTextField ();
  4680. tf243.setBounds(180,85,210,30);
  4681. rp33.add(tf243);
  4682. rp33.add(r268);
  4683. JLabel r269 = new JLabel ("MI:");
  4684. r269.setBounds(413,40,200,50);
  4685. r269.setFont(new Font("Times new Roman",Font.BOLD,20));
  4686. r269.setForeground(Color.WHITE);
  4687. JTextField tf244 = new JTextField ();
  4688. tf244.setBounds(410,85,80,30);
  4689. rp33.add(tf244);
  4690. rp33.add(r269);
  4691. JLabel r270 = new JLabel ("LASTNAME:");
  4692. r270.setBounds(518,40,200,50);
  4693. r270.setFont(new Font("Times new Roman",Font.BOLD,20));
  4694. r270.setForeground(Color.WHITE);
  4695. JTextField tf245 = new JTextField ();
  4696. tf245.setBounds(515,85,210,30);
  4697. rp33.add(tf245);
  4698. rp33.add(r270);
  4699. JLabel r271 = new JLabel ("SEX:");
  4700. r271.setBounds(751,40,200,50);
  4701. r271.setFont(new Font("Times new Roman",Font.BOLD,20));
  4702. r271.setForeground(Color.WHITE);
  4703. JTextField tf246 = new JTextField ();
  4704. tf246.setBounds(750,85,90,30);
  4705. rp33.add(tf246);
  4706. rp33.add(r271);
  4707. JLabel r272 = new JLabel ("AGE:");
  4708. r272.setBounds(861,40,200,50);
  4709. r272.setFont(new Font("Times new Roman",Font.BOLD,20));
  4710. r272.setForeground(Color.WHITE);
  4711. JTextField tf247 = new JTextField ();
  4712. tf247.setBounds(860,85,60,30);
  4713. rp33.add(tf247);
  4714. rp33.add(r272);
  4715. JLabel r273 = new JLabel ("ADDRESS:");
  4716. r273.setBounds(951,40,200,50);
  4717. r273.setFont(new Font("Times new Roman",Font.BOLD,20));
  4718. r273.setForeground(Color.WHITE);
  4719. JTextField tf248 = new JTextField ();
  4720. tf248.setBounds(950,85,355,30);
  4721. rp33.add(tf248);
  4722. rp33.add(r273);
  4723. JLabel r274 = new JLabel ("DATE OF BIRTH:");
  4724. r274.setBounds(17,150,200,50);
  4725. r274.setFont(new Font("Times new Roman",Font.BOLD,20));
  4726. r274.setForeground(Color.WHITE);
  4727. JTextField tf249 = new JTextField ();
  4728. tf249.setBounds(15,195,210,30);
  4729. rp33.add(tf249);
  4730. rp33.add(r274);
  4731. JLabel r275 = new JLabel ("NATIONALITY:");
  4732. r275.setBounds(247,150,200,50);
  4733. r275.setFont(new Font("Times new Roman",Font.BOLD,20));
  4734. r275.setForeground(Color.WHITE);
  4735. JTextField tf250 = new JTextField ();
  4736. tf250.setBounds(245,195,210,30);
  4737. rp33.add(tf250);
  4738. rp33.add(r275);
  4739. JLabel r276 = new JLabel ("HEIGHT:");
  4740. r276.setBounds(482,150,200,50);
  4741. r276.setFont(new Font("Times new Roman",Font.BOLD,20));
  4742. r276.setForeground(Color.WHITE);
  4743. JTextField tf251 = new JTextField ();
  4744. tf251.setBounds(480,195,120,30);
  4745. rp33.add(tf251);
  4746. rp33.add(r276);
  4747. JLabel r277 = new JLabel ("WEIGHT:");
  4748. r277.setBounds(636,150,200,50);
  4749. r277.setFont(new Font("Times new Roman",Font.BOLD,20));
  4750. r277.setForeground(Color.WHITE);
  4751. JTextField tf252 = new JTextField ();
  4752. tf252.setBounds(630,195,120,30);
  4753. rp33.add(tf252);
  4754. rp33.add(r277);
  4755. JLabel r278 = new JLabel ("EYE COLOR:");
  4756. r278.setBounds(787,150,200,50);
  4757. r278.setFont(new Font("Times new Roman",Font.BOLD,20));
  4758. r278.setForeground(Color.WHITE);
  4759. JTextField tf253 = new JTextField ();
  4760. tf253.setBounds(785 ,195,190,30);
  4761. rp33.add(tf253);
  4762. rp33.add(r278);
  4763. JLabel r279 = new JLabel ("PHONE NUMBER:");
  4764. r279.setBounds(997,150,200,50);
  4765. r279.setFont(new Font("Times new Roman",Font.BOLD,20));
  4766. r279.setForeground(Color.WHITE);
  4767. JTextField tf254 = new JTextField ();
  4768. tf254.setBounds(995,195,310,30);
  4769. rp33.add(tf254);
  4770. rp33.add(r279);
  4771. JLabel r280 = new JLabel ("LANGUAGE:");
  4772. r280.setBounds(16,250,200,50);
  4773. r280.setFont(new Font("Times new Roman",Font.BOLD,20));
  4774. r280.setForeground(Color.WHITE);
  4775. JTextField tf255 = new JTextField ();
  4776. tf255.setBounds(15,295,210,30);
  4777. rp33.add(tf255);
  4778. rp33.add(r280);
  4779. JLabel r281 = new JLabel ("DATE OF CAPTURE:");
  4780. r281.setBounds(247,250,200,50);
  4781. r281.setFont(new Font("Times new Roman",Font.BOLD,20));
  4782. r281.setForeground(Color.WHITE);
  4783. JTextField tf256 = new JTextField ();
  4784. tf256.setBounds(245,295,210,30);
  4785. rp33.add(tf256);
  4786. rp33.add(r281);
  4787. JLabel r282 = new JLabel ("PLACE OF CAPTURE:");
  4788. r282.setBounds(482,250,220,50);
  4789. r282.setFont(new Font("Times new Roman",Font.BOLD,20));
  4790. r282.setForeground(Color.WHITE);
  4791. JTextField tf257 = new JTextField ();
  4792. tf257.setBounds(480,295,320,30);
  4793. rp33.add(tf257);
  4794. rp33.add(r282);
  4795. JLabel r283 = new JLabel ("CIVILLIAN OCCUPATION:");
  4796. r283.setBounds(827,250,270,50);
  4797. r283.setFont(new Font("Times new Roman",Font.BOLD,20));
  4798. r283.setForeground(Color.WHITE);
  4799. JTextField tf258 = new JTextField ();
  4800. tf258.setBounds(825,295,480,30);
  4801. rp33.add(tf258);
  4802. rp33.add(r283);
  4803. JLabel r284 = new JLabel ("PHYSICAL CONDITION:");
  4804. r284.setBounds(16,350,260,50);
  4805. r284.setFont(new Font("Times new Roman",Font.BOLD,20));
  4806. r284.setForeground(Color.WHITE);
  4807. JTextField tf259 = new JTextField ();
  4808. tf259.setBounds(15,395,260,30);
  4809. rp33.add(tf259);
  4810. rp33.add(r284);
  4811. JLabel r285 = new JLabel ("DAYS IN JAIL:");
  4812. r285.setBounds(302,350,250,50);
  4813. r285.setFont(new Font("Times new Roman",Font.BOLD,20));
  4814. r285.setForeground(Color.WHITE);
  4815. JTextField tf260 = new JTextField ();
  4816. tf260.setBounds(300,395,180,30);
  4817. rp33.add(tf260);
  4818. rp33.add(r285);
  4819. JLabel r286 = new JLabel ("ARRIVAL OF PRISONER:");
  4820. r286.setBounds(502,350,280,50);
  4821. r286.setFont(new Font("Times new Roman",Font.BOLD,20));
  4822. r286.setForeground(Color.WHITE);
  4823. JTextField tf261 = new JTextField ();
  4824. tf261.setBounds(500,395,280,30);
  4825. rp33.add(tf261);
  4826. rp33.add(r286);
  4827. JLabel r287 = new JLabel ("DATE/TIME:");
  4828. r287.setBounds(802,350,250,50);
  4829. r287.setFont(new Font("Times new Roman",Font.BOLD,20));
  4830. r287.setForeground(Color.WHITE);
  4831. JTextField tf262 = new JTextField ();
  4832. tf262.setBounds(800,395,150,30);
  4833. rp33.add(tf262);
  4834. rp33.add(r287);
  4835. JLabel r288 = new JLabel ("ARRIVAL OFFICER:");
  4836. r288.setBounds(972,350,250,50);
  4837. r288.setFont(new Font("Times new Roman",Font.BOLD,20));
  4838. r288.setForeground(Color.WHITE);
  4839. JTextField tf263 = new JTextField ();
  4840. tf263.setBounds(970,395,335,30);
  4841. rp33.add(tf263);
  4842. rp33.add(r288);
  4843. rp33.setLayout(null);
  4844.  
  4845.  
  4846. JButton Back = new JButton("Back");
  4847. Back.setBounds(1180,600,150,75);
  4848. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  4849. Back.setBackground(Color.LIGHT_GRAY);
  4850. Back.setForeground(Color.BLACK);
  4851. f22.add(Back);
  4852.  
  4853.  
  4854. Back.addKeyListener(new KeyAdapter(){
  4855. public void keyPressed(KeyEvent w){
  4856. if(w.getKeyCode()==KeyEvent.VK_B){
  4857. Back.doClick();
  4858. }
  4859.  
  4860.  
  4861. }
  4862. });
  4863.  
  4864.  
  4865.  
  4866. Back.addActionListener(new ActionListener() {
  4867.  
  4868. public void actionPerformed(ActionEvent e) {
  4869. f22.setVisible(false);
  4870. f12.setVisible(true);
  4871.  
  4872.  
  4873. }
  4874. });
  4875.  
  4876. //update
  4877. JButton update = new JButton("Update");
  4878. update.setBounds(820,600,150,75);
  4879. update.setFont(new Font("Times New Roman",Font.BOLD,20));
  4880. update.setBackground(Color.LIGHT_GRAY);
  4881. update.setForeground(Color.BLACK);
  4882. f22.add(update);
  4883.  
  4884.  
  4885.  
  4886. //Save
  4887. JButton Save = new JButton("Save");
  4888. Save.setBounds(1000,600,150,75);
  4889. Save.setFont(new Font("Times New Roman",Font.BOLD,20));
  4890. Save.setBackground(Color.LIGHT_GRAY);
  4891. Save.setForeground(Color.BLACK);
  4892. f22.add(Save);
  4893.  
  4894.  
  4895.  
  4896. u8.addKeyListener(new KeyAdapter(){
  4897. public void keyPressed(KeyEvent w){
  4898. if(w.getKeyCode()==KeyEvent.VK_E){
  4899. u8.doClick();
  4900. }
  4901.  
  4902.  
  4903. }
  4904. });
  4905. u8.addActionListener(new ActionListener() {
  4906.  
  4907. public void actionPerformed(ActionEvent e) {
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914. f22.setVisible(true);
  4915. f12.setVisible(false);
  4916.  
  4917.  
  4918.  
  4919.  
  4920. }
  4921. });
  4922.  
  4923.  
  4924. //UPDATE FUNCTION
  4925. update.addKeyListener(new KeyAdapter(){
  4926. public void keyPressed(KeyEvent w){
  4927. if(w.getKeyCode()==KeyEvent.VK_U){
  4928. update.doClick();
  4929. }
  4930.  
  4931.  
  4932. }
  4933. });
  4934. update.addActionListener(new ActionListener(){
  4935. public void actionPerformed(ActionEvent e) {
  4936. int n = JOptionPane.showConfirmDialog(
  4937. null, "Would you like to UPDATE This Row?",
  4938. "Are you sure?",
  4939. JOptionPane.YES_NO_OPTION);
  4940. if (n == JOptionPane.YES_OPTION){
  4941.  
  4942.  
  4943.  
  4944. f22.setVisible(false);
  4945. f12.setVisible(true);
  4946.  
  4947. JOptionPane.showMessageDialog(f12,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
  4948.  
  4949.  
  4950. }
  4951.  
  4952. }
  4953. });
  4954.  
  4955.  
  4956. //ADD FUNCTION
  4957. Save.addKeyListener(new KeyAdapter(){
  4958. public void keyPressed(KeyEvent w){
  4959. if(w.getKeyCode()==KeyEvent.VK_S){
  4960. Save.doClick();
  4961. }
  4962.  
  4963.  
  4964. }
  4965. });
  4966. Save.addActionListener(new ActionListener() {
  4967.  
  4968. public void actionPerformed(ActionEvent e) {
  4969. int n = JOptionPane.showConfirmDialog(
  4970. null, "Would you like to ADD This Row?",
  4971. "Are you sure?",
  4972. JOptionPane.YES_NO_OPTION);
  4973. if (n == JOptionPane.YES_OPTION){
  4974.  
  4975.  
  4976.  
  4977.  
  4978. f22.setVisible(false);
  4979. f12.setVisible(true);
  4980. JOptionPane.showMessageDialog(f12,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  4981.  
  4982. }
  4983.  
  4984. }
  4985. });
  4986.  
  4987. //DELETE FUNCTION
  4988. d8.addKeyListener(new KeyAdapter(){
  4989. public void keyPressed(KeyEvent w){
  4990. if(w.getKeyCode()==KeyEvent.VK_D){
  4991. d8.doClick();
  4992. }
  4993.  
  4994.  
  4995. }
  4996. });
  4997. d8.addActionListener(new ActionListener(){
  4998. public void actionPerformed(ActionEvent e) {
  4999. int n = JOptionPane.showConfirmDialog(
  5000. null, "Would you like to DELETE This Row?",
  5001. "Are you sure?",
  5002. JOptionPane.YES_NO_OPTION);
  5003. if (n == JOptionPane.YES_OPTION) {
  5004.  
  5005.  
  5006. JOptionPane.showMessageDialog(f12,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  5007.  
  5008.  
  5009. }
  5010.  
  5011. }
  5012.  
  5013. });
  5014.  
  5015.  
  5016.  
  5017.  
  5018. }
  5019. });
  5020.  
  5021. }
  5022. });
  5023.  
  5024. //B9
  5025.  
  5026. r9.addKeyListener(new KeyAdapter(){
  5027. public void keyPressed(KeyEvent w){
  5028. if(w.getKeyCode()==KeyEvent.VK_9){
  5029. r9.doClick();
  5030. }
  5031.  
  5032.  
  5033. }
  5034. });
  5035.  
  5036. r9.addActionListener(new ActionListener() {
  5037.  
  5038. public void actionPerformed(ActionEvent e) {
  5039.  
  5040.  
  5041.  
  5042. Frame f13 = new JFrame();
  5043. f13.setVisible(true);
  5044. f4.setVisible(false);
  5045. f13.setSize(1366,768);
  5046. f13.setLayout(null);
  5047. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  5048. f13.setIconImage(icon.getImage());
  5049. f13.add(c5);
  5050. c5.setBounds(0,650,200,50);
  5051.  
  5052.  
  5053.  
  5054. JLabel rl9 = new JLabel("Cell Nine");
  5055. rl9.setBounds(485,30,450,70);
  5056. rl9.setFont(new Font("Times new Roman",Font.BOLD,80));
  5057. rl9.setForeground(Color.WHITE);
  5058. f13.add(rl9);
  5059.  
  5060. JButton a9 = new JButton("Add");
  5061. a9.setBounds(1180,135,150,75);
  5062. a9.setFont(new Font("Times New Roman",Font.BOLD,20));
  5063. a9.setBackground(Color.LIGHT_GRAY);
  5064. a9.setForeground(Color.BLACK);
  5065. f13.add(a9);
  5066.  
  5067. JButton d9 = new JButton("Delete");
  5068. d9.setBounds(1000,135,150,75);
  5069. d9.setFont(new Font("Times New Roman",Font.BOLD,20));
  5070. d9.setBackground(Color.LIGHT_GRAY);
  5071. d9.setForeground(Color.BLACK);
  5072. f13.add(d9);
  5073.  
  5074. JButton u9 = new JButton("Edit");
  5075. u9.setBounds(820,135,150,75);
  5076. u9.setFont(new Font("Times New Roman",Font.BOLD,20));
  5077. u9.setBackground(Color.LIGHT_GRAY);
  5078. u9.setForeground(Color.BLACK);
  5079. f13.add(u9);
  5080.  
  5081. JPanel rp9 = new JPanel();
  5082. f13.add(rp9);
  5083. rp9.setBounds(0,0,1366,120);
  5084. rp9.setBackground(Color.BLACK);
  5085. rp9.setBorder(BorderFactory.createEtchedBorder(1));
  5086.  
  5087. JTable table = new JTable();
  5088. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  5089. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  5090. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  5091. DefaultTableModel model = new DefaultTableModel();
  5092. model.setColumnIdentifiers(columns);
  5093. table.setModel(model);
  5094.  
  5095.  
  5096. table.setBackground(Color.LIGHT_GRAY);
  5097. table.setForeground(Color.RED);
  5098. Font font =(new Font("Times New Roman",Font.BOLD,20));
  5099. table.setFont(font);
  5100. table.setRowHeight(30);
  5101.  
  5102. //JScrollPane
  5103. JScrollPane pane = new JScrollPane(table);
  5104. pane.setBounds(0,230,1366,350);
  5105. f13.add(pane);
  5106.  
  5107.  
  5108.  
  5109. JButton Back = new JButton("Back");
  5110. Back.setBounds(1180,600,150,75);
  5111. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  5112. Back.setBackground(Color.LIGHT_GRAY);
  5113. Back.setForeground(Color.BLACK);
  5114. f13.add(Back);
  5115.  
  5116. Back.addKeyListener(new KeyAdapter(){
  5117. public void keyPressed(KeyEvent w){
  5118. if(w.getKeyCode()==KeyEvent.VK_B){
  5119. Back.doClick();
  5120. }
  5121.  
  5122.  
  5123. }
  5124. });
  5125.  
  5126. Back.addActionListener(new ActionListener() {
  5127.  
  5128. public void actionPerformed(ActionEvent e) {
  5129. f13.setVisible(false);
  5130. f4.setVisible(true);
  5131.  
  5132.  
  5133. }
  5134. });
  5135.  
  5136. //ADD-9
  5137. a9.addKeyListener(new KeyAdapter(){
  5138. public void keyPressed(KeyEvent w){
  5139. if(w.getKeyCode()==KeyEvent.VK_A){
  5140. a9.doClick();
  5141. }
  5142.  
  5143.  
  5144. }
  5145. });
  5146.  
  5147.  
  5148. a9.addActionListener(new ActionListener() {
  5149.  
  5150. public void actionPerformed(ActionEvent e) {
  5151.  
  5152. Frame f23 = new JFrame();
  5153. f23.setVisible(true);
  5154. f13.setVisible(false);
  5155. f23.setSize(1366,768);
  5156. f23.setLayout(null);
  5157. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  5158. f23.setIconImage(icon.getImage());
  5159. f23.add(c5);
  5160. c5.setBounds(0,650,200,50);
  5161.  
  5162.  
  5163.  
  5164. JPanel rp24 = new JPanel();
  5165. rp24.setBounds(0,0,1366,120);
  5166. rp24.setBackground(Color.BLACK);
  5167. rp24.setBorder(BorderFactory.createEtchedBorder(1));
  5168. f23.add(rp24);
  5169.  
  5170.  
  5171. JLabel r23 = new JLabel("Prisoner Fill Up Form");
  5172. r23.setBounds(485,30,450,70);
  5173. r23.setFont(new Font("Times new Roman",Font.BOLD,80));
  5174. r23.setForeground(Color.WHITE);
  5175. rp24.add(r23);
  5176. JPanel rp34 = new JPanel();
  5177. rp34.setBounds(12,130,1325,450);
  5178. rp34.setBackground(Color.BLACK);
  5179. rp34.setBorder(BorderFactory.createEtchedBorder());
  5180. f23.add(rp34);
  5181.  
  5182. JLabel r147 = new JLabel();
  5183. r147.setBounds(15,15,130,130);
  5184. r147.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
  5185. rp34.add(r147);
  5186.  
  5187.  
  5188. //Prisoner aydi:
  5189.  
  5190.  
  5191. JLabel r289 = new JLabel ("FIRSTNAME:");
  5192. r289.setBounds(183,40,200,50);
  5193. r289.setFont(new Font("Times new Roman",Font.BOLD,20));
  5194. r289.setForeground(Color.WHITE);
  5195. JTextField tf264 = new JTextField ();
  5196. tf264.setBounds(180,85,210,30);
  5197. rp34.add(tf264);
  5198. rp34.add(r289);
  5199. JLabel r290 = new JLabel ("MI:");
  5200. r290.setBounds(413,40,200,50);
  5201. r290.setFont(new Font("Times new Roman",Font.BOLD,20));
  5202. r290.setForeground(Color.WHITE);
  5203. JTextField tf265 = new JTextField ();
  5204. tf265.setBounds(410,85,80,30);
  5205. rp34.add(tf265);
  5206. rp34.add(r290);
  5207. JLabel r291 = new JLabel ("LASTNAME:");
  5208. r291.setBounds(518,40,200,50);
  5209. r291.setFont(new Font("Times new Roman",Font.BOLD,20));
  5210. r291.setForeground(Color.WHITE);
  5211. JTextField tf266 = new JTextField ();
  5212. tf266.setBounds(515,85,210,30);
  5213. rp34.add(tf266);
  5214. rp34.add(r291);
  5215. JLabel r292 = new JLabel ("SEX:");
  5216. r292.setBounds(751,40,200,50);
  5217. r292.setFont(new Font("Times new Roman",Font.BOLD,20));
  5218. r292.setForeground(Color.WHITE);
  5219. JTextField tf267 = new JTextField ();
  5220. tf267.setBounds(750,85,90,30);
  5221. rp34.add(tf267);
  5222. rp34.add(r292);
  5223. JLabel r293 = new JLabel ("AGE:");
  5224. r293.setBounds(861,40,200,50);
  5225. r293.setFont(new Font("Times new Roman",Font.BOLD,20));
  5226. r293.setForeground(Color.WHITE);
  5227. JTextField tf268 = new JTextField ();
  5228. tf268.setBounds(860,85,60,30);
  5229. rp34.add(tf268);
  5230. rp34.add(r293);
  5231. JLabel r294 = new JLabel ("ADDRESS:");
  5232. r294.setBounds(951,40,200,50);
  5233. r294.setFont(new Font("Times new Roman",Font.BOLD,20));
  5234. r294.setForeground(Color.WHITE);
  5235. JTextField tf269 = new JTextField ();
  5236. tf269.setBounds(950,85,355,30);
  5237. rp34.add(tf269);
  5238. rp34.add(r294);
  5239. JLabel r295 = new JLabel ("DATE OF BIRTH:");
  5240. r295.setBounds(17,150,200,50);
  5241. r295.setFont(new Font("Times new Roman",Font.BOLD,20));
  5242. r295.setForeground(Color.WHITE);
  5243. JTextField tf270 = new JTextField ();
  5244. tf270.setBounds(15,195,210,30);
  5245. rp34.add(tf270);
  5246. rp34.add(r295);
  5247. JLabel r296 = new JLabel ("NATIONALITY:");
  5248. r296.setBounds(247,150,200,50);
  5249. r296.setFont(new Font("Times new Roman",Font.BOLD,20));
  5250. r296.setForeground(Color.WHITE);
  5251. JTextField tf271 = new JTextField ();
  5252. tf271.setBounds(245,195,210,30);
  5253. rp34.add(tf271);
  5254. rp34.add(r296);
  5255. JLabel r297 = new JLabel ("HEIGHT:");
  5256. r297.setBounds(482,150,200,50);
  5257. r297.setFont(new Font("Times new Roman",Font.BOLD,20));
  5258. r297.setForeground(Color.WHITE);
  5259. JTextField tf272 = new JTextField ();
  5260. tf272.setBounds(480,195,120,30);
  5261. rp34.add(tf272);
  5262. rp34.add(r297);
  5263. JLabel r298 = new JLabel ("WEIGHT:");
  5264. r298.setBounds(636,150,200,50);
  5265. r298.setFont(new Font("Times new Roman",Font.BOLD,20));
  5266. r298.setForeground(Color.WHITE);
  5267. JTextField tf273 = new JTextField ();
  5268. tf273.setBounds(630,195,120,30);
  5269. rp34.add(tf273);
  5270. rp34.add(r298);
  5271. JLabel r299 = new JLabel ("EYE COLOR:");
  5272. r299.setBounds(787,150,200,50);
  5273. r299.setFont(new Font("Times new Roman",Font.BOLD,20));
  5274. r299.setForeground(Color.WHITE);
  5275. JTextField tf274 = new JTextField ();
  5276. tf274.setBounds(785,195,190,30);
  5277. rp34.add(tf274);
  5278. rp34.add(r299);
  5279. JLabel r300 = new JLabel ("PHONE NUMBER:");
  5280. r300.setBounds(997,150,200,50);
  5281. r300.setFont(new Font("Times new Roman",Font.BOLD,20));
  5282. r300.setForeground(Color.WHITE);
  5283. JTextField tf275 = new JTextField ();
  5284. tf275.setBounds(995,195,310,30);
  5285. rp34.add(tf275);
  5286. rp34.add(r300);
  5287. JLabel r301 = new JLabel ("LANGUAGE:");
  5288. r301.setBounds(16,250,200,50);
  5289. r301.setFont(new Font("Times new Roman",Font.BOLD,20));
  5290. r301.setForeground(Color.WHITE);
  5291. JTextField tf276 = new JTextField ();
  5292. tf276.setBounds(15,295,210,30);
  5293. rp34.add(tf276);
  5294. rp34.add(r301);
  5295. JLabel r302 = new JLabel ("DATE OF CAPTURE:");
  5296. r302.setBounds(247,250,200,50);
  5297. r302.setFont(new Font("Times new Roman",Font.BOLD,20));
  5298. r302.setForeground(Color.WHITE);
  5299. JTextField tf277 = new JTextField ();
  5300. tf277.setBounds(245,295,210,30);
  5301. rp34.add(tf277);
  5302. rp34.add(r302);
  5303. JLabel r303 = new JLabel ("PLACE OF CAPTURE:");
  5304. r303.setBounds(482,250,220,50);
  5305. r303.setFont(new Font("Times new Roman",Font.BOLD,20));
  5306. r303.setForeground(Color.WHITE);
  5307. JTextField tf278 = new JTextField ();
  5308. tf278.setBounds(480,295,320,30);
  5309. rp34.add(tf278);
  5310. rp34.add(r303);
  5311. JLabel r304 = new JLabel ("CIVILLIAN OCCUPATION:");
  5312. r304.setBounds(827,250,270,50);
  5313. r304.setFont(new Font("Times new Roman",Font.BOLD,20));
  5314. r304.setForeground(Color.WHITE);
  5315. JTextField tf279 = new JTextField ();
  5316. tf279.setBounds(825,295,480,30);
  5317. rp34.add(tf279);
  5318. rp34.add(r304);
  5319. JLabel r305 = new JLabel ("PHYSICAL CONDITION:");
  5320. r305.setBounds(16,350,260,50);
  5321. r305.setFont(new Font("Times new Roman",Font.BOLD,20));
  5322. r305.setForeground(Color.WHITE);
  5323. JTextField tf280 = new JTextField ();
  5324. tf280.setBounds(15,395,260,30);
  5325. rp34.add(tf280);
  5326. rp34.add(r305);
  5327. JLabel r306 = new JLabel ("DAYS IN JAIL:");
  5328. r306.setBounds(302,350,250,50);
  5329. r306.setFont(new Font("Times new Roman",Font.BOLD,20));
  5330. r306.setForeground(Color.WHITE);
  5331. JTextField tf281 = new JTextField ();
  5332. tf281.setBounds(300,395,180,30);
  5333. rp34.add(tf281);
  5334. rp34.add(r306);
  5335. JLabel r307 = new JLabel ("ARRIVAL OF PRISONER:");
  5336. r307.setBounds(502,350,280,50);
  5337. r307.setFont(new Font("Times new Roman",Font.BOLD,20));
  5338. r307.setForeground(Color.WHITE);
  5339. JTextField tf282 = new JTextField ();
  5340. tf282.setBounds(500,395,280,30);
  5341. rp34.add(tf282);
  5342. rp34.add(r307);
  5343. JLabel r308 = new JLabel ("DATE/TIME:");
  5344. r308.setBounds(802,350,250,50);
  5345. r308.setFont(new Font("Times new Roman",Font.BOLD,20));
  5346. r308.setForeground(Color.WHITE);
  5347. JTextField tf283 = new JTextField ();
  5348. tf283.setBounds(800,395,150,30);
  5349. rp34.add(tf283);
  5350. rp34.add(r308);
  5351. JLabel r309 = new JLabel ("ARRIVAL OFFICER:");
  5352. r309.setBounds(972,350,250,50);
  5353. r309.setFont(new Font("Times new Roman",Font.BOLD,20));
  5354. r309.setForeground(Color.WHITE);
  5355. JTextField tf284 = new JTextField ();
  5356. tf284.setBounds(970,395,335,30);
  5357. rp34.add(tf284);
  5358. rp34.add(r309);
  5359. rp34.setLayout(null);
  5360.  
  5361.  
  5362. JButton Back = new JButton("Back");
  5363. Back.setBounds(1180,600,150,75);
  5364. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  5365. Back.setBackground(Color.LIGHT_GRAY);
  5366. Back.setForeground(Color.BLACK);
  5367. f23.add(Back);
  5368.  
  5369.  
  5370. Back.addKeyListener(new KeyAdapter(){
  5371. public void keyPressed(KeyEvent w){
  5372. if(w.getKeyCode()==KeyEvent.VK_B){
  5373. Back.doClick();
  5374. }
  5375.  
  5376.  
  5377. }
  5378. });
  5379.  
  5380. Back.addActionListener(new ActionListener() {
  5381.  
  5382. public void actionPerformed(ActionEvent e) {
  5383. f23.setVisible(false);
  5384. f13.setVisible(true);
  5385.  
  5386.  
  5387. }
  5388. });
  5389.  
  5390. //update
  5391. JButton update = new JButton("Update");
  5392. update.setBounds(820,600,150,75);
  5393. update.setFont(new Font("Times New Roman",Font.BOLD,20));
  5394. update.setBackground(Color.LIGHT_GRAY);
  5395. update.setForeground(Color.BLACK);
  5396. f23.add(update);
  5397.  
  5398.  
  5399.  
  5400. //Save
  5401. JButton Save = new JButton("Save");
  5402. Save.setBounds(1000,600,150,75);
  5403. Save.setFont(new Font("Times New Roman",Font.BOLD,20));
  5404. Save.setBackground(Color.LIGHT_GRAY);
  5405. Save.setForeground(Color.BLACK);
  5406. f23.add(Save);
  5407.  
  5408. u9.addKeyListener(new KeyAdapter(){
  5409. public void keyPressed(KeyEvent w){
  5410. if(w.getKeyCode()==KeyEvent.VK_E){
  5411. u9.doClick();
  5412. }
  5413.  
  5414.  
  5415. }
  5416. });
  5417.  
  5418. u9.addActionListener(new ActionListener() {
  5419.  
  5420. public void actionPerformed(ActionEvent e) {
  5421.  
  5422.  
  5423. f23.setVisible(true);
  5424. f13.setVisible(false);
  5425.  
  5426.  
  5427.  
  5428. }
  5429. });
  5430.  
  5431. //UPDATE FUNCTION
  5432. update.addKeyListener(new KeyAdapter(){
  5433. public void keyPressed(KeyEvent w){
  5434. if(w.getKeyCode()==KeyEvent.VK_U){
  5435. update.doClick();
  5436. }
  5437.  
  5438.  
  5439. }
  5440. });
  5441. update.addActionListener(new ActionListener(){
  5442. public void actionPerformed(ActionEvent e) {
  5443. int n = JOptionPane.showConfirmDialog(
  5444. null, "Would you like to UPDATE This Row?",
  5445. "Are you sure?",
  5446. JOptionPane.YES_NO_OPTION);
  5447. if (n == JOptionPane.YES_OPTION){
  5448.  
  5449.  
  5450. f23.setVisible(false);
  5451. f13.setVisible(true);
  5452.  
  5453. JOptionPane.showMessageDialog(f13,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
  5454.  
  5455.  
  5456. }
  5457.  
  5458. }
  5459. });
  5460.  
  5461.  
  5462. //ADD FUNCTION
  5463. Save.addKeyListener(new KeyAdapter(){
  5464. public void keyPressed(KeyEvent w){
  5465. if(w.getKeyCode()==KeyEvent.VK_S){
  5466. Save.doClick();
  5467. }
  5468.  
  5469.  
  5470. }
  5471. });
  5472. Save.addActionListener(new ActionListener() {
  5473.  
  5474. public void actionPerformed(ActionEvent e) {
  5475. int n = JOptionPane.showConfirmDialog(
  5476. null, "Would you like to ADD This Row?",
  5477. "Are you sure?",
  5478. JOptionPane.YES_NO_OPTION);
  5479. if (n == JOptionPane.YES_OPTION){
  5480.  
  5481.  
  5482. f23.setVisible(false);
  5483. f13.setVisible(true);
  5484. JOptionPane.showMessageDialog(f13,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  5485.  
  5486. }
  5487.  
  5488. }
  5489. });
  5490.  
  5491. //DELETE FUNCTION
  5492. d9.addKeyListener(new KeyAdapter(){
  5493. public void keyPressed(KeyEvent w){
  5494. if(w.getKeyCode()==KeyEvent.VK_D){
  5495. d9.doClick();
  5496. }
  5497.  
  5498.  
  5499. }
  5500. });
  5501. d9.addActionListener(new ActionListener(){
  5502. public void actionPerformed(ActionEvent e) {
  5503. int n = JOptionPane.showConfirmDialog(
  5504. null, "Would you like to DELETE This Row?",
  5505. "Are you sure?",
  5506. JOptionPane.YES_NO_OPTION);
  5507. if (n == JOptionPane.YES_OPTION) {
  5508.  
  5509.  
  5510. JOptionPane.showMessageDialog(f13,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  5511.  
  5512. }
  5513.  
  5514.  
  5515.  
  5516. }
  5517. });
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523. }
  5524. });
  5525.  
  5526. }
  5527. });
  5528.  
  5529. //B10
  5530. r10.addKeyListener(new KeyAdapter(){
  5531. public void keyPressed(KeyEvent w){
  5532. if(w.getKeyCode()==KeyEvent.VK_0){
  5533. r10.doClick();
  5534. }
  5535.  
  5536.  
  5537. }
  5538. });
  5539. r10.addActionListener(new ActionListener() {
  5540.  
  5541. public void actionPerformed(ActionEvent e) {
  5542.  
  5543. Frame f14 = new JFrame();
  5544. f14.setVisible(true);
  5545. f4.setVisible(false);
  5546. f14.setSize(1366,768);
  5547. f14.setLayout(null);
  5548. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  5549. f14.setIconImage(icon.getImage());
  5550. f14.add(c5);
  5551. c5.setBounds(0,650,200,50);
  5552.  
  5553.  
  5554.  
  5555. JLabel rl10 = new JLabel("Cell Ten");
  5556. rl10.setBounds(485,30,450,70);
  5557. rl10.setFont(new Font("Times new Roman",Font.BOLD,80));
  5558. rl10.setForeground(Color.WHITE);
  5559. f14.add(rl10);
  5560.  
  5561. JButton a10 = new JButton("Add");
  5562. a10.setBounds(1180,135,150,75);
  5563. a10.setFont(new Font("Times New Roman",Font.BOLD,20));
  5564. a10.setBackground(Color.LIGHT_GRAY);
  5565. a10.setForeground(Color.BLACK);
  5566. f14.add(a10);
  5567.  
  5568.  
  5569. JButton d10 = new JButton("Delete");
  5570. d10.setBounds(1000,135,150,75);
  5571. d10.setFont(new Font("Times New Roman",Font.BOLD,20));
  5572. d10.setBackground(Color.LIGHT_GRAY);
  5573. d10.setForeground(Color.BLACK);
  5574. f14.add(d10);
  5575.  
  5576. JButton u10 = new JButton("Edit");
  5577. u10.setBounds(820,135,150,75);
  5578. u10.setFont(new Font("Times New Roman",Font.BOLD,20));
  5579. u10.setBackground(Color.LIGHT_GRAY);
  5580. u10.setForeground(Color.BLACK);
  5581. f14.add(u10);
  5582.  
  5583. JPanel rp10 = new JPanel();
  5584. f14.add(rp10);
  5585. rp10.setBounds(0,0,1366,120);
  5586. rp10.setBackground(Color.BLACK);
  5587. rp10.setBorder(BorderFactory.createEtchedBorder(1));
  5588.  
  5589. JTable table = new JTable();
  5590. Object[] columns = {"FirstName","MiddleName","LastName","Sex","Age","Address","DateOfBirth","Nationality","Height","Weight",
  5591. "EyeColor","PhoneNumber","Language","DateCapture","PlaceCapture","CivillianOccupation","PhysicalCodition","DaysInJail",
  5592. "ArrivalPrisoner","Date/Time","ArrivalOficer"};
  5593. DefaultTableModel model = new DefaultTableModel();
  5594. model.setColumnIdentifiers(columns);
  5595. table.setModel(model);
  5596.  
  5597.  
  5598. table.setBackground(Color.LIGHT_GRAY);
  5599. table.setForeground(Color.RED);
  5600. Font font =(new Font("Times New Roman",Font.BOLD,20));
  5601. table.setFont(font);
  5602. table.setRowHeight(30);
  5603.  
  5604. //JScrollPane
  5605. JScrollPane pane = new JScrollPane(table);
  5606. pane.setBounds(0,230,1366,350);
  5607. f14.add(pane);
  5608.  
  5609.  
  5610.  
  5611. JButton Back = new JButton("Back");
  5612. Back.setBounds(1180,600,150,75);
  5613. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  5614. Back.setBackground(Color.LIGHT_GRAY);
  5615. Back.setForeground(Color.BLACK);
  5616. f14.add(Back);
  5617. Back.addKeyListener(new KeyAdapter(){
  5618. public void keyPressed(KeyEvent w){
  5619. if(w.getKeyCode()==KeyEvent.VK_B){
  5620. Back.doClick();
  5621. }
  5622.  
  5623.  
  5624. }
  5625. });
  5626. Back.addActionListener(new ActionListener() {
  5627.  
  5628. public void actionPerformed(ActionEvent e) {
  5629. f14.setVisible(false);
  5630. f4.setVisible(true);
  5631.  
  5632.  
  5633. }
  5634. });
  5635.  
  5636. //ADD-10
  5637. a10.addKeyListener(new KeyAdapter(){
  5638. public void keyPressed(KeyEvent w){
  5639. if(w.getKeyCode()==KeyEvent.VK_A){
  5640. a10.doClick();
  5641. }
  5642.  
  5643.  
  5644. }
  5645. });
  5646. a10.addActionListener(new ActionListener() {
  5647.  
  5648. public void actionPerformed(ActionEvent e) {
  5649.  
  5650. Frame f24 = new JFrame();
  5651. f24.setVisible(true);
  5652. f14.setVisible(false);
  5653. f24.setSize(1366,768);
  5654. f24.setLayout(null);
  5655. ImageIcon icon = new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\y.png");
  5656. f24.setIconImage(icon.getImage());
  5657. f24.add(c5);
  5658. c5.setBounds(0,650,200,50);
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664. JPanel rp25 = new JPanel();
  5665. rp25.setBounds(0,0,1366,120);
  5666. rp25.setBackground(Color.BLACK);
  5667. rp25.setBorder(BorderFactory.createEtchedBorder(1));
  5668. f24.add(rp25);
  5669.  
  5670.  
  5671. JLabel r24 = new JLabel("Prisoner Fill Up Form");
  5672. r24.setBounds(485,30,450,70);
  5673. r24.setFont(new Font("Times new Roman",Font.BOLD,80));
  5674. r24.setForeground(Color.WHITE);
  5675. rp25.add(r24);
  5676.  
  5677. JPanel rp35 = new JPanel();
  5678. rp35.setBounds(12,130,1325,450);
  5679. rp35.setBackground(Color.BLACK);
  5680. rp35.setBorder(BorderFactory.createEtchedBorder());
  5681. f24.add(rp35);
  5682.  
  5683. JLabel r118 = new JLabel();
  5684. r118.setBounds(15,15,130,130);
  5685. r118.setIcon(new ImageIcon("C:\\Users\\jayjay matabang\\Desktop\\r.jpg"));
  5686. rp35.add(r118);
  5687.  
  5688. //Prisoner aydi:
  5689.  
  5690. JLabel r97 = new JLabel ("FIRSTNAME:");
  5691. r97.setBounds(183,40,200,50);
  5692. r97.setFont(new Font("Times new Roman",Font.BOLD,20));
  5693. r97.setForeground(Color.WHITE);
  5694. JTextField tf75 = new JTextField ();
  5695. tf75.setBounds(180,85,210,30);
  5696. rp35.add(tf75);
  5697. rp35.add(r97);
  5698. JLabel r98 = new JLabel ("MI:");
  5699. r98.setBounds(413,40,200,50);
  5700. r98.setFont(new Font("Times new Roman",Font.BOLD,20));
  5701. r98.setForeground(Color.WHITE);
  5702. JTextField tf76 = new JTextField ();
  5703. tf76.setBounds(410,85,80,30);
  5704. rp35.add(tf76);
  5705. rp35.add(r98);
  5706. JLabel r99 = new JLabel ("LASTNAME:");
  5707. r99.setBounds(518,40,200,50);
  5708. r99.setFont(new Font("Times new Roman",Font.BOLD,20));
  5709. r99.setForeground(Color.WHITE);
  5710. JTextField tf77 = new JTextField ();
  5711. tf77.setBounds(515,85,210,30);
  5712. rp35.add(tf77);
  5713. rp35.add(r99);
  5714. JLabel r100 = new JLabel ("SEX:");
  5715. r100.setBounds(751,40,200,50);
  5716. r100.setFont(new Font("Times new Roman",Font.BOLD,20));
  5717. r100.setForeground(Color.WHITE);
  5718. JTextField tf78 = new JTextField ();
  5719. tf78.setBounds(750,85,90,30);
  5720. rp35.add(tf78);
  5721. rp35.add(r100);
  5722. JLabel r101 = new JLabel ("AGE:");
  5723. r101.setBounds(861,40,200,50);
  5724. r101.setFont(new Font("Times new Roman",Font.BOLD,20));
  5725. r101.setForeground(Color.WHITE);
  5726. JTextField tf79 = new JTextField ();
  5727. tf79.setBounds(860,85,60,30);
  5728. rp35.add(tf79);
  5729. rp35.add(r101);
  5730. JLabel r102 = new JLabel ("ADDRESS:");
  5731. r102.setBounds(951,40,200,50);
  5732. r102.setFont(new Font("Times new Roman",Font.BOLD,20));
  5733. r102.setForeground(Color.WHITE);
  5734. JTextField tf80 = new JTextField ();
  5735. tf80.setBounds(950,85,355,30);
  5736. rp35.add(tf80);
  5737. rp35.add(r102);
  5738. JLabel r103 = new JLabel ("DATE OF BIRTH:");
  5739. r103.setBounds(17,150,200,50);
  5740. r103.setFont(new Font("Times new Roman",Font.BOLD,20));
  5741. r103.setForeground(Color.WHITE);
  5742. JTextField tf81 = new JTextField ();
  5743. tf81.setBounds(15,195,210,30);
  5744. rp35.add(tf81);
  5745. rp35.add(r103);
  5746. JLabel r104 = new JLabel ("NATIONALITY:");
  5747. r104.setBounds(247,150,200,50);
  5748. r104.setFont(new Font("Times new Roman",Font.BOLD,20));
  5749. r104.setForeground(Color.WHITE);
  5750. JTextField tf82 = new JTextField ();
  5751. tf82.setBounds(245,195,210,30);
  5752. rp35.add(tf82);
  5753. rp35.add(r104);
  5754. JLabel r105 = new JLabel ("HEIGHT:");
  5755. r105.setBounds(482,150,200,50);
  5756. r105.setFont(new Font("Times new Roman",Font.BOLD,20));
  5757. r105.setForeground(Color.WHITE);
  5758. JTextField tf83 = new JTextField ();
  5759. tf83.setBounds(480,195,120,30);
  5760. rp35.add(tf83);
  5761. rp35.add(r105);
  5762. JLabel r106 = new JLabel ("WEIGHT:");
  5763. r106.setBounds(636,150,200,50);
  5764. r106.setFont(new Font("Times new Roman",Font.BOLD,20));
  5765. r106.setForeground(Color.WHITE);
  5766. JTextField tf84 = new JTextField ();
  5767. tf84.setBounds(630,195,120,30);
  5768. rp35.add(tf84);
  5769. rp35.add(r106);
  5770. JLabel r107 = new JLabel ("EYE COLOR:");
  5771. r107.setBounds(787,150,200,50);
  5772. r107.setFont(new Font("Times new Roman",Font.BOLD,20));
  5773. r107.setForeground(Color.WHITE);
  5774. JTextField tf85 = new JTextField ();
  5775. tf85.setBounds(785 ,195,190,30);
  5776. rp35.add(tf85);
  5777. rp35.add(r107);
  5778. JLabel r108 = new JLabel ("PHONE NUMBER:");
  5779. r108.setBounds(997,150,200,50);
  5780. r108.setFont(new Font("Times new Roman",Font.BOLD,20));
  5781. r108.setForeground(Color.WHITE);
  5782. JTextField tf86 = new JTextField ();
  5783. tf86.setBounds(995,195,310,30);
  5784. rp35.add(tf86);
  5785. rp35.add(r108);
  5786. JLabel r109 = new JLabel ("LANGUAGE:");
  5787. r109.setBounds(16,250,200,50);
  5788. r109.setFont(new Font("Times new Roman",Font.BOLD,20));
  5789. r109.setForeground(Color.WHITE);
  5790. JTextField tf87 = new JTextField ();
  5791. tf87.setBounds(15,295,210,30);
  5792. rp35.add(tf87);
  5793. rp35.add(r109);
  5794. JLabel r110 = new JLabel ("DATE OF CAPTURE:");
  5795. r110.setBounds(247,250,200,50);
  5796. r110.setFont(new Font("Times new Roman",Font.BOLD,20));
  5797. r110.setForeground(Color.WHITE);
  5798. JTextField tf88 = new JTextField ();
  5799. tf88.setBounds(245,295,210,30);
  5800. rp35.add(tf88);
  5801. rp35.add(r110);
  5802. JLabel r111 = new JLabel ("PLACE OF CAPTURE:");
  5803. r111.setBounds(482,250,220,50);
  5804. r111.setFont(new Font("Times new Roman",Font.BOLD,20));
  5805. r111.setForeground(Color.WHITE);
  5806. JTextField tf89 = new JTextField ();
  5807. tf89.setBounds(480,295,320,30);
  5808. rp35.add(tf89);
  5809. rp35.add(r111);
  5810. JLabel r112 = new JLabel ("CIVILLIAN OCCUPATION:");
  5811. r112.setBounds(827,250,270,50);
  5812. r112.setFont(new Font("Times new Roman",Font.BOLD,20));
  5813. r112.setForeground(Color.WHITE);
  5814. JTextField tf90 = new JTextField ();
  5815. tf90.setBounds(825,295,480,30);
  5816. rp35.add(tf90);
  5817. rp35.add(r112);
  5818. JLabel r113 = new JLabel ("PHYSICAL CONDITION:");
  5819. r113.setBounds(16,350,260,50);
  5820. r113.setFont(new Font("Times new Roman",Font.BOLD,20));
  5821. r113.setForeground(Color.WHITE);
  5822. JTextField tf91 = new JTextField ();
  5823. tf91.setBounds(15,395,260,30);
  5824. rp35.add(tf91);
  5825. rp35.add(r113);
  5826. JLabel r114 = new JLabel ("DAYS IN JAIL:");
  5827. r114.setBounds(302,350,250,50);
  5828. r114.setFont(new Font("Times new Roman",Font.BOLD,20));
  5829. r114.setForeground(Color.WHITE);
  5830. JTextField tf92 = new JTextField ();
  5831. tf92.setBounds(300,395,180,30);
  5832. rp35.add(tf92);
  5833. rp35.add(r114);
  5834. JLabel r115 = new JLabel ("ARRIVAL OF PRISONER:");
  5835. r115.setBounds(502,350,280,50);
  5836. r115.setFont(new Font("Times new Roman",Font.BOLD,20));
  5837. r115.setForeground(Color.WHITE);
  5838. JTextField tf93 = new JTextField ();
  5839. tf93.setBounds(500,395,280,30);
  5840. rp35.add(tf93);
  5841. rp35.add(r115);
  5842. JLabel r116 = new JLabel ("DATE/TIME:");
  5843. r116.setBounds(802,350,250,50);
  5844. r116.setFont(new Font("Times new Roman",Font.BOLD,20));
  5845. r116.setForeground(Color.WHITE);
  5846. JTextField tf94 = new JTextField ();
  5847. tf94.setBounds(800,395,150,30);
  5848. rp35.add(tf94);
  5849. rp35.add(r116);
  5850. JLabel r117 = new JLabel ("ARRIVAL OFFICER:");
  5851. r117.setBounds(972,350,250,50);
  5852. r117.setFont(new Font("Times new Roman",Font.BOLD,20));
  5853. r117.setForeground(Color.WHITE);
  5854. JTextField tf95 = new JTextField ();
  5855. tf95.setBounds(970,395,335,30);
  5856. rp35.add(tf95);
  5857. rp35.add(r117);
  5858. rp35.setLayout(null);
  5859.  
  5860.  
  5861. JButton Back = new JButton("Back");
  5862. Back.setBounds(1180,600,150,75);
  5863. Back.setFont(new Font("Times New Roman",Font.BOLD,20));
  5864. Back.setBackground(Color.LIGHT_GRAY);
  5865. Back.setForeground(Color.BLACK);
  5866. f24.add(Back);
  5867.  
  5868. Back.addKeyListener(new KeyAdapter(){
  5869. public void keyPressed(KeyEvent w){
  5870. if(w.getKeyCode()==KeyEvent.VK_B){
  5871. Back.doClick();
  5872. }
  5873.  
  5874.  
  5875. }
  5876. });
  5877.  
  5878. Back.addActionListener(new ActionListener() {
  5879.  
  5880. public void actionPerformed(ActionEvent e) {
  5881. f24.setVisible(false);
  5882. f14.setVisible(true);
  5883.  
  5884.  
  5885. }
  5886. });
  5887.  
  5888. //update
  5889. JButton update = new JButton("Update");
  5890. update.setBounds(820,600,150,75);
  5891. update.setFont(new Font("Times New Roman",Font.BOLD,20));
  5892. update.setBackground(Color.LIGHT_GRAY);
  5893. update.setForeground(Color.BLACK);
  5894. f24.add(update);
  5895.  
  5896.  
  5897.  
  5898. //Save
  5899. JButton Save = new JButton("Save");
  5900. Save.setBounds(1000,600,150,75);
  5901. Save.setFont(new Font("Times New Roman",Font.BOLD,20));
  5902. Save.setBackground(Color.LIGHT_GRAY);
  5903. Save.setForeground(Color.BLACK);
  5904. f24.add(Save);
  5905.  
  5906.  
  5907.  
  5908. u10.addKeyListener(new KeyAdapter(){
  5909. public void keyPressed(KeyEvent w){
  5910. if(w.getKeyCode()==KeyEvent.VK_E){
  5911. u10.doClick();
  5912. }
  5913.  
  5914.  
  5915. }
  5916. });
  5917. u10.addActionListener(new ActionListener() {
  5918.  
  5919. public void actionPerformed(ActionEvent e) {
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925. f24.setVisible(true);
  5926. f14.setVisible(false);
  5927.  
  5928.  
  5929.  
  5930.  
  5931. }
  5932. });
  5933.  
  5934. //UPDATE FUNCTION
  5935.  
  5936. update.addKeyListener(new KeyAdapter(){
  5937. public void keyPressed(KeyEvent w){
  5938. if(w.getKeyCode()==KeyEvent.VK_U){
  5939. update.doClick();
  5940. }
  5941.  
  5942.  
  5943. }
  5944. });
  5945.  
  5946. update.addActionListener(new ActionListener(){
  5947. public void actionPerformed(ActionEvent e) {
  5948. int n = JOptionPane.showConfirmDialog(
  5949. null, "Would you like to UPDATE This Row?",
  5950. "Are you sure?",
  5951. JOptionPane.YES_NO_OPTION);
  5952. if (n == JOptionPane.YES_OPTION){
  5953.  
  5954.  
  5955. f24.setVisible(false);
  5956. f14.setVisible(true);
  5957.  
  5958. JOptionPane.showMessageDialog(f14,"Update Successful!","Information",JOptionPane.INFORMATION_MESSAGE);
  5959.  
  5960.  
  5961. }
  5962.  
  5963. }
  5964. });
  5965.  
  5966.  
  5967. //ADD FUNCTION
  5968. Save.addKeyListener(new KeyAdapter(){
  5969. public void keyPressed(KeyEvent w){
  5970. if(w.getKeyCode()==KeyEvent.VK_S){
  5971. Save.doClick();
  5972. }
  5973.  
  5974.  
  5975. }
  5976. });
  5977. Save.addActionListener(new ActionListener() {
  5978.  
  5979. public void actionPerformed(ActionEvent e) {
  5980. int n = JOptionPane.showConfirmDialog(
  5981. null, "Would you like to ADD This Row?",
  5982. "Are you sure?",
  5983. JOptionPane.YES_NO_OPTION);
  5984. if (n == JOptionPane.YES_OPTION){
  5985.  
  5986.  
  5987.  
  5988.  
  5989. f24.setVisible(false);
  5990. f14.setVisible(true);
  5991. JOptionPane.showMessageDialog(f14,"Added Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  5992.  
  5993. }
  5994.  
  5995. }
  5996. });
  5997.  
  5998. //DELETE FUNCTION
  5999. Back.addKeyListener(new KeyAdapter(){
  6000. public void keyPressed(KeyEvent w){
  6001. if(w.getKeyCode()==KeyEvent.VK_B){
  6002. Back.doClick();
  6003. }
  6004.  
  6005.  
  6006. }
  6007. });
  6008. d10.addKeyListener(new KeyAdapter(){
  6009. public void keyPressed(KeyEvent w){
  6010. if(w.getKeyCode()==KeyEvent.VK_D){
  6011. d10.doClick();
  6012. }
  6013.  
  6014.  
  6015. }
  6016. });
  6017. d10.addActionListener(new ActionListener(){
  6018. public void actionPerformed(ActionEvent e) {
  6019. int n = JOptionPane.showConfirmDialog(
  6020. null, "Would you like to DELETE This Row?",
  6021. "Are you sure?",
  6022. JOptionPane.YES_NO_OPTION);
  6023. if (n == JOptionPane.YES_OPTION) {
  6024.  
  6025.  
  6026. JOptionPane.showMessageDialog(f14,"Deleted Successfully","Information",JOptionPane.INFORMATION_MESSAGE);
  6027.  
  6028. }
  6029.  
  6030.  
  6031.  
  6032. }
  6033. });
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039. }
  6040. });
  6041.  
  6042. }
  6043. });
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053. //back1
  6054.  
  6055. JButton Back1 = new JButton("Back");
  6056. Back1.setBounds(1180,600,150,75);
  6057. Back1.setFont(new Font("Times New Roman",Font.BOLD,20));
  6058. Back1.setBackground(Color.LIGHT_GRAY);
  6059. Back1.setForeground(Color.BLACK);
  6060. f4.add(Back1);
  6061. Back1.addKeyListener(new KeyAdapter(){
  6062. public void keyPressed(KeyEvent w){
  6063. if(w.getKeyCode()==KeyEvent.VK_B){
  6064. Back1.doClick();
  6065. }
  6066.  
  6067.  
  6068. }
  6069. });
  6070.  
  6071. Back1.addActionListener(new ActionListener() {
  6072.  
  6073. public void actionPerformed(ActionEvent e) {
  6074. f4.setVisible(false);
  6075. f2.setVisible(true);
  6076.  
  6077.  
  6078. }
  6079. });
  6080.  
  6081. Back1.addKeyListener(new KeyAdapter(){
  6082. public void keyPressed(KeyEvent w){
  6083. if(w.getKeyCode()==KeyEvent.VK_L){
  6084. Back1.doClick();
  6085. }
  6086. }
  6087. });
  6088.  
  6089.  
  6090.  
  6091.  
  6092.  
  6093.  
  6094.  
  6095.  
  6096. //f1
  6097. f1.setSize(1366,768);
  6098. f1.setVisible(true);
  6099. f1.setLayout(null);
  6100. //f2
  6101. f2.setVisible(false);
  6102. f2.setSize(1366,768);
  6103. f2.setLayout(null);
  6104. //f3
  6105. f3.setVisible(false);
  6106. f3.setSize(1366,768);
  6107. f3.setLayout(null);
  6108. //f4
  6109. f4.setVisible(false);
  6110. f4.setSize(1366,768);
  6111. f4.setLayout(null);
  6112.  
  6113.  
  6114. //add(f1)
  6115.  
  6116. f1.add(jail);
  6117. f1.add(User);
  6118. f1.add(Pass);
  6119. f1.add(BLogin);
  6120. f1.add(TUser);
  6121. f1.add(TPass);
  6122.  
  6123. //clock
  6124. f2.add(c1);
  6125. c1.setBounds(0,650,200,50);
  6126. f3.add(c2);
  6127. c2.setBounds(0,650,200,50);
  6128. f4.add(c3);
  6129. c3.setBounds(0,650,200,50);
  6130.  
  6131. System.out.println("-------- MySQL JDBC Connection Testing ------------");
  6132.  
  6133. try {
  6134. Class.forName("com.mysql.cj.jdbc.Driver");
  6135. } catch (ClassNotFoundException e) {
  6136. System.out.println("Where is your MySQL JDBC Driver?");
  6137. e.printStackTrace();
  6138. return;
  6139. }
  6140.  
  6141. System.out.println("MySQL JDBC Driver Registered!");
  6142. Connection connection = null;
  6143.  
  6144. try {
  6145. connection = DriverManager
  6146. .getConnection("jdbc:mysql://localhost:3306/prison?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC", "root", "");
  6147.  
  6148. } catch (SQLException e) {
  6149. System.out.println("Connection Failed! Check output console");
  6150. e.printStackTrace();
  6151. return;
  6152. }
  6153.  
  6154. if (connection != null) {
  6155. System.out.println("You made it, take control your database now!");
  6156. } else {
  6157. System.out.println("Failed to make connection!");
  6158. }
  6159.  
  6160.  
  6161. }
  6162. public static void video() throws IOException {
  6163. Desktop.getDesktop().open(new File("C:\\Users\\jayjay matabang\\Desktop\\vid.mp4"));
  6164. }
  6165. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement