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.

ContentTable.java 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 view;
  7. /**
  8. *
  9. * @author endresma66479
  10. */
  11. public class ContentTable extends javax.swing.JPanel
  12. {
  13. /**
  14. * @return the jTable
  15. */
  16. public javax.swing.JTable getjTable()
  17. {
  18. return jTable;
  19. }
  20. /**
  21. * @return the ctmiAdd_popup
  22. */
  23. public javax.swing.JMenuItem getCtmiAdd_popup()
  24. {
  25. return ctmiAdd_popup;
  26. }
  27. /**
  28. * @return the ctmiDelRow_popup
  29. */
  30. public javax.swing.JMenuItem getCtmiDelRow_popup()
  31. {
  32. return ctmiDelRow_popup;
  33. }
  34. /**
  35. * @return the btnAdd
  36. */
  37. public javax.swing.JButton getBtnAdd()
  38. {
  39. return btnAdd;
  40. }
  41. /**
  42. * @return the btnDel
  43. */
  44. public javax.swing.JButton getBtnDel()
  45. {
  46. return btnDel;
  47. }
  48. /**
  49. * Creates new form ContentTable
  50. */
  51. public ContentTable()
  52. {
  53. initComponents();
  54. }
  55. /**
  56. * This method is called from within the constructor to initialize the form.
  57. * WARNING: Do NOT modify this code. The content of this method is always
  58. * regenerated by the Form Editor.
  59. */
  60. @SuppressWarnings("unchecked")
  61. // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  62. private void initComponents()
  63. {
  64. jPopupMenu1 = new javax.swing.JPopupMenu();
  65. ctmiAdd_popup = new javax.swing.JMenuItem();
  66. ctmiDelRow_popup = new javax.swing.JMenuItem();
  67. jScrollPane1 = new javax.swing.JScrollPane();
  68. jTable = new javax.swing.JTable();
  69. jToolBar1 = new javax.swing.JToolBar();
  70. btnAdd = new javax.swing.JButton();
  71. btnDel = new javax.swing.JButton();
  72. ctmiAdd_popup.setMnemonic('a');
  73. ctmiAdd_popup.setText("add a line");
  74. ctmiAdd_popup.setToolTipText("add a line");
  75. jPopupMenu1.add(ctmiAdd_popup);
  76. ctmiDelRow_popup.setMnemonic('d');
  77. ctmiDelRow_popup.setText("delete");
  78. ctmiDelRow_popup.setToolTipText("delete this line");
  79. jPopupMenu1.add(ctmiDelRow_popup);
  80. setPreferredSize(new java.awt.Dimension(600, 300));
  81. setLayout(new java.awt.BorderLayout());
  82. jTable.setModel(new javax.swing.table.DefaultTableModel(
  83. new Object [][]
  84. {
  85. {null, null, null, null, null, null},
  86. {null, null, null, null, null, null},
  87. {null, null, null, null, null, null},
  88. {null, null, null, null, null, null},
  89. {null, null, null, null, null, null},
  90. {null, null, null, null, null, null},
  91. {null, null, null, null, null, null},
  92. {null, null, null, null, null, null},
  93. {null, null, null, null, null, null},
  94. {null, null, null, null, null, null},
  95. {null, null, null, null, null, null},
  96. {null, null, null, null, null, null},
  97. {null, null, null, null, null, null},
  98. {null, null, null, null, null, null},
  99. {null, null, null, null, null, null},
  100. {null, null, null, null, null, null},
  101. {null, null, null, null, null, null},
  102. {null, null, null, null, null, null},
  103. {null, null, null, null, null, null},
  104. {null, null, null, null, null, null}
  105. },
  106. new String []
  107. {
  108. "Nachname", "Name", "Strasse, Nr.", "PLZ", "Ort", "Telefonnr."
  109. }
  110. ));
  111. jTable.setComponentPopupMenu(jPopupMenu1);
  112. jScrollPane1.setViewportView(jTable);
  113. add(jScrollPane1, java.awt.BorderLayout.CENTER);
  114. jToolBar1.setRollover(true);
  115. btnAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/icons/RowInsertAfter24.gif"))); // NOI18N
  116. btnAdd.setToolTipText("add entry");
  117. btnAdd.setFocusable(false);
  118. btnAdd.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  119. btnAdd.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  120. jToolBar1.add(btnAdd);
  121. btnDel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/icons/RowDelete24.gif"))); // NOI18N
  122. btnDel.setToolTipText("delete entry");
  123. btnDel.setFocusable(false);
  124. btnDel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  125. btnDel.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
  126. jToolBar1.add(btnDel);
  127. add(jToolBar1, java.awt.BorderLayout.PAGE_END);
  128. }// </editor-fold>//GEN-END:initComponents
  129. // Variables declaration - do not modify//GEN-BEGIN:variables
  130. private javax.swing.JButton btnAdd;
  131. private javax.swing.JButton btnDel;
  132. private javax.swing.JMenuItem ctmiAdd_popup;
  133. private javax.swing.JMenuItem ctmiDelRow_popup;
  134. private javax.swing.JPopupMenu jPopupMenu1;
  135. private javax.swing.JScrollPane jScrollPane1;
  136. private javax.swing.JTable jTable;
  137. private javax.swing.JToolBar jToolBar1;
  138. // End of variables declaration//GEN-END:variables
  139. }