Browse Source

Bisschen Menü gedöns

master
Jens Schuhmann 5 months ago
parent
commit
d4374d13fd
2 changed files with 114 additions and 15 deletions
  1. 42
    3
      src/mvcgrafik/view/GrafikFrame.form
  2. 72
    12
      src/mvcgrafik/view/GrafikFrame.java

+ 42
- 3
src/mvcgrafik/view/GrafikFrame.form View File

@@ -1,10 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
<SubComponents>
<Menu class="javax.swing.JMenu" name="jMenu1">
<Properties>
<Property name="text" type="java.lang.String" value="File"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="miSave">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+S"/>
</Property>
<Property name="text" type="java.lang.String" value="Speichern"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="miSaveActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="miOpen">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+O"/>
</Property>
<Property name="text" type="java.lang.String" value="&#xd6;ffnen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="miOpenActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu2">
<Properties>
<Property name="text" type="java.lang.String" value="Edit"/>
</Properties>
</Menu>
</SubComponents>
</Menu>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
<SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-100,0,0,2,28"/>
<SyntheticProperty name="formSizePolicy" type="int" value="0"/>
<SyntheticProperty name="generateSize" type="boolean" value="true"/>
@@ -31,9 +72,7 @@
</Constraint>
</Constraints>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
</SubComponents>
</Form>

+ 72
- 12
src/mvcgrafik/view/GrafikFrame.java View File

@@ -32,18 +32,59 @@ public class GrafikFrame extends javax.swing.JFrame
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents()
{
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

gZeichenflaeche = new mvcgrafik.view.GrafikView();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
miSave = new javax.swing.JMenuItem();
miOpen = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

gZeichenflaeche.setLayout(new java.awt.BorderLayout());
getContentPane().add(gZeichenflaeche, java.awt.BorderLayout.CENTER);

jMenu1.setText("File");

miSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_DOWN_MASK));
miSave.setText("Speichern");
miSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
miSaveActionPerformed(evt);
}
});
jMenu1.add(miSave);

miOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_DOWN_MASK));
miOpen.setText("Öffnen");
miOpen.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
miOpenActionPerformed(evt);
}
});
jMenu1.add(miOpen);

jMenuBar1.add(jMenu1);

gZeichenflaeche = new mvcgrafik.view.GrafikView();
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().add(gZeichenflaeche, java.awt.BorderLayout.CENTER);
setJMenuBar(jMenuBar1);

setSize(new java.awt.Dimension(540, 412));
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
setSize(new java.awt.Dimension(540, 412));
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents

private void miSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miSaveActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_miSaveActionPerformed

private void miOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miOpenActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_miOpenActionPerformed

/**
* @param args the command line arguments
@@ -94,7 +135,26 @@ public class GrafikFrame extends javax.swing.JFrame
});
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private mvcgrafik.view.GrafikView gZeichenflaeche;
// End of variables declaration//GEN-END:variables
// Variables declaration - do not modify//GEN-BEGIN:variables
private mvcgrafik.view.GrafikView gZeichenflaeche;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem miOpen;
private javax.swing.JMenuItem miSave;
// End of variables declaration//GEN-END:variables

/**
* @return the miOpen
*/
public javax.swing.JMenuItem getMiOpen() {
return miOpen;
}

/**
* @return the miSave
*/
public javax.swing.JMenuItem getMiSave() {
return miSave;
}
}

Loading…
Cancel
Save