private void AdminLoginSentActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_AdminLoginSentActionPerformed // Switcht between Login and Admin Panel if (Admin.Login(AdminUsernameField.getText(), AdminPasswordField.getText())) { admin = new Admin(AdminConfigPanel, AdminLoginPanel); } } // GEN-LAST:event_AdminLoginSentActionPerformed
/** * 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() { jTabbedPane5 = new javax.swing.JTabbedPane(); AdminConfigPanel = new javax.swing.JPanel(); AdminLoginPanel = new javax.swing.JPanel(); AdminLoginSent = new javax.swing.JButton(); AdminLoginLabel = new javax.swing.JLabel(); AdminUsernameField = new javax.swing.JTextField(); AdminPasswordField = new javax.swing.JPasswordField(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("Verteiltes Filesystem"); setBackground(new java.awt.Color(255, 255, 255)); setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jTabbedPane5.setBackground(new java.awt.Color(255, 255, 255)); jTabbedPane5.setForeground(new java.awt.Color(255, 255, 255)); jTabbedPane5.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTabbedPane5MouseClicked(evt); } }); AdminLoginPanel.setEnabled(false); AdminLoginSent.setText("Anmelden"); AdminLoginSent.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { AdminLoginSentMouseClicked(evt); } }); AdminLoginSent.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { AdminLoginSentActionPerformed(evt); } }); AdminLoginLabel.setText("Login:"******"Username"); AdminPasswordField.setText("Password"); javax.swing.GroupLayout AdminLoginPanelLayout = new javax.swing.GroupLayout(AdminLoginPanel); AdminLoginPanel.setLayout(AdminLoginPanelLayout); AdminLoginPanelLayout.setHorizontalGroup( AdminLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( AdminLoginPanelLayout.createSequentialGroup() .addContainerGap() .addGroup( AdminLoginPanelLayout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( AdminLoginSent, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( AdminPasswordField, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( AdminUsernameField, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(AdminLoginLabel)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); AdminLoginPanelLayout.setVerticalGroup( AdminLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( AdminLoginPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(AdminLoginLabel) .addGap(37, 37, 37) .addComponent( AdminUsernameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( AdminPasswordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(28, 28, 28) .addComponent(AdminLoginSent) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout AdminConfigPanelLayout = new javax.swing.GroupLayout(AdminConfigPanel); AdminConfigPanel.setLayout(AdminConfigPanelLayout); AdminConfigPanelLayout.setHorizontalGroup( AdminConfigPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( AdminConfigPanelLayout.createSequentialGroup() .addGap(339, 339, 339) .addComponent( AdminLoginPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(559, Short.MAX_VALUE))); AdminConfigPanelLayout.setVerticalGroup( AdminConfigPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( AdminConfigPanelLayout.createSequentialGroup() .addGap(148, 148, 148) .addComponent( AdminLoginPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(365, Short.MAX_VALUE))); jTabbedPane5.addTab("Admin", AdminConfigPanel); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTabbedPane5)); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(36, 36, 36) .addComponent( jTabbedPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 719, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); pack(); } // </editor-fold>//GEN-END:initComponents