Advertisement
Lowe576

Untitled

May 30th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 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 library;
  7.  
  8. /**
  9. *
  10. * @author Lowe
  11. */
  12. import java.awt.*;
  13. import java.awt.event.*;
  14. import javax.swing.*;
  15. import java.io.*;
  16.  
  17. public class Gui {
  18.  
  19. private JFrame frame = new JFrame("Bibblan");
  20. private JPanel background, centerPanel, southPanel;
  21. private JLabel l_isbn,l_title, l_reclaim,l_lend,l_storage;
  22. private JTextField tf_isbn,tf_title, tf_reclaim,tf_lend,tf_storage;
  23. private JButton b_find,b_reclaim,b_lend,b_clear,b_newBook,b_save,b_load;
  24. private Book findB;
  25. private Library libraryN;
  26.  
  27.  
  28. public Gui(Library l){
  29. libraryN = l;
  30. background = new JPanel();
  31. background.setLayout((new BorderLayout()));
  32. centerPanel = new JPanel();
  33. background.setBorder(BorderFactory.createLineBorder(Color.BLUE,9,false));
  34.  
  35. centerPanel.setLayout((new GridLayout(5,2)));
  36. southPanel = new JPanel();
  37. southPanel.setLayout((new GridLayout(3,2)));
  38.  
  39. b_find = new JButton("find");
  40. b_reclaim = new JButton("return");
  41. b_lend = new JButton("lend");
  42. b_clear = new JButton("clear");
  43. b_newBook = new JButton("Add");
  44. b_save = new JButton("save");
  45. b_load = new JButton("load");
  46.  
  47. southPanel.add(b_find);
  48. southPanel.add(b_reclaim);
  49. southPanel.add(b_lend);
  50. southPanel.add(b_clear);
  51. southPanel.add(b_newBook);
  52. southPanel.add(b_save);
  53. southPanel.add(b_load);
  54.  
  55. l_isbn = new JLabel("isbn:");
  56. l_title = new JLabel("title:");
  57. l_reclaim = new JLabel("return:");
  58. l_lend = new JLabel("lend:");
  59. l_storage = new JLabel("storage:");
  60.  
  61. tf_isbn = new JTextField(12);
  62. tf_title = new JTextField(12);
  63. tf_reclaim = new JTextField(12);
  64. tf_lend = new JTextField(12);
  65. tf_storage = new JTextField(12);
  66.  
  67. centerPanel.add(l_isbn);
  68. centerPanel.add(tf_isbn);
  69. centerPanel.add(l_title);
  70. centerPanel.add(tf_title);
  71. centerPanel.add(l_reclaim);
  72. centerPanel.add(tf_reclaim);
  73. centerPanel.add(l_lend);
  74. centerPanel.add(tf_lend);
  75. centerPanel.add(l_storage);
  76. centerPanel.add(tf_storage);
  77.  
  78. frame.setContentPane(background);
  79. frame.pack();
  80. frame.setVisible(true);
  81.  
  82. background.add(centerPanel,BorderLayout.CENTER);
  83. background.add(southPanel,BorderLayout.SOUTH);
  84.  
  85. /*ClearHandler cl = new ClearHandler();
  86. FindHandler fh = new FindHandler();
  87.  
  88. this.b_clear.addActionListener(cl);
  89. this.b_lend.addActionListener(new LE());
  90. this.b_reclaim.addActionListener(new RE());
  91. this.b_find.addActionListener(fh);
  92. this.b_addNB.addActionListener(new addNB());
  93. this.libraryN = libraryN;*/
  94.  
  95. }
  96.  
  97.  
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement