From b0e97c247e66537646ced1966cd49fc4065fd2c5 Mon Sep 17 00:00:00 2001 From: simono41 Date: Mon, 21 Nov 2016 01:24:10 +0100 Subject: [PATCH] Bugfixing --- Vokabeln.txt | 4 ++++ src/main.java | 2 ++ src/vokabeltrainer/GUI.java | 12 +----------- src/vokabeltrainer/Vokabeln.java | 13 ++++++++----- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Vokabeln.txt b/Vokabeln.txt index 4407b90..896e9a2 100644 --- a/Vokabeln.txt +++ b/Vokabeln.txt @@ -1,3 +1,7 @@ Vokabeln: Vokabel Vokabel +Vokabel +Vokabel1 +Vokabel +Vokabelawdawdawd diff --git a/src/main.java b/src/main.java index 336454c..fc9fa9f 100644 --- a/src/main.java +++ b/src/main.java @@ -24,5 +24,7 @@ public class main { java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } new GUI().setVisible(true); + GUI a = new GUI(); + a.aktualisieren(); } } diff --git a/src/vokabeltrainer/GUI.java b/src/vokabeltrainer/GUI.java index 15e8d6f..5e9ead3 100644 --- a/src/vokabeltrainer/GUI.java +++ b/src/vokabeltrainer/GUI.java @@ -266,16 +266,6 @@ public class GUI extends javax.swing.JFrame { }//GEN-LAST:event_jButton5ActionPerformed private void vokabeln() { - 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 | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) { - java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } new Vokabeln().setVisible(true); } private void vokabel() { @@ -336,7 +326,7 @@ public class GUI extends javax.swing.JFrame { this.jLabel10.setText("" + zufallszahl + "." + gerade); } - private void aktualisieren() { + public void aktualisieren() { vokabeln0.clear(); read a = new read(); try { diff --git a/src/vokabeltrainer/Vokabeln.java b/src/vokabeltrainer/Vokabeln.java index a1e3d11..5c8f4b8 100644 --- a/src/vokabeltrainer/Vokabeln.java +++ b/src/vokabeltrainer/Vokabeln.java @@ -69,13 +69,16 @@ public class Vokabeln extends javax.swing.JFrame { private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: - DefaultListModel dim = new DefaultListModel<>(); - for (int i = 0; i < GUI.vokabeln0.size(); ++i) { - dim.addElement(GUI.vokabeln0.get(i) + " = " + GUI.vokabeln0.get(i++)); - } - this.jList1.setModel(dim); + this.aktualisieren(); }//GEN-LAST:event_jButton1ActionPerformed + public void aktualisieren() { + DefaultListModel dim = new DefaultListModel<>(); + for (int i = 0; i < GUI.vokabeln0.size();) { + dim.addElement(GUI.vokabeln0.get(i++) + " = " + GUI.vokabeln0.get(i++)); + } + this.jList1.setModel(dim); + } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JList jList1;