KeyPressed hinzugefügt für leichtere Eingabe:D

This commit is contained in:
Simon Rieger 2016-10-17 10:06:37 +02:00
parent d5a340c319
commit 12f14b5dee
7 changed files with 19 additions and 1 deletions

3
.gitignore vendored
View file

@ -1,2 +1,3 @@
/nbproject/private/ /nbproject/private/
/build/ /build/
/dist/

View file

View file

View file

View file

View file

@ -123,6 +123,9 @@
<AccessibilityProperties> <AccessibilityProperties>
<Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value=""/> <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value=""/>
</AccessibilityProperties> </AccessibilityProperties>
<Events>
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jList1KeyPressed"/>
</Events>
<AuxValues> <AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/> <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues> </AuxValues>

View file

@ -5,6 +5,7 @@
*/ */
package forgemodpackbuilder; package forgemodpackbuilder;
import java.awt.event.KeyEvent;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.logging.Level; import java.util.logging.Level;
@ -61,6 +62,11 @@ public class GUI extends javax.swing.JFrame {
jLabel1.setText("Version"); jLabel1.setText("Version");
jList1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
jList1KeyPressed(evt);
}
});
jScrollPane1.setViewportView(jList1); jScrollPane1.setViewportView(jList1);
jList1.getAccessibleContext().setAccessibleDescription(""); jList1.getAccessibleContext().setAccessibleDescription("");
@ -346,6 +352,14 @@ public class GUI extends javax.swing.JFrame {
} }
}//GEN-LAST:event_jButton7ActionPerformed }//GEN-LAST:event_jButton7ActionPerformed
private void jList1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jList1KeyPressed
// TODO add your handling code here:
if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
System.out.println("ENTER pressed");
jButton1ActionPerformed(null);
}
}//GEN-LAST:event_jList1KeyPressed
DefaultListModel dim2 = new DefaultListModel(); DefaultListModel dim2 = new DefaultListModel();
/** /**