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 7.4KB

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