Wir wissen nicht wie wir weiter machen sollen wir haben das Projekt bis zum einloggen soweit fertig, wir wissen aber nicht wie wir die Passwortdaten von einer anderen Datei abrufen sollen. Vielleicht könnt ihr uns ein paar Tipps geben und evtl. auch die dazugehörigen Befehle.
String passwort, epasswort;
epasswort = jPasswordField1.getText();
passwort = "abc";
Hauptfenster hf = new Hauptfenster();
// PW aus Textfeld lesen
if (passwort.equals(epasswort)){
hf.setVisible(true);
this.setVisible(false);
jLabel1.setVisible(false);
}
else {
jLabel2.setVisible(true);
}
}//GEN-LAST:event_jButton1ActionPerformed
private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPasswordField1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jPasswordField1ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
import java.io.*;
import javax.swing.DefaultListModel;
public class Hauptfenster extends javax.swing.JFrame {
private final DefaultListModel listModel;
/** Creates new form Hauptfenster */
public Hauptfenster() {
initComponents();
// Befehle für jList
listModel = new DefaultListModel();
jList1.setModel(listModel);
MfG. InfoProjekt
String passwort, epasswort;
epasswort = jPasswordField1.getText();
passwort = "abc";
Hauptfenster hf = new Hauptfenster();
// PW aus Textfeld lesen
if (passwort.equals(epasswort)){
hf.setVisible(true);
this.setVisible(false);
jLabel1.setVisible(false);
}
else {
jLabel2.setVisible(true);
}
}//GEN-LAST:event_jButton1ActionPerformed
private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPasswordField1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jPasswordField1ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
import java.io.*;
import javax.swing.DefaultListModel;
public class Hauptfenster extends javax.swing.JFrame {
private final DefaultListModel listModel;
/** Creates new form Hauptfenster */
public Hauptfenster() {
initComponents();
// Befehle für jList
listModel = new DefaultListModel();
jList1.setModel(listModel);
MfG. InfoProjekt