Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.17 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package InheritancePackage;
  7.  
  8. import java.awt.Color;
  9. import java.awt.event.KeyEvent;
  10. import java.io.BufferedReader;
  11. import java.io.BufferedWriter;
  12. import java.io.FileReader;
  13. import java.io.FileWriter;
  14. import java.io.IOException;
  15. import javax.swing.JOptionPane;
  16. import javax.swing.border.LineBorder;
  17.  
  18. /**
  19. *
  20. * @author Muhammad Faheem
  21. */
  22. public class AddEmployee extends javax.swing.JFrame {
  23. LoginPage LP = new LoginPage();
  24. EmployeeInfo removedEmployee;
  25. public static MyHashTable theHT = new MyHashTable(10);
  26. FTE someFTE;
  27. PTE somePTE;
  28.  
  29. FTE removedFTE;
  30. PTE removedPTE;
  31.  
  32. public String EN;
  33. public String FN;
  34. public String LN;
  35. public String EG;
  36. public String WL;
  37. public String DR;
  38. public String AS;
  39. public String HW;
  40. public String HPW;
  41. public String WPY;
  42. public String EEA;
  43. public float NI;
  44. public float GI;
  45. boolean found = false;
  46. public void SaveToFile(){
  47. String file = LP.fileName;
  48. try {
  49. FileWriter fw = new FileWriter(file,true);
  50. BufferedWriter out = new BufferedWriter(fw);
  51. if (((String) jComboBox1.getSelectedItem()).equals("Part-Time")){
  52. out.write(jComboBox1.getSelectedItem().toString().trim()+","+EN+","+EEA+","+FN+","+LN+","+EG+","+WL+","+DR+","+HW+","+HPW+","+WPY+","+GI+","+NI);
  53.  
  54. }
  55. else{
  56. out.write(jComboBox1.getSelectedItem().toString().trim()+","+EN+","+EEA+","+FN+","+LN+","+EG+","+WL+","+DR+","+"-"+","+"-"+","+"-"+","+AS+","+NI);
  57.  
  58. }
  59. out.newLine();
  60. out.close();
  61. }
  62.  
  63. catch(IOException e){
  64. JOptionPane.showMessageDialog(null, e.getMessage());
  65. }
  66.  
  67. }
  68.  
  69. public void SearchInFile(String s){
  70.  
  71. String fileName = LP.fileName;
  72.  
  73. try {
  74. FileReader reader = new FileReader(fileName);
  75. BufferedReader br = new BufferedReader(reader);
  76.  
  77. String line;
  78.  
  79. while ((line = br.readLine()) != null) {
  80. String[] parts = line.split(",");
  81. if (parts[1].equals(s)){
  82. found = true;
  83. }
  84. }
  85. reader.close();
  86. br.close();
  87.  
  88. }
  89. catch (Exception ex) {
  90. JOptionPane.showMessageDialog(null,ex.getMessage()); ;
  91. }
  92. }
  93.  
  94.  
  95. public AddEmployee() {
  96. initComponents();
  97. UsernameLabel.setText((String) LP.fileName);
  98. this.setOpacity(0.95f);
  99. if (((String) jComboBox1.getSelectedItem()).equals("Part-Time")) {
  100. IAS.setVisible(false);
  101. aS.setVisible(false);
  102. jSeparator8.setVisible(false);
  103. }
  104. }
  105.  
  106. /**
  107. * This method is called from within the constructor to initialize the form.
  108. * WARNING: Do NOT modify this code. The content of this method is always
  109. * regenerated by the Form Editor.
  110. */
  111. @SuppressWarnings("unchecked")
  112. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  113. private void initComponents() {
  114.  
  115. MenuBar = new javax.swing.JPanel();
  116. SignOutPanel = new javax.swing.JPanel();
  117. SignOutLabel = new javax.swing.JLabel();
  118. EditPanel = new javax.swing.JPanel();
  119. EditLabel = new javax.swing.JLabel();
  120. RemovePanel = new javax.swing.JPanel();
  121. RemoveLabel = new javax.swing.JLabel();
  122. ViewPanel = new javax.swing.JPanel();
  123. ViewLabel = new javax.swing.JLabel();
  124. AddPanel = new javax.swing.JPanel();
  125. AddLabel = new javax.swing.JLabel();
  126. MenuPanel = new javax.swing.JPanel();
  127. MenuLabel = new javax.swing.JLabel();
  128. jPanel1 = new javax.swing.JPanel();
  129. ToolPanel = new javax.swing.JPanel();
  130. ToolLabel = new javax.swing.JLabel();
  131. jComboBox1 = new javax.swing.JComboBox<>();
  132. eN = new javax.swing.JLabel();
  133. IEN = new javax.swing.JFormattedTextField();
  134. jSeparator2 = new javax.swing.JSeparator();
  135. fN = new javax.swing.JLabel();
  136. jSeparator3 = new javax.swing.JSeparator();
  137. IFN = new javax.swing.JTextField();
  138. lN = new javax.swing.JLabel();
  139. jSeparator4 = new javax.swing.JSeparator();
  140. ILN = new javax.swing.JTextField();
  141. eG = new javax.swing.JLabel();
  142. IEG = new javax.swing.JComboBox<>();
  143. wL = new javax.swing.JLabel();
  144. jSeparator6 = new javax.swing.JSeparator();
  145. IWL = new javax.swing.JTextField();
  146. dR = new javax.swing.JLabel();
  147. IDR = new javax.swing.JFormattedTextField();
  148. jSeparator7 = new javax.swing.JSeparator();
  149. Save = new javax.swing.JPanel();
  150. jLabel18 = new javax.swing.JLabel();
  151. SaveLabel = new javax.swing.JLabel();
  152. aS = new javax.swing.JLabel();
  153. IAS = new javax.swing.JFormattedTextField();
  154. jSeparator8 = new javax.swing.JSeparator();
  155. hW = new javax.swing.JLabel();
  156. IHW = new javax.swing.JFormattedTextField();
  157. jSeparator11 = new javax.swing.JSeparator();
  158. hPW = new javax.swing.JLabel();
  159. IHPW = new javax.swing.JFormattedTextField();
  160. jSeparator9 = new javax.swing.JSeparator();
  161. wPY = new javax.swing.JLabel();
  162. IWPY = new javax.swing.JFormattedTextField();
  163. jSeparator10 = new javax.swing.JSeparator();
  164. eEA = new javax.swing.JLabel();
  165. IEEA = new javax.swing.JTextField();
  166. jSeparator5 = new javax.swing.JSeparator();
  167. jPanel3 = new javax.swing.JPanel();
  168. jSeparator1 = new javax.swing.JSeparator();
  169. Find = new javax.swing.JTextField();
  170. jLabel7 = new javax.swing.JLabel();
  171. UsernameLabel = new javax.swing.JLabel();
  172. ExitPanel = new javax.swing.JPanel();
  173. ExitLabel = new javax.swing.JLabel();
  174.  
  175. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  176. setTitle("Employee Information and Mangement System");
  177. setMinimumSize(new java.awt.Dimension(640, 757));
  178. setUndecorated(true);
  179. getContentPane().setLayout(null);
  180.  
  181. MenuBar.setBackground(new java.awt.Color(0, 102, 153));
  182. MenuBar.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  183.  
  184. SignOutPanel.setBackground(new java.awt.Color(0, 102, 153));
  185. SignOutPanel.addMouseListener(new java.awt.event.MouseAdapter() {
  186. public void mouseClicked(java.awt.event.MouseEvent evt) {
  187. SignOutPanelMouseClicked(evt);
  188. }
  189. public void mouseEntered(java.awt.event.MouseEvent evt) {
  190. SignOutPanelMouseEntered(evt);
  191. }
  192. public void mouseExited(java.awt.event.MouseEvent evt) {
  193. SignOutPanelMouseExited(evt);
  194. }
  195. });
  196. SignOutPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  197. SignOutPanel.add(SignOutLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 0, -1, 30));
  198.  
  199. MenuBar.add(SignOutPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 390, 50, 30));
  200.  
  201. EditPanel.setBackground(new java.awt.Color(0, 102, 153));
  202. EditPanel.addMouseListener(new java.awt.event.MouseAdapter() {
  203. public void mouseClicked(java.awt.event.MouseEvent evt) {
  204. EditPanelMouseClicked(evt);
  205. }
  206. public void mouseEntered(java.awt.event.MouseEvent evt) {
  207. EditPanelMouseEntered(evt);
  208. }
  209. public void mouseExited(java.awt.event.MouseEvent evt) {
  210. EditPanelMouseExited(evt);
  211. }
  212. });
  213. EditPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  214. EditPanel.add(EditLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 0, -1, 30));
  215.  
  216. MenuBar.add(EditPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 250, 50, 30));
  217.  
  218. RemovePanel.setBackground(new java.awt.Color(0, 102, 153));
  219. RemovePanel.addMouseListener(new java.awt.event.MouseAdapter() {
  220. public void mouseClicked(java.awt.event.MouseEvent evt) {
  221. RemovePanelMouseClicked(evt);
  222. }
  223. public void mouseEntered(java.awt.event.MouseEvent evt) {
  224. RemovePanelMouseEntered(evt);
  225. }
  226. public void mouseExited(java.awt.event.MouseEvent evt) {
  227. RemovePanelMouseExited(evt);
  228. }
  229. });
  230. RemovePanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  231. RemovePanel.add(RemoveLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 0, -1, 30));
  232.  
  233. MenuBar.add(RemovePanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 180, 50, 30));
  234.  
  235. ViewPanel.setBackground(new java.awt.Color(0, 102, 153));
  236. ViewPanel.addMouseListener(new java.awt.event.MouseAdapter() {
  237. public void mouseClicked(java.awt.event.MouseEvent evt) {
  238. ViewPanelMouseClicked(evt);
  239. }
  240. public void mouseEntered(java.awt.event.MouseEvent evt) {
  241. ViewPanelMouseEntered(evt);
  242. }
  243. public void mouseExited(java.awt.event.MouseEvent evt) {
  244. ViewPanelMouseExited(evt);
  245. }
  246. });
  247. ViewPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  248. ViewPanel.add(ViewLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 0, -1, 30));
  249.  
  250. MenuBar.add(ViewPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 320, 50, 30));
  251.  
  252. AddPanel.setBackground(new java.awt.Color(0, 102, 153));
  253. AddPanel.addMouseListener(new java.awt.event.MouseAdapter() {
  254. public void mouseClicked(java.awt.event.MouseEvent evt) {
  255. AddPanelMouseClicked(evt);
  256. }
  257. public void mouseEntered(java.awt.event.MouseEvent evt) {
  258. AddPanelMouseEntered(evt);
  259. }
  260. public void mouseExited(java.awt.event.MouseEvent evt) {
  261. AddPanelMouseExited(evt);
  262. }
  263. });
  264. AddPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  265. AddPanel.add(AddLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 0, -1, 30));
  266.  
  267. MenuBar.add(AddPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 110, 50, 30));
  268.  
  269. MenuPanel.setBackground(new java.awt.Color(0, 102, 153));
  270. MenuPanel.addMouseListener(new java.awt.event.MouseAdapter() {
  271. public void mouseClicked(java.awt.event.MouseEvent evt) {
  272. MenuPanelMouseClicked(evt);
  273. }
  274. public void mouseEntered(java.awt.event.MouseEvent evt) {
  275. MenuPanelMouseEntered(evt);
  276. }
  277. public void mouseExited(java.awt.event.MouseEvent evt) {
  278. MenuPanelMouseExited(evt);
  279. }
  280. });
  281. MenuPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  282. MenuPanel.add(MenuLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 0, -1, 30));
  283.  
  284. MenuBar.add(MenuPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 40, 50, 30));
  285.  
  286. getContentPane().add(MenuBar);
  287. MenuBar.setBounds(0, 0, 50, 1000);
  288.  
  289. jPanel1.setBackground(new java.awt.Color(0, 0, 0));
  290. jPanel1.setRequestFocusEnabled(false);
  291. jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  292.  
  293. ToolPanel.setBackground(new java.awt.Color(0, 0, 0));
  294. ToolPanel.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
  295. ToolPanel.addMouseListener(new java.awt.event.MouseAdapter() {
  296. public void mouseEntered(java.awt.event.MouseEvent evt) {
  297. ToolPanelMouseEntered(evt);
  298. }
  299. public void mouseExited(java.awt.event.MouseEvent evt) {
  300. ToolPanelMouseExited(evt);
  301. }
  302. });
  303. ToolPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  304.  
  305. ToolLabel.setFont(new java.awt.Font("Segoe UI Light", 0, 18)); // NOI18N
  306. ToolLabel.setForeground(new java.awt.Color(255, 255, 255));
  307. ToolLabel.setText("Add Employee to the System");
  308. ToolPanel.add(ToolLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 10, -1, -1));
  309.  
  310. jPanel1.add(ToolPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 560, 50));
  311.  
  312. jComboBox1.setBackground(new java.awt.Color(0, 0, 0));
  313. jComboBox1.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
  314. jComboBox1.setForeground(new java.awt.Color(255, 153, 0));
  315. jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Part-Time", "Full-Time" }));
  316. jComboBox1.setBorder(null);
  317. jComboBox1.addItemListener(new java.awt.event.ItemListener() {
  318. public void itemStateChanged(java.awt.event.ItemEvent evt) {
  319. jComboBox1ItemStateChanged(evt);
  320. }
  321. });
  322. jComboBox1.addActionListener(new java.awt.event.ActionListener() {
  323. public void actionPerformed(java.awt.event.ActionEvent evt) {
  324. jComboBox1ActionPerformed(evt);
  325. }
  326. });
  327. jPanel1.add(jComboBox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 80, 160, -1));
  328.  
  329. eN.setBackground(new java.awt.Color(255, 255, 255));
  330. eN.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  331. eN.setForeground(new java.awt.Color(51, 52, 54));
  332. eN.setText("Employee Number");
  333. jPanel1.add(eN, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, -1, -1));
  334.  
  335. IEN.setBackground(new java.awt.Color(0, 0, 0));
  336. IEN.setBorder(null);
  337. IEN.setForeground(new java.awt.Color(255, 153, 0));
  338. IEN.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
  339. IEN.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  340. IEN.addFocusListener(new java.awt.event.FocusAdapter() {
  341. public void focusGained(java.awt.event.FocusEvent evt) {
  342. IENFocusGained(evt);
  343. }
  344. public void focusLost(java.awt.event.FocusEvent evt) {
  345. IENFocusLost(evt);
  346. }
  347. });
  348. jPanel1.add(IEN, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 170, 560, 20));
  349.  
  350. jSeparator2.setMaximumSize(null);
  351. jSeparator2.setMinimumSize(null);
  352. jSeparator2.setPreferredSize(null);
  353. jSeparator2.setRequestFocusEnabled(false);
  354. jPanel1.add(jSeparator2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 190, 560, -1));
  355.  
  356. fN.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  357. fN.setForeground(new java.awt.Color(51, 52, 54));
  358. fN.setText("First Name");
  359. jPanel1.add(fN, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 280, -1, -1));
  360. jPanel1.add(jSeparator3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 330, 560, -1));
  361.  
  362. IFN.setBackground(new java.awt.Color(0, 0, 0));
  363. IFN.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  364. IFN.setForeground(new java.awt.Color(255, 153, 0));
  365. IFN.setBorder(null);
  366. IFN.addFocusListener(new java.awt.event.FocusAdapter() {
  367. public void focusGained(java.awt.event.FocusEvent evt) {
  368. IFNFocusGained(evt);
  369. }
  370. public void focusLost(java.awt.event.FocusEvent evt) {
  371. IFNFocusLost(evt);
  372. }
  373. });
  374. jPanel1.add(IFN, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 310, 560, 20));
  375.  
  376. lN.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  377. lN.setForeground(new java.awt.Color(51, 52, 54));
  378. lN.setText("Last Name");
  379. jPanel1.add(lN, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 350, -1, -1));
  380. jPanel1.add(jSeparator4, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 400, 560, -1));
  381.  
  382. ILN.setBackground(new java.awt.Color(0, 0, 0));
  383. ILN.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  384. ILN.setForeground(new java.awt.Color(255, 153, 0));
  385. ILN.setBorder(null);
  386. ILN.addFocusListener(new java.awt.event.FocusAdapter() {
  387. public void focusGained(java.awt.event.FocusEvent evt) {
  388. ILNFocusGained(evt);
  389. }
  390. public void focusLost(java.awt.event.FocusEvent evt) {
  391. ILNFocusLost(evt);
  392. }
  393. });
  394. jPanel1.add(ILN, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 380, 560, 20));
  395.  
  396. eG.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  397. eG.setForeground(new java.awt.Color(51, 52, 54));
  398. eG.setText("Gender");
  399. jPanel1.add(eG, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 410, -1, -1));
  400.  
  401. IEG.setBackground(new java.awt.Color(0, 0, 0));
  402. IEG.setForeground(new java.awt.Color(255, 153, 0));
  403. IEG.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Male", "Female", "Other" }));
  404. IEG.setBorder(null);
  405. IEG.addFocusListener(new java.awt.event.FocusAdapter() {
  406. public void focusGained(java.awt.event.FocusEvent evt) {
  407. IEGFocusGained(evt);
  408. }
  409. public void focusLost(java.awt.event.FocusEvent evt) {
  410. IEGFocusLost(evt);
  411. }
  412. });
  413. jPanel1.add(IEG, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 430, 560, 40));
  414.  
  415. wL.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  416. wL.setForeground(new java.awt.Color(51, 52, 54));
  417. wL.setText("Work Location");
  418. jPanel1.add(wL, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 490, -1, -1));
  419. jPanel1.add(jSeparator6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 540, 560, -1));
  420.  
  421. IWL.setBackground(new java.awt.Color(0, 0, 0));
  422. IWL.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  423. IWL.setForeground(new java.awt.Color(255, 153, 0));
  424. IWL.setBorder(null);
  425. IWL.addFocusListener(new java.awt.event.FocusAdapter() {
  426. public void focusGained(java.awt.event.FocusEvent evt) {
  427. IWLFocusGained(evt);
  428. }
  429. public void focusLost(java.awt.event.FocusEvent evt) {
  430. IWLFocusLost(evt);
  431. }
  432. });
  433. jPanel1.add(IWL, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 520, 560, 20));
  434.  
  435. dR.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  436. dR.setForeground(new java.awt.Color(51, 52, 54));
  437. dR.setText("Deduction Rate");
  438. jPanel1.add(dR, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 560, -1, -1));
  439.  
  440. IDR.setBackground(new java.awt.Color(0, 0, 0));
  441. IDR.setBorder(null);
  442. IDR.setForeground(new java.awt.Color(255, 153, 0));
  443. IDR.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
  444. IDR.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  445. IDR.addFocusListener(new java.awt.event.FocusAdapter() {
  446. public void focusGained(java.awt.event.FocusEvent evt) {
  447. IDRFocusGained(evt);
  448. }
  449. public void focusLost(java.awt.event.FocusEvent evt) {
  450. IDRFocusLost(evt);
  451. }
  452. });
  453. jPanel1.add(IDR, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 590, 560, 20));
  454. jPanel1.add(jSeparator7, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 610, 560, -1));
  455.  
  456. Save.setBackground(new java.awt.Color(0, 0, 0));
  457. Save.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
  458. Save.addMouseListener(new java.awt.event.MouseAdapter() {
  459. public void mouseClicked(java.awt.event.MouseEvent evt) {
  460. SaveMouseClicked(evt);
  461. }
  462. public void mouseEntered(java.awt.event.MouseEvent evt) {
  463. SaveMouseEntered(evt);
  464. }
  465. public void mouseExited(java.awt.event.MouseEvent evt) {
  466. SaveMouseExited(evt);
  467. }
  468. });
  469. Save.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  470.  
  471. jLabel18.setIcon(new javax.swing.ImageIcon(getClass().getResource("/InheritancePackage/Save_1.png"))); // NOI18N
  472. Save.add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, -1));
  473.  
  474. SaveLabel.setBackground(new java.awt.Color(255, 255, 255));
  475. SaveLabel.setFont(new java.awt.Font("Segoe UI Light", 1, 18)); // NOI18N
  476. SaveLabel.setForeground(new java.awt.Color(255, 255, 255));
  477. SaveLabel.setText("Save");
  478. Save.add(SaveLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, 50, -1));
  479.  
  480. jPanel1.add(Save, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 70, 60, 80));
  481.  
  482. aS.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  483. aS.setForeground(new java.awt.Color(51, 52, 54));
  484. aS.setText("Salary");
  485. jPanel1.add(aS, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 630, -1, -1));
  486.  
  487. IAS.setBackground(new java.awt.Color(0, 0, 0));
  488. IAS.setBorder(null);
  489. IAS.setForeground(new java.awt.Color(255, 153, 0));
  490. IAS.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
  491. IAS.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  492. IAS.addFocusListener(new java.awt.event.FocusAdapter() {
  493. public void focusGained(java.awt.event.FocusEvent evt) {
  494. IASFocusGained(evt);
  495. }
  496. public void focusLost(java.awt.event.FocusEvent evt) {
  497. IASFocusLost(evt);
  498. }
  499. });
  500. jPanel1.add(IAS, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 660, 560, 20));
  501. jPanel1.add(jSeparator8, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 680, 560, -1));
  502.  
  503. hW.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  504. hW.setForeground(new java.awt.Color(51, 52, 54));
  505. hW.setText("HourlyWage");
  506. jPanel1.add(hW, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 630, -1, -1));
  507.  
  508. IHW.setBackground(new java.awt.Color(0, 0, 0));
  509. IHW.setBorder(null);
  510. IHW.setForeground(new java.awt.Color(255, 153, 0));
  511. IHW.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
  512. IHW.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  513. IHW.addFocusListener(new java.awt.event.FocusAdapter() {
  514. public void focusGained(java.awt.event.FocusEvent evt) {
  515. IHWFocusGained(evt);
  516. }
  517. public void focusLost(java.awt.event.FocusEvent evt) {
  518. IHWFocusLost(evt);
  519. }
  520. });
  521. jPanel1.add(IHW, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 660, 160, 20));
  522. jPanel1.add(jSeparator11, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 680, 160, 10));
  523.  
  524. hPW.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  525. hPW.setForeground(new java.awt.Color(51, 52, 54));
  526. hPW.setText("Hours Per Week");
  527. jPanel1.add(hPW, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 630, -1, -1));
  528.  
  529. IHPW.setBackground(new java.awt.Color(0, 0, 0));
  530. IHPW.setBorder(null);
  531. IHPW.setForeground(new java.awt.Color(255, 153, 0));
  532. IHPW.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
  533. IHPW.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  534. IHPW.addFocusListener(new java.awt.event.FocusAdapter() {
  535. public void focusGained(java.awt.event.FocusEvent evt) {
  536. IHPWFocusGained(evt);
  537. }
  538. public void focusLost(java.awt.event.FocusEvent evt) {
  539. IHPWFocusLost(evt);
  540. }
  541. });
  542. jPanel1.add(IHPW, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 660, 160, 20));
  543. jPanel1.add(jSeparator9, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 680, 160, 10));
  544.  
  545. wPY.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  546. wPY.setForeground(new java.awt.Color(51, 52, 54));
  547. wPY.setText("Weeks Per Year");
  548. jPanel1.add(wPY, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 630, -1, -1));
  549.  
  550. IWPY.setBackground(new java.awt.Color(0, 0, 0));
  551. IWPY.setBorder(null);
  552. IWPY.setForeground(new java.awt.Color(255, 153, 0));
  553. IWPY.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
  554. IWPY.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  555. IWPY.addFocusListener(new java.awt.event.FocusAdapter() {
  556. public void focusGained(java.awt.event.FocusEvent evt) {
  557. IWPYFocusGained(evt);
  558. }
  559. public void focusLost(java.awt.event.FocusEvent evt) {
  560. IWPYFocusLost(evt);
  561. }
  562. });
  563. jPanel1.add(IWPY, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 660, 160, 20));
  564. jPanel1.add(jSeparator10, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 680, 160, 10));
  565.  
  566. eEA.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  567. eEA.setForeground(new java.awt.Color(51, 52, 54));
  568. eEA.setText("Employee Email Address");
  569. jPanel1.add(eEA, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 210, -1, -1));
  570.  
  571. IEEA.setBackground(new java.awt.Color(0, 0, 0));
  572. IEEA.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  573. IEEA.setForeground(new java.awt.Color(255, 153, 0));
  574. IEEA.setBorder(null);
  575. IEEA.addFocusListener(new java.awt.event.FocusAdapter() {
  576. public void focusGained(java.awt.event.FocusEvent evt) {
  577. IEEAFocusGained(evt);
  578. }
  579. public void focusLost(java.awt.event.FocusEvent evt) {
  580. IEEAFocusLost(evt);
  581. }
  582. });
  583. jPanel1.add(IEEA, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 240, 560, 20));
  584. jPanel1.add(jSeparator5, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 260, 560, -1));
  585.  
  586. getContentPane().add(jPanel1);
  587. jPanel1.setBounds(50, 50, 600, 720);
  588.  
  589. jPanel3.setBackground(new java.awt.Color(255, 255, 255));
  590. jPanel3.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
  591. public void mouseDragged(java.awt.event.MouseEvent evt) {
  592. jPanel3MouseDragged(evt);
  593. }
  594. });
  595. jPanel3.addMouseListener(new java.awt.event.MouseAdapter() {
  596. public void mousePressed(java.awt.event.MouseEvent evt) {
  597. jPanel3MousePressed(evt);
  598. }
  599. });
  600. jPanel3.setLayout(null);
  601. jPanel3.add(jSeparator1);
  602. jSeparator1.setBounds(100, 40, 210, 10);
  603.  
  604. Find.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
  605. Find.setForeground(new java.awt.Color(255, 153, 0));
  606. Find.setBorder(null);
  607. Find.addKeyListener(new java.awt.event.KeyAdapter() {
  608. public void keyPressed(java.awt.event.KeyEvent evt) {
  609. FindKeyPressed(evt);
  610. }
  611. });
  612. jPanel3.add(Find);
  613. Find.setBounds(100, 10, 210, 30);
  614.  
  615. jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/InheritancePackage/search.png"))); // NOI18N
  616. jPanel3.add(jLabel7);
  617. jLabel7.setBounds(60, 10, 32, 30);
  618.  
  619. UsernameLabel.setText("Username");
  620. jPanel3.add(UsernameLabel);
  621. UsernameLabel.setBounds(460, 0, 100, 40);
  622.  
  623. ExitPanel.setBackground(new java.awt.Color(255, 255, 255));
  624. ExitPanel.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
  625. ExitPanel.setMaximumSize(new java.awt.Dimension(32, 32));
  626. ExitPanel.setMinimumSize(new java.awt.Dimension(32, 32));
  627. ExitPanel.setPreferredSize(new java.awt.Dimension(32, 32));
  628. ExitPanel.addMouseListener(new java.awt.event.MouseAdapter() {
  629. public void mouseClicked(java.awt.event.MouseEvent evt) {
  630. ExitPanelMouseClicked(evt);
  631. }
  632. public void mouseEntered(java.awt.event.MouseEvent evt) {
  633. ExitPanelMouseEntered(evt);
  634. }
  635. public void mouseExited(java.awt.event.MouseEvent evt) {
  636. ExitPanelMouseExited(evt);
  637. }
  638. });
  639. ExitPanel.setLayout(new java.awt.GridLayout(1, 0));
  640.  
  641. ExitLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
  642. ExitPanel.add(ExitLabel);
  643.  
  644. jPanel3.add(ExitPanel);
  645. ExitPanel.setBounds(590, 0, 32, 32);
  646.  
  647. getContentPane().add(jPanel3);
  648. jPanel3.setBounds(0, 0, 980, 50);
  649.  
  650. pack();
  651. setLocationRelativeTo(null);
  652. }// </editor-fold>
  653. private int xMouse, yMouse;
  654. private void jPanel3MousePressed(java.awt.event.MouseEvent evt) {
  655. // TODO add your handling code here:
  656. xMouse = evt.getX();
  657. yMouse = evt.getY();
  658. }
  659.  
  660. private void jPanel3MouseDragged(java.awt.event.MouseEvent evt) {
  661. // TODO add your handling code here:
  662. int x = evt.getXOnScreen();
  663. int y= evt.getYOnScreen();
  664. setLocation(x-xMouse,y-yMouse);
  665. }
  666.  
  667. private void MenuPanelMouseClicked(java.awt.event.MouseEvent evt) {
  668. // TODO add your handling code here:
  669. this.dispose();
  670. new Menu().setVisible(true);
  671. }
  672.  
  673. private void MenuPanelMouseEntered(java.awt.event.MouseEvent evt) {
  674. MenuPanel.setBackground(new Color(255,153,0));
  675. }
  676.  
  677. private void MenuPanelMouseExited(java.awt.event.MouseEvent evt) {
  678. // TODO add your handling code here:
  679. MenuPanel.setBackground(new Color(0,102,153));
  680. }
  681.  
  682. private void AddPanelMouseClicked(java.awt.event.MouseEvent evt) {
  683. // TODO add your handling code here:
  684. this.dispose();
  685. new AddEmployee().setVisible(true);
  686. }
  687.  
  688. private void AddPanelMouseEntered(java.awt.event.MouseEvent evt) {
  689. // TODO add your handling code here:
  690. AddPanel.setBackground(new Color(255,153,0));
  691.  
  692. }
  693.  
  694. private void AddPanelMouseExited(java.awt.event.MouseEvent evt) {
  695. // TODO add your handling code here:
  696. AddPanel.setBackground(new Color(0,102,153));
  697. }
  698.  
  699. private void RemovePanelMouseClicked(java.awt.event.MouseEvent evt) {
  700. // TODO add your handling code here:
  701. this.dispose();
  702. new RemoveEmployee().setVisible(true);
  703. }
  704.  
  705. private void RemovePanelMouseEntered(java.awt.event.MouseEvent evt) {
  706. // TODO add your handling code here:
  707. RemovePanel.setBackground(new Color(255,153,0));
  708.  
  709. }
  710.  
  711. private void RemovePanelMouseExited(java.awt.event.MouseEvent evt) {
  712. // TODO add your handling code here:
  713. RemovePanel.setBackground(new Color(0,102,153));
  714.  
  715. }
  716.  
  717. private void EditPanelMouseClicked(java.awt.event.MouseEvent evt) {
  718. // TODO add your handling code here:
  719. this.dispose();
  720. new EditEmployee().setVisible(true);
  721. }
  722.  
  723. private void EditPanelMouseEntered(java.awt.event.MouseEvent evt) {
  724. // TODO add your handling code here:
  725. EditPanel.setBackground(new Color(255,153,0));
  726. }
  727.  
  728. private void EditPanelMouseExited(java.awt.event.MouseEvent evt) {
  729. // TODO add your handling code here:
  730. EditPanel.setBackground(new Color(0,102,153));
  731. }
  732.  
  733. private void ViewPanelMouseClicked(java.awt.event.MouseEvent evt) {
  734. this.dispose();
  735. new DisplaySystem().setVisible(true);
  736. }
  737.  
  738. private void ViewPanelMouseEntered(java.awt.event.MouseEvent evt) {
  739. // TODO add your handling code here:
  740. ViewPanel.setBackground(new Color(255,153,0));
  741. }
  742.  
  743. private void ViewPanelMouseExited(java.awt.event.MouseEvent evt) {
  744. ViewPanel.setBackground(new Color(0,102,153));
  745. }
  746.  
  747. private void SignOutPanelMouseClicked(java.awt.event.MouseEvent evt) {
  748. new LoginPage().setVisible(true);
  749. this.dispose();
  750. }
  751.  
  752. private void SignOutPanelMouseEntered(java.awt.event.MouseEvent evt) {
  753. SignOutPanel.setBackground(new Color(255,153,0));
  754. }
  755.  
  756. private void SignOutPanelMouseExited(java.awt.event.MouseEvent evt) {
  757. SignOutPanel.setBackground(new Color(0,102,153));
  758. }
  759.  
  760. private void ToolPanelMouseEntered(java.awt.event.MouseEvent evt) {
  761. ToolLabel.setForeground(Color.WHITE);
  762. ToolPanel.setBackground(new Color(255,153,0));
  763. ToolPanel.setBorder(new LineBorder(new Color(255,153,0),1,true));
  764. }
  765.  
  766. private void ToolPanelMouseExited(java.awt.event.MouseEvent evt) {
  767. ToolLabel.setForeground(Color.WHITE);
  768. ToolPanel.setBackground(Color.BLACK);
  769. ToolPanel.setBorder(new LineBorder(Color.WHITE,1,true));
  770. }
  771.  
  772. private void ExitPanelMouseClicked(java.awt.event.MouseEvent evt) {
  773. System.exit(0);
  774. }
  775.  
  776. private void ExitPanelMouseEntered(java.awt.event.MouseEvent evt) {
  777. ExitLabel.setForeground(Color.WHITE);
  778. ExitPanel.setBackground(new Color(255, 255, 255));
  779. ExitPanel.setBorder(new LineBorder(new Color(255, 153, 0), 1, true));
  780. }
  781.  
  782. private void ExitPanelMouseExited(java.awt.event.MouseEvent evt) {
  783. ExitLabel.setForeground(new Color(255, 153, 0));
  784. ExitPanel.setBackground(new Color(0, 102, 153));
  785. ExitPanel.setBorder(new LineBorder(Color.WHITE, 0, true));
  786. }
  787.  
  788. private void jComboBox1ItemStateChanged(java.awt.event.ItemEvent evt) {
  789. // TODO add your handling code here:
  790. if (((String) jComboBox1.getSelectedItem()).equals("Full-Time")){
  791. IAS.setVisible(true);
  792. aS.setVisible(true);
  793. jSeparator8.setVisible(true);
  794. jSeparator9.setVisible(false);
  795. jSeparator10.setVisible(false);
  796. jSeparator11.setVisible(false);
  797. hPW.setVisible(false);
  798. hW.setVisible(false);
  799. wPY.setVisible(false);
  800. IHW.setText(null);
  801. IHW.setVisible(false);
  802. IHPW.setText(null);
  803. IHPW.setVisible(false);
  804. IWPY.setText(null);
  805. IWPY.setVisible(false);
  806.  
  807. }
  808. else{
  809. IAS.setText(null);
  810. IAS.setVisible(false);
  811. aS.setVisible(false);
  812. jSeparator8.setVisible(false);
  813. jSeparator9.setVisible(true);
  814. jSeparator10.setVisible(true);
  815. jSeparator11.setVisible(true);
  816. hPW.setVisible(true);
  817. hW.setVisible(true);
  818. wPY.setVisible(true);
  819. IHW.setVisible(true);
  820. IHPW.setVisible(true);
  821. IWPY.setVisible(true);
  822. }
  823.  
  824. }
  825.  
  826. private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {
  827. // TODO add your handling code here:
  828. }
  829.  
  830. private void SaveMouseClicked(java.awt.event.MouseEvent evt) {
  831. // TODO add your handling code here:
  832. SearchInFile(IEN.getText().trim());
  833. EN = IEN.getText().trim();
  834. FN = IFN.getText().trim();
  835. LN = ILN.getText().trim();
  836. EG = IEG.getSelectedItem().toString().trim();
  837. WL = IWL.getText().trim();
  838. DR = IDR.getText().trim();
  839. AS = IAS.getText().trim();
  840. HW = IHW.getText().trim();
  841. HPW = IHPW.getText().trim();
  842. WPY = IWPY.getText().trim();
  843. EEA = IEEA.getText().trim();
  844.  
  845.  
  846. if (((String) jComboBox1.getSelectedItem()).equals("Full-Time") && (EEA.isEmpty() || EN.isEmpty() || FN.isEmpty() || LN.isEmpty() || WL.isEmpty() || DR.isEmpty() || AS.isEmpty())) {
  847. JOptionPane.showMessageDialog(null, "Please Enter All Fields!");
  848. } else if (((String) jComboBox1.getSelectedItem()).equals("Part-Time") && (EEA.isEmpty() || EN.isEmpty() || FN.isEmpty() || LN.isEmpty() || WL.isEmpty() || DR.isEmpty() || HW.isEmpty() || HPW.isEmpty() || WPY.isEmpty())) {
  849. JOptionPane.showMessageDialog(null, "Please Enter All Fields!");
  850. } else if (found == false) {
  851. if (((String) jComboBox1.getSelectedItem()).equals("Full-Time")) {
  852. someFTE = new FTE(Integer.parseInt(EN), FN, LN, EG, WL, Double.parseDouble(DR), Double.parseDouble(AS));
  853. theHT.addToTable(someFTE);
  854. NI = (Float.parseFloat(AS)*(1-(Float.parseFloat(DR)/100)));
  855.  
  856. SaveToFile();
  857.  
  858. } else {
  859. somePTE = new PTE(Integer.parseInt(EN), FN, LN, EG, WL, Double.parseDouble(DR), Double.parseDouble(HW), Double.parseDouble(HPW), Double.parseDouble(WPY));
  860. NI = (Float.parseFloat(HPW)*Float.parseFloat(WPY)*Float.parseFloat(HW)*(1-(Float.parseFloat(DR)/100)));
  861. GI = (Float.parseFloat(HPW)*Float.parseFloat(WPY)*Float.parseFloat(HW));
  862.  
  863. SaveToFile();
  864. }
  865. IAS.setText(null);
  866. IHW.setText(null);
  867. IHPW.setText(null);
  868. IWPY.setText(null);
  869. IEN.setText(null);
  870. IDR.setText(null);
  871. IWL.setText(null);
  872. IFN.setText(null);
  873. ILN.setText(null);
  874. IEEA.setText(null);
  875.  
  876. JOptionPane.showMessageDialog(null, "Employee Added 😁!");
  877. IEN.setText(null);
  878. } else if (found == true) {
  879. JOptionPane.showMessageDialog(null, "Employee number already in database!");
  880. found = false;
  881. }
  882. }
  883.  
  884. private void SaveMouseEntered(java.awt.event.MouseEvent evt) {
  885. // TODO add your handling code here:
  886. SaveLabel.setForeground(Color.WHITE);
  887. Save.setBackground(new Color(255,153,0));
  888. Save.setBorder(new LineBorder(new Color(255,153,0),1,true));
  889. }
  890.  
  891. private void SaveMouseExited(java.awt.event.MouseEvent evt) {
  892. // TODO add your handling code here:
  893. SaveLabel.setForeground(Color.white);
  894. Save.setBackground(Color.BLACK);
  895. Save.setBorder(new LineBorder(Color.WHITE,1,true));
  896. }
  897.  
  898. private void IENFocusGained(java.awt.event.FocusEvent evt) {
  899. // TODO add your handling code here
  900. eN.setForeground(new Color(53,113,177));
  901. }
  902.  
  903. private void IENFocusLost(java.awt.event.FocusEvent evt) {
  904. eN.setForeground(new Color(51,52,54));
  905. }
  906.  
  907. private void IFNFocusGained(java.awt.event.FocusEvent evt) {
  908. fN.setForeground(new Color(53,113,177));
  909. }
  910.  
  911. private void IFNFocusLost(java.awt.event.FocusEvent evt) {
  912. fN.setForeground(new Color(51,52,54));
  913. }
  914.  
  915. private void ILNFocusGained(java.awt.event.FocusEvent evt) {
  916. lN.setForeground(new Color(53,113,177)); }
  917.  
  918. private void ILNFocusLost(java.awt.event.FocusEvent evt) {
  919. lN.setForeground(new Color(51,52,54));
  920. }
  921.  
  922. private void IWLFocusGained(java.awt.event.FocusEvent evt) {
  923. wL.setForeground(new Color(53,113,177)); }
  924.  
  925. private void IWLFocusLost(java.awt.event.FocusEvent evt) {
  926. wL.setForeground(new Color(51,52,54));
  927. }
  928.  
  929. private void IDRFocusGained(java.awt.event.FocusEvent evt) {
  930. dR.setForeground(new Color(53,113,177)); }
  931.  
  932. private void IDRFocusLost(java.awt.event.FocusEvent evt) {
  933. dR.setForeground(new Color(51,52,54));
  934. }
  935.  
  936. private void IASFocusGained(java.awt.event.FocusEvent evt) {
  937. aS.setForeground(new Color(53,113,177)); }
  938.  
  939. private void IASFocusLost(java.awt.event.FocusEvent evt) {
  940. aS.setForeground(new Color(51,52,54));
  941. }
  942.  
  943. private void IHWFocusGained(java.awt.event.FocusEvent evt) {
  944. hW.setForeground(new Color(53,113,177)); }
  945.  
  946. private void IHWFocusLost(java.awt.event.FocusEvent evt) {
  947. hW.setForeground(new Color(51,52,54));
  948. }
  949.  
  950. private void IHPWFocusGained(java.awt.event.FocusEvent evt) {
  951. hPW.setForeground(new Color(53,113,177)); }
  952.  
  953. private void IHPWFocusLost(java.awt.event.FocusEvent evt) {
  954. hPW.setForeground(new Color(51,52,54));
  955. }
  956.  
  957. private void IWPYFocusGained(java.awt.event.FocusEvent evt) {
  958. wPY.setForeground(new Color(53,113,177)); }
  959.  
  960. private void IWPYFocusLost(java.awt.event.FocusEvent evt) {
  961. wPY.setForeground(new Color(51,52,54));
  962. }
  963. private void FindKeyPressed(java.awt.event.KeyEvent evt) {
  964. DisplaySystem DS = new DisplaySystem();
  965. if (evt.getKeyCode()==KeyEvent.VK_ENTER){
  966. DS.Search(Find.getText().trim());
  967. }
  968. }
  969.  
  970. private void IEGFocusGained(java.awt.event.FocusEvent evt) {
  971. eG.setForeground(new Color(53,113,177)); }
  972.  
  973. private void IEGFocusLost(java.awt.event.FocusEvent evt) {
  974. eG.setForeground(new Color(51,52,54)); }
  975.  
  976. private void IEEAFocusGained(java.awt.event.FocusEvent evt) {
  977. eEA.setForeground(new Color(53,113,177));
  978. }
  979.  
  980. private void IEEAFocusLost(java.awt.event.FocusEvent evt) {
  981. eEA.setForeground(new Color(51,52,54));
  982. }
  983.  
  984. /**
  985. * @param args the command line arguments
  986. */
  987. public static void main(String args[]) {
  988. /* Create and display the form */
  989. java.awt.EventQueue.invokeLater(new Runnable() {
  990. public void run() {
  991. new AddEmployee().setVisible(true);
  992. }
  993. });
  994. }
  995.  
  996. // Variables declaration - do not modify
  997. private javax.swing.JLabel AddLabel;
  998. private javax.swing.JPanel AddPanel;
  999. private javax.swing.JLabel EditLabel;
  1000. private javax.swing.JPanel EditPanel;
  1001. private javax.swing.JLabel ExitLabel;
  1002. private javax.swing.JPanel ExitPanel;
  1003. private javax.swing.JTextField Find;
  1004. public static javax.swing.JFormattedTextField IAS;
  1005. public static javax.swing.JFormattedTextField IDR;
  1006. public static javax.swing.JTextField IEEA;
  1007. public static javax.swing.JComboBox<String> IEG;
  1008. public static javax.swing.JFormattedTextField IEN;
  1009. public static javax.swing.JTextField IFN;
  1010. public static javax.swing.JFormattedTextField IHPW;
  1011. public static javax.swing.JFormattedTextField IHW;
  1012. public static javax.swing.JTextField ILN;
  1013. public static javax.swing.JTextField IWL;
  1014. public static javax.swing.JFormattedTextField IWPY;
  1015. private javax.swing.JPanel MenuBar;
  1016. private javax.swing.JLabel MenuLabel;
  1017. private javax.swing.JPanel MenuPanel;
  1018. private javax.swing.JLabel RemoveLabel;
  1019. private javax.swing.JPanel RemovePanel;
  1020. private javax.swing.JPanel Save;
  1021. private javax.swing.JLabel SaveLabel;
  1022. private javax.swing.JLabel SignOutLabel;
  1023. private javax.swing.JPanel SignOutPanel;
  1024. private javax.swing.JLabel ToolLabel;
  1025. private javax.swing.JPanel ToolPanel;
  1026. private javax.swing.JLabel UsernameLabel;
  1027. private javax.swing.JLabel ViewLabel;
  1028. private javax.swing.JPanel ViewPanel;
  1029. private javax.swing.JLabel aS;
  1030. private javax.swing.JLabel dR;
  1031. private javax.swing.JLabel eEA;
  1032. private javax.swing.JLabel eG;
  1033. private javax.swing.JLabel eN;
  1034. private javax.swing.JLabel fN;
  1035. private javax.swing.JLabel hPW;
  1036. private javax.swing.JLabel hW;
  1037. public static javax.swing.JComboBox<String> jComboBox1;
  1038. private javax.swing.JLabel jLabel18;
  1039. private javax.swing.JLabel jLabel7;
  1040. private javax.swing.JPanel jPanel1;
  1041. private javax.swing.JPanel jPanel3;
  1042. private javax.swing.JSeparator jSeparator1;
  1043. private javax.swing.JSeparator jSeparator10;
  1044. private javax.swing.JSeparator jSeparator11;
  1045. private javax.swing.JSeparator jSeparator2;
  1046. private javax.swing.JSeparator jSeparator3;
  1047. private javax.swing.JSeparator jSeparator4;
  1048. private javax.swing.JSeparator jSeparator5;
  1049. private javax.swing.JSeparator jSeparator6;
  1050. private javax.swing.JSeparator jSeparator7;
  1051. private javax.swing.JSeparator jSeparator8;
  1052. private javax.swing.JSeparator jSeparator9;
  1053. private javax.swing.JLabel lN;
  1054. private javax.swing.JLabel wL;
  1055. private javax.swing.JLabel wPY;
  1056. // End of variables declaration
  1057. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement