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.

GrafikMenuView.java 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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 mvcgrafik.view;
  7. /**
  8. *
  9. * @author hd
  10. */
  11. public class GrafikMenuView extends javax.swing.JFrame
  12. {
  13. /**
  14. * Creates new form GrafikMenuView
  15. */
  16. public GrafikMenuView()
  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. jPanel1 = new javax.swing.JPanel();
  31. grafikView1 = new mvcgrafik.view.GrafikView();
  32. jMenuBar1 = new javax.swing.JMenuBar();
  33. jMenu1 = new javax.swing.JMenu();
  34. btnOpen = new javax.swing.JMenuItem();
  35. btnSafe = new javax.swing.JMenuItem();
  36. jMenu2 = new javax.swing.JMenu();
  37. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  38. javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  39. jPanel1.setLayout(jPanel1Layout);
  40. jPanel1Layout.setHorizontalGroup(
  41. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  42. .addComponent(grafikView1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
  43. );
  44. jPanel1Layout.setVerticalGroup(
  45. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  46. .addComponent(grafikView1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
  47. );
  48. getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
  49. jMenu1.setText("File");
  50. btnOpen.setText("Open");
  51. btnOpen.addActionListener(new java.awt.event.ActionListener()
  52. {
  53. public void actionPerformed(java.awt.event.ActionEvent evt)
  54. {
  55. btnOpenActionPerformed(evt);
  56. }
  57. });
  58. jMenu1.add(btnOpen);
  59. btnSafe.setText("Safe");
  60. btnSafe.addActionListener(new java.awt.event.ActionListener()
  61. {
  62. public void actionPerformed(java.awt.event.ActionEvent evt)
  63. {
  64. btnSafeActionPerformed(evt);
  65. }
  66. });
  67. jMenu1.add(btnSafe);
  68. jMenuBar1.add(jMenu1);
  69. jMenu2.setText("Edit");
  70. jMenuBar1.add(jMenu2);
  71. setJMenuBar(jMenuBar1);
  72. pack();
  73. }// </editor-fold>//GEN-END:initComponents
  74. private void btnOpenActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnOpenActionPerformed
  75. {//GEN-HEADEREND:event_btnOpenActionPerformed
  76. // TODO add your handling code here:
  77. }//GEN-LAST:event_btnOpenActionPerformed
  78. private void btnSafeActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSafeActionPerformed
  79. {//GEN-HEADEREND:event_btnSafeActionPerformed
  80. // TODO add your handling code here:
  81. }//GEN-LAST:event_btnSafeActionPerformed
  82. /**
  83. * @param args the command line arguments
  84. */
  85. public static void main(String args[])
  86. {
  87. /* Set the Nimbus look and feel */
  88. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  89. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  90. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  91. */
  92. try
  93. {
  94. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
  95. {
  96. if ("Nimbus".equals(info.getName()))
  97. {
  98. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  99. break;
  100. }
  101. }
  102. }
  103. catch (ClassNotFoundException ex)
  104. {
  105. java.util.logging.Logger.getLogger(GrafikMenuView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  106. }
  107. catch (InstantiationException ex)
  108. {
  109. java.util.logging.Logger.getLogger(GrafikMenuView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  110. }
  111. catch (IllegalAccessException ex)
  112. {
  113. java.util.logging.Logger.getLogger(GrafikMenuView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  114. }
  115. catch (javax.swing.UnsupportedLookAndFeelException ex)
  116. {
  117. java.util.logging.Logger.getLogger(GrafikMenuView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  118. }
  119. //</editor-fold>
  120. /* Create and display the form */
  121. java.awt.EventQueue.invokeLater(new Runnable()
  122. {
  123. public void run()
  124. {
  125. new GrafikMenuView().setVisible(true);
  126. }
  127. });
  128. }
  129. // Variables declaration - do not modify//GEN-BEGIN:variables
  130. private javax.swing.JMenuItem btnOpen;
  131. private javax.swing.JMenuItem btnSafe;
  132. private mvcgrafik.view.GrafikView grafikView1;
  133. private javax.swing.JFileChooser jFileChooser1;
  134. private javax.swing.JMenu jMenu1;
  135. private javax.swing.JMenu jMenu2;
  136. private javax.swing.JMenuBar jMenuBar1;
  137. private javax.swing.JPanel jPanel1;
  138. // End of variables declaration//GEN-END:variables
  139. /**
  140. * @return the grafikView1
  141. */
  142. public mvcgrafik.view.GrafikView getGrafikView1()
  143. {
  144. return grafikView1;
  145. }
  146. /**
  147. * @return the jFileChooser1
  148. */
  149. public javax.swing.JFileChooser getjFileChooser1()
  150. {
  151. return jFileChooser1;
  152. }
  153. /**
  154. * @return the btnOpen
  155. */
  156. public javax.swing.JMenuItem getBtnOpen()
  157. {
  158. return btnOpen;
  159. }
  160. /**
  161. * @return the btnSafe
  162. */
  163. public javax.swing.JMenuItem getBtnSafe()
  164. {
  165. return btnSafe;
  166. }
  167. }