2016-11-21 00:16:17 +01:00
|
|
|
/*
|
|
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
|
|
* To change this template file, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package vokabeltrainer;
|
|
|
|
|
|
|
|
import javax.swing.DefaultListModel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author simono41
|
|
|
|
*/
|
|
|
|
public class Vokabeln extends javax.swing.JFrame {
|
|
|
|
|
|
|
|
/** Creates new form Vokabeln */
|
|
|
|
public Vokabeln() {
|
|
|
|
initComponents();
|
|
|
|
}
|
|
|
|
|
|
|
|
/** This method is called from within the constructor to
|
|
|
|
* initialize the form.
|
|
|
|
* WARNING: Do NOT modify this code. The content of this method is
|
|
|
|
* always regenerated by the Form Editor.
|
|
|
|
*/
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
|
|
|
private void initComponents() {
|
|
|
|
|
|
|
|
jScrollPane1 = new javax.swing.JScrollPane();
|
|
|
|
jList1 = new javax.swing.JList<>();
|
|
|
|
jButton1 = new javax.swing.JButton();
|
|
|
|
|
|
|
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
|
|
|
|
|
|
|
jScrollPane1.setViewportView(jList1);
|
|
|
|
|
|
|
|
jButton1.setText("Aktualisieren");
|
|
|
|
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
jButton1ActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
|
|
|
getContentPane().setLayout(layout);
|
|
|
|
layout.setHorizontalGroup(
|
|
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(layout.createSequentialGroup()
|
|
|
|
.addContainerGap()
|
|
|
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
|
|
|
|
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
|
|
.addContainerGap())
|
|
|
|
);
|
|
|
|
layout.setVerticalGroup(
|
|
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(layout.createSequentialGroup()
|
|
|
|
.addContainerGap()
|
|
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 278, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
|
|
|
|
.addComponent(jButton1)
|
|
|
|
.addContainerGap())
|
|
|
|
);
|
|
|
|
|
|
|
|
pack();
|
|
|
|
}// </editor-fold>//GEN-END:initComponents
|
|
|
|
|
|
|
|
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
|
|
|
// TODO add your handling code here:
|
2016-11-21 01:24:10 +01:00
|
|
|
this.aktualisieren();
|
|
|
|
}//GEN-LAST:event_jButton1ActionPerformed
|
|
|
|
|
|
|
|
public void aktualisieren() {
|
2016-11-21 00:16:17 +01:00
|
|
|
DefaultListModel<String> dim = new DefaultListModel<>();
|
2016-11-21 01:24:10 +01:00
|
|
|
for (int i = 0; i < GUI.vokabeln0.size();) {
|
|
|
|
dim.addElement(GUI.vokabeln0.get(i++) + " = " + GUI.vokabeln0.get(i++));
|
2016-11-21 00:16:17 +01:00
|
|
|
}
|
|
|
|
this.jList1.setModel(dim);
|
2016-11-21 01:24:10 +01:00
|
|
|
}
|
2016-11-21 00:16:17 +01:00
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
|
|
|
private javax.swing.JButton jButton1;
|
|
|
|
private javax.swing.JList<String> jList1;
|
|
|
|
private javax.swing.JScrollPane jScrollPane1;
|
|
|
|
// End of variables declaration//GEN-END:variables
|
|
|
|
|
|
|
|
}
|