|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package view;
-
- /**
- *
- * @author PC
- */
- public class MainWindow extends javax.swing.JFrame {
-
- /**
- * @return the jpopEintragHinzufuegen
- */
- public javax.swing.JMenuItem getJpopEintragHinzufuegen() {
- return jpopEintragHinzufuegen;
- }
-
- /**
- * @return the jpopEintragLoeschen
- */
- public javax.swing.JMenuItem getJpopEintragLoeschen() {
- return jpopEintragLoeschen;
- }
-
-
-
-
- /**
- * Creates new form MainFrame
- */
- public MainWindow() {
- initComponents();
- }
-
- /**
- * This method is called from within the constructor to initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is always
- * regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
- private void initComponents() {
-
- jpopMenu = new javax.swing.JPopupMenu();
- jpopEintragHinzufuegen = new javax.swing.JMenuItem();
- jpopEintragLoeschen = new javax.swing.JMenuItem();
- jFileChooser = new javax.swing.JFileChooser();
- jpmainpanel = new javax.swing.JPanel();
- jtbmaintoolbar = new javax.swing.JToolBar();
- jbOpen = new javax.swing.JButton();
- jbSave = new javax.swing.JButton();
- statusbar = new javax.swing.JLabel();
- jSPAdressPane = new javax.swing.JScrollPane();
- jTableAdressen = new javax.swing.JTable();
- jMainMenu = new javax.swing.JMenuBar();
- jmFile = new javax.swing.JMenu();
- FileOpen = new javax.swing.JMenuItem();
- FileSave = new javax.swing.JMenuItem();
- jMenu2 = new javax.swing.JMenu();
- miUndo = new javax.swing.JMenuItem();
-
- jpopEintragHinzufuegen.setText("Eintrag hinzufügen");
- jpopMenu.add(jpopEintragHinzufuegen);
-
- jpopEintragLoeschen.setText("Eintrag löschen");
- jpopEintragLoeschen.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jpopEintragLoeschenActionPerformed(evt);
- }
- });
- jpopMenu.add(jpopEintragLoeschen);
-
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
-
- jpmainpanel.setLayout(new java.awt.BorderLayout());
-
- jtbmaintoolbar.setRollover(true);
-
- jbOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/icons/Open16.gif"))); // NOI18N
- jbOpen.setToolTipText("Open a file");
- jbOpen.setFocusable(false);
- jbOpen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- jbOpen.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
- jbOpen.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jbOpenActionPerformed(evt);
- }
- });
- jtbmaintoolbar.add(jbOpen);
-
- jbSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/icons/Save16.gif"))); // NOI18N
- jbSave.setToolTipText("Save a file");
- jbSave.setFocusable(false);
- jbSave.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- jbSave.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
- jtbmaintoolbar.add(jbSave);
-
- jpmainpanel.add(jtbmaintoolbar, java.awt.BorderLayout.PAGE_START);
-
- statusbar.setText(" ");
- jpmainpanel.add(statusbar, java.awt.BorderLayout.PAGE_END);
-
- jTableAdressen.setModel(new javax.swing.table.DefaultTableModel(
- new Object [][] {
- {null, null, null},
- {null, null, null},
- {null, null, null},
- {null, null, null}
- },
- new String [] {
- "Telefonnummer", "Adresse", "Name"
- }
- ));
- jTableAdressen.setComponentPopupMenu(jpopMenu);
- jSPAdressPane.setViewportView(jTableAdressen);
-
- jpmainpanel.add(jSPAdressPane, java.awt.BorderLayout.CENTER);
-
- jmFile.setMnemonic('f');
- jmFile.setText("File");
- jmFile.setToolTipText("General File Menu");
-
- FileOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_DOWN_MASK));
- FileOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/icons/Open16.gif"))); // NOI18N
- FileOpen.setMnemonic('o');
- FileOpen.setText("Open");
- FileOpen.setToolTipText("Open a selected File");
- jmFile.add(FileOpen);
-
- FileSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_DOWN_MASK));
- FileSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/icons/Save16.gif"))); // NOI18N
- FileSave.setText("Save");
- FileSave.setToolTipText("Save a file");
- jmFile.add(FileSave);
-
- jMainMenu.add(jmFile);
-
- jMenu2.setText("Edit");
-
- miUndo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.CTRL_DOWN_MASK));
- miUndo.setText("Undo");
- miUndo.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- miUndoActionPerformed(evt);
- }
- });
- jMenu2.add(miUndo);
-
- jMainMenu.add(jMenu2);
-
- setJMenuBar(jMainMenu);
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jpmainpanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jpmainpanel, javax.swing.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE)
- );
-
- pack();
- }// </editor-fold>//GEN-END:initComponents
-
- private void jpopEintragLoeschenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jpopEintragLoeschenActionPerformed
- // TODO add your handling code here:
- }//GEN-LAST:event_jpopEintragLoeschenActionPerformed
-
- private void jbOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbOpenActionPerformed
- // TODO add your handling code here:
- }//GEN-LAST:event_jbOpenActionPerformed
-
- private void miUndoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miUndoActionPerformed
- // TODO add your handling code here:
- }//GEN-LAST:event_miUndoActionPerformed
-
- /**
- * @param args the command line arguments
- */
- public static void main(String args[]) {
- /* Set the Nimbus look and feel */
- //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
- /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
- * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
- */
- try {
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (ClassNotFoundException ex) {
- java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- //</editor-fold>
- //</editor-fold>
-
- /* Create and display the form */
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new MainWindow().setVisible(true);
- }
- });
- }
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JMenuItem FileOpen;
- private javax.swing.JMenuItem FileSave;
- private javax.swing.JFileChooser jFileChooser;
- private javax.swing.JMenuBar jMainMenu;
- private javax.swing.JMenu jMenu2;
- private javax.swing.JScrollPane jSPAdressPane;
- private javax.swing.JTable jTableAdressen;
- private javax.swing.JButton jbOpen;
- private javax.swing.JButton jbSave;
- private javax.swing.JMenu jmFile;
- private javax.swing.JPanel jpmainpanel;
- private javax.swing.JMenuItem jpopEintragHinzufuegen;
- private javax.swing.JMenuItem jpopEintragLoeschen;
- private javax.swing.JPopupMenu jpopMenu;
- private javax.swing.JToolBar jtbmaintoolbar;
- private javax.swing.JMenuItem miUndo;
- private javax.swing.JLabel statusbar;
- // End of variables declaration//GEN-END:variables
-
- /**
- * @return the FileOpen
- */
- public javax.swing.JMenuItem getFileOpen() {
- return FileOpen;
- }
-
- /**
- * @return the FileSave
- */
- public javax.swing.JMenuItem getFileSave() {
- return FileSave;
- }
-
- /**
- * @return the jbOpen
- */
- public javax.swing.JButton getJbOpen() {
- return jbOpen;
- }
-
- /**
- * @return the jbSave
- */
- public javax.swing.JButton getJbSave() {
- return jbSave;
- }
-
- /**
- * @return the jFileChooser1
- */
- public javax.swing.JFileChooser getjFileChooser() {
- return jFileChooser;
- }
-
- /**
- * @return the statusbar
- */
- public javax.swing.JLabel getStatusbar() {
- return statusbar;
- }
-
- /**
- * @return the jTableAdressen
- */
- public javax.swing.JTable getjTableAdressen() {
- return jTableAdressen;
- }
-
- /**
- * @param jTableAdressen the jTableAdressen to set
- */
- public void setjTableAdressen(javax.swing.JTable jTableAdressen) {
- this.jTableAdressen = jTableAdressen;
- }
-
- /**
- * @return the miUndo
- */
- public javax.swing.JMenuItem getMiUndo() {
- return miUndo;
- }
- }
|