You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AdressbuchView.java 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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 prfourgui.View;
  7. /**
  8. *
  9. * @author baumannan68085
  10. */
  11. public class AdressbuchView extends javax.swing.JFrame
  12. {
  13. /**
  14. * @return the toolUndo
  15. */
  16. public javax.swing.JButton getToolUndo() {
  17. return toolUndo;
  18. }
  19. /**
  20. * @param toolUndo the toolUndo to set
  21. */
  22. public void setToolUndo(javax.swing.JButton toolUndo) {
  23. this.toolUndo = toolUndo;
  24. }
  25. /**
  26. * Creates new form AdressbuchView
  27. */
  28. public AdressbuchView()
  29. {
  30. initComponents();
  31. }
  32. /**
  33. * This method is called from within the constructor to initialize the form.
  34. * WARNING: Do NOT modify this code. The content of this method is always
  35. * regenerated by the Form Editor.
  36. */
  37. @SuppressWarnings("unchecked")
  38. // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  39. private void initComponents() {
  40. jFileChooser1 = new javax.swing.JFileChooser();
  41. toolBar = new javax.swing.JToolBar();
  42. toolAdd = new javax.swing.JButton();
  43. toolRemove = new javax.swing.JButton();
  44. toolUndo = new javax.swing.JButton();
  45. adressTable2 = new prfourgui.View.AdressTable();
  46. pnStatus = new javax.swing.JScrollPane();
  47. txtStatus = new javax.swing.JTextArea();
  48. mnuMain = new javax.swing.JMenuBar();
  49. mnuDatei = new javax.swing.JMenu();
  50. mnuOpen = new javax.swing.JMenuItem();
  51. mnuSave = new javax.swing.JMenuItem();
  52. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  53. toolBar.setRollover(true);
  54. toolAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/prfourgui/Icons/New24.gif"))); // NOI18N
  55. toolAdd.setMnemonic('A');
  56. toolAdd.setToolTipText("Add Address");
  57. toolAdd.setFocusable(false);
  58. toolAdd.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  59. toolAdd.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  60. toolBar.add(toolAdd);
  61. toolRemove.setIcon(new javax.swing.ImageIcon(getClass().getResource("/prfourgui/Icons/Delete24.gif"))); // NOI18N
  62. toolRemove.setMnemonic('R');
  63. toolRemove.setToolTipText("Remove Address");
  64. toolRemove.setFocusable(false);
  65. toolRemove.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  66. toolRemove.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  67. toolBar.add(toolRemove);
  68. toolUndo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/prfourgui/Icons/Undo24.gif"))); // NOI18N
  69. toolUndo.setToolTipText("Undo");
  70. toolUndo.setFocusable(false);
  71. toolUndo.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  72. toolUndo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  73. toolBar.add(toolUndo);
  74. getContentPane().add(toolBar, java.awt.BorderLayout.NORTH);
  75. getContentPane().add(adressTable2, java.awt.BorderLayout.CENTER);
  76. txtStatus.setColumns(20);
  77. txtStatus.setRows(5);
  78. pnStatus.setViewportView(txtStatus);
  79. getContentPane().add(pnStatus, java.awt.BorderLayout.PAGE_END);
  80. mnuDatei.setMnemonic('D');
  81. mnuDatei.setText("Datei");
  82. mnuOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
  83. mnuOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/prfourgui/Icons/Open24.gif"))); // NOI18N
  84. mnuOpen.setMnemonic('O');
  85. mnuOpen.setText("Open");
  86. mnuOpen.addActionListener(new java.awt.event.ActionListener() {
  87. public void actionPerformed(java.awt.event.ActionEvent evt) {
  88. mnuOpenActionPerformed(evt);
  89. }
  90. });
  91. mnuDatei.add(mnuOpen);
  92. mnuSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
  93. mnuSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/prfourgui/Icons/Save24.gif"))); // NOI18N
  94. mnuSave.setMnemonic('S');
  95. mnuSave.setText("Save");
  96. mnuSave.setToolTipText("");
  97. mnuDatei.add(mnuSave);
  98. mnuMain.add(mnuDatei);
  99. setJMenuBar(mnuMain);
  100. pack();
  101. }// </editor-fold>//GEN-END:initComponents
  102. private void mnuOpenActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_mnuOpenActionPerformed
  103. {//GEN-HEADEREND:event_mnuOpenActionPerformed
  104. // TODO add your handling code here:
  105. }//GEN-LAST:event_mnuOpenActionPerformed
  106. /**
  107. * @param args the command line arguments
  108. */
  109. public static void main(String args[])
  110. {
  111. /* Set the Nimbus look and feel */
  112. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  113. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  114. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  115. */
  116. try
  117. {
  118. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
  119. {
  120. if ("Nimbus".equals(info.getName()))
  121. {
  122. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  123. break;
  124. }
  125. }
  126. }
  127. catch (ClassNotFoundException ex)
  128. {
  129. java.util.logging.Logger.getLogger(AdressbuchView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  130. }
  131. catch (InstantiationException ex)
  132. {
  133. java.util.logging.Logger.getLogger(AdressbuchView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  134. }
  135. catch (IllegalAccessException ex)
  136. {
  137. java.util.logging.Logger.getLogger(AdressbuchView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  138. }
  139. catch (javax.swing.UnsupportedLookAndFeelException ex)
  140. {
  141. java.util.logging.Logger.getLogger(AdressbuchView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  142. }
  143. //</editor-fold>
  144. /* Create and display the form */
  145. java.awt.EventQueue.invokeLater(new Runnable()
  146. {
  147. public void run()
  148. {
  149. new AdressbuchView().setVisible(true);
  150. }
  151. });
  152. }
  153. // Variables declaration - do not modify//GEN-BEGIN:variables
  154. private prfourgui.View.AdressTable adressTable2;
  155. private javax.swing.JFileChooser jFileChooser1;
  156. private javax.swing.JMenu mnuDatei;
  157. private javax.swing.JMenuBar mnuMain;
  158. private javax.swing.JMenuItem mnuOpen;
  159. private javax.swing.JMenuItem mnuSave;
  160. private javax.swing.JScrollPane pnStatus;
  161. private javax.swing.JButton toolAdd;
  162. private javax.swing.JToolBar toolBar;
  163. private javax.swing.JButton toolRemove;
  164. private javax.swing.JButton toolUndo;
  165. private javax.swing.JTextArea txtStatus;
  166. // End of variables declaration//GEN-END:variables
  167. /**
  168. * @return the mnuOpen
  169. */
  170. public javax.swing.JMenuItem getMnuOpen()
  171. {
  172. return mnuOpen;
  173. }
  174. /**
  175. * @return the mnuSave
  176. */
  177. public javax.swing.JMenuItem getMnuSave()
  178. {
  179. return mnuSave;
  180. }
  181. /**
  182. * @return the toolAdd
  183. */
  184. public javax.swing.JButton getToolAdd()
  185. {
  186. return toolAdd;
  187. }
  188. /**
  189. * @return the toolRemove
  190. */
  191. public javax.swing.JButton getToolRemove()
  192. {
  193. return toolRemove;
  194. }
  195. /**
  196. * @return the jFileChooser1
  197. */
  198. public javax.swing.JFileChooser getjFileChooser1()
  199. {
  200. return jFileChooser1;
  201. }
  202. /**
  203. * @return the txtStatus
  204. */
  205. public javax.swing.JTextArea getTxtStatus()
  206. {
  207. return txtStatus;
  208. }
  209. /**
  210. * @param txtStatus the txtStatus to set
  211. */
  212. public void setTxtStatus(javax.swing.JTextArea txtStatus)
  213. {
  214. this.txtStatus = txtStatus;
  215. }
  216. /**
  217. * @return the adressTable2
  218. */
  219. public prfourgui.View.AdressTable getAdressTable2()
  220. {
  221. return adressTable2;
  222. }
  223. /**
  224. * @param adressTable2 the adressTable2 to set
  225. */
  226. public void setAdressTable2(prfourgui.View.AdressTable adressTable2)
  227. {
  228. this.adressTable2 = adressTable2;
  229. }
  230. }