/* * Decompiled with CFR 0.152. */ import java.awt.Button; import java.awt.Color; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.Label; import java.awt.Panel; import java.awt.TextField; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; class AuthPanel extends Panel implements ActionListener { TextField passwordField; Button okButton; public AuthPanel(VncViewer vncViewer) { Label label = new Label("VNC Authentication", 1); label.setFont(new Font("Helvetica", 1, 18)); Label label2 = new Label("Password:", 1); this.passwordField = new TextField(10); this.passwordField.setForeground(Color.black); this.passwordField.setBackground(Color.white); this.passwordField.setEchoChar('*'); this.okButton = new Button("OK"); GridBagLayout gridBagLayout = new GridBagLayout(); GridBagConstraints gridBagConstraints = new GridBagConstraints(); this.setLayout(gridBagLayout); gridBagConstraints.gridwidth = 0; gridBagConstraints.insets = new Insets(0, 0, 20, 0); gridBagLayout.setConstraints(label, gridBagConstraints); this.add(label); gridBagConstraints.fill = 0; gridBagConstraints.gridwidth = 1; gridBagConstraints.insets = new Insets(0, 0, 0, 0); gridBagLayout.setConstraints(label2, gridBagConstraints); this.add(label2); gridBagLayout.setConstraints(this.passwordField, gridBagConstraints); this.add(this.passwordField); this.passwordField.addActionListener(this); gridBagConstraints.gridwidth = 0; gridBagConstraints.fill = 1; gridBagConstraints.insets = new Insets(0, 20, 0, 0); gridBagConstraints.ipadx = 30; gridBagLayout.setConstraints(this.okButton, gridBagConstraints); this.add(this.okButton); this.okButton.addActionListener(this); } public void moveFocusToDefaultField() { this.passwordField.requestFocus(); } public synchronized void actionPerformed(ActionEvent actionEvent) { if (actionEvent.getSource() == this.passwordField || actionEvent.getSource() == this.okButton) { this.passwordField.setEnabled(false); this.notify(); } } public synchronized String getPassword() throws Exception { try { this.wait(); } catch (InterruptedException interruptedException) { // empty catch block } return this.passwordField.getText(); } }