⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 l.java

📁 microtik tool to vie another router in a network
💻 JAVA
字号:
package com.hoya.games.sp;

import com.hoya.client.f;
import com.hoya.common.a;
import com.hoya.util.code.h;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.Random;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.border.Border;

public final class l extends JDialog
  implements ActionListener, KeyListener
{
  String q;
  String t;
  String u;
  JPanel a;
  Border b;
  JPanel c;
  JPanel d;
  JLabel e;
  GridLayout f;
  GridBagLayout g;
  JPanel h;
  GridBagLayout i;
  JLabel j;
  JPasswordField k;
  GridBagLayout l;
  JLabel m;
  JPasswordField n;
  JLabel o;
  JPasswordField p;
  JButton r;
  public JButton s;

  public l(Frame paramFrame)
  {
    super(paramFrame, "Change password", true);
    this.q = "Invalid password";
    this.t = "The new password do not match!";
    this.u = "Password must have at least 6 characters!";
    this.a = new JPanel();
    this.b = BorderFactory.createEtchedBorder(1, Color.white, new Color(148, 145, 140));
    this.c = new JPanel();
    this.d = new JPanel();
    this.e = new JLabel();
    this.f = new GridLayout();
    this.g = new GridBagLayout();
    this.h = new JPanel();
    this.i = new GridBagLayout();
    this.j = new JLabel();
    this.k = new JPasswordField();
    this.l = new GridBagLayout();
    this.m = new JLabel();
    this.n = new JPasswordField();
    this.o = new JLabel();
    this.p = new JPasswordField();
    new JLabel();
    this.r = new JButton("Update");
    this.s = new JButton("Cancel");
    if (lx.aS == 3)
    {
      this.t = "Please RETYPE your new password correctly";
      this.u = "Enter your NEW password(6 letters or digits)";
    }
    try
    {
      b();
      return;
    }
    catch (Exception localException2)
    {
      Exception localException1;
      (localException1 = localException2).printStackTrace();
    }
  }

  public l()
  {
    this(null);
  }

  private void a()
  {
    this.k.setText("");
    this.n.setText("");
    this.p.setText("");
  }

  public final void actionPerformed(ActionEvent paramActionEvent)
  {
    if (paramActionEvent.getSource() == this.s)
    {
      dispose();
      a();
      return;
    }
    if (paramActionEvent.getSource() == this.r)
    {
      char[] arrayOfChar = this.n.getPassword();
      for (int i1 = 0; i1 < arrayOfChar.length; ++i1)
        if ((arrayOfChar[i1] < '0') || ((arrayOfChar[i1] > '9') && (arrayOfChar[i1] < 'A')) || ((arrayOfChar[i1] > 'Z') && (arrayOfChar[i1] < 'a')) || (arrayOfChar[i1] > 'z'))
        {
          str2 = "Password only can use 0~9,a~z,A~Z!";
          this.e.setText(str2);
          if (lx.aS == 2)
            JOptionPane.showMessageDialog(this, str2);
          return;
        }
      String str1 = new String(this.k.getPassword());
      String str2 = new String(this.n.getPassword());
      String str3 = new String(this.p.getPassword());
      if (!(str1.equals(lx.l)))
      {
        this.e.setText(this.q);
        if (lx.aS != 2)
          return;
        JOptionPane.showMessageDialog(this, this.q);
        return;
      }
      if (!(str3.equals(str2)))
      {
        this.e.setText(this.t);
        if (lx.aS != 2)
          return;
        JOptionPane.showMessageDialog(this, this.t);
        return;
      }
      if (str2.length() < 6)
      {
        this.e.setText(this.u);
        if (lx.aS != 2)
          return;
        JOptionPane.showMessageDialog(this, this.u);
        return;
      }
      if ((lx.aS == 1) && (((lx.c(str2)) || (lx.k(str2)) || (lx.m(str2)))))
      {
        this.e.setText("Password is too simple!");
        return;
      }
      if ((lx.aS == 2) && (((lx.c(str2)) || (lx.l(str2)))))
      {
        Random localRandom;
        str4 = "ERROR. Harap Gunakan password yang aman (password anda masih belum berubah).";
        int i2 = (localRandom = new Random()).nextInt(24);
        char c1 = (char)(97 + i2);
        char c2 = (char)(98 + i2);
        int i3 = localRandom.nextInt(6);
        int i4 = localRandom.nextInt(7);
        String str5 = a.a(6);
        str5 = str5.substring(0, i3) + c1 + str5.substring(i3);
        str5 = str5.substring(0, i4) + c2 + str5.substring(i4);
        str4 = str4 + "\nFor example:" + str5;
        this.e.setText(str4);
        JOptionPane.showMessageDialog(this, str4);
        return;
      }
      if ((lx.c(str2)) || (lx.k(str2)))
      {
        this.e.setText("Password is too simple!");
        return;
      }
      String str4 = h.a(str1 + "," + str2, null);
      lx.aA.a(2081, str4);
      this.e.setText(" ");
      dispose();
      a();
      lx.l = str2;
    }
  }

  private void b()
    throws Exception
  {
    setDefaultCloseOperation(0);
    this.r.addActionListener(this);
    this.s.addActionListener(this);
    this.a.setBorder(this.b);
    this.a.setLayout(this.l);
    this.k.addKeyListener(this);
    this.n.addKeyListener(this);
    this.p.addKeyListener(this);
    this.e.setText(" ");
    this.d.setLayout(this.f);
    this.c.setLayout(this.g);
    this.d.setBackground(Color.lightGray);
    this.h.setLayout(this.i);
    this.j.setHorizontalAlignment(4);
    this.j.setText("Old Password");
    this.k.setPreferredSize(new Dimension(100, 17));
    this.m.setHorizontalAlignment(4);
    this.m.setText("New Password");
    this.n.setPreferredSize(new Dimension(100, 17));
    this.o.setHorizontalAlignment(4);
    this.o.setText(" Retype your new Pasword");
    this.p.setPreferredSize(new Dimension(100, 17));
    if (lx.aS == 2)
    {
      this.a.setBackground(Color.black);
      this.c.setBackground(Color.black);
      this.h.setBackground(Color.black);
      this.j.setForeground(Color.gray);
      this.m.setForeground(Color.gray);
      this.o.setForeground(Color.gray);
      this.n.setBackground(Color.black);
      this.p.setBackground(Color.black);
      this.k.setBackground(Color.black);
      this.n.setForeground(Color.white);
      this.p.setForeground(Color.white);
      this.k.setForeground(Color.white);
      this.n.setCaretColor(Color.white);
      this.p.setCaretColor(Color.white);
      this.k.setCaretColor(Color.white);
    }
    else if (lx.aS == 3)
    {
      this.a.setBackground(lx.bf);
      this.c.setBackground(lx.bf);
      this.h.setBackground(lx.bf);
      this.d.setBackground(lx.bh);
      this.r.setBackground(lx.bf);
      this.s.setBackground(lx.bf);
      this.o.setText(" Retype your new pasword");
    }
    this.r.setMnemonic('U');
    this.s.setMnemonic('C');
    if (lx.aS != 3)
    {
      this.r.setPreferredSize(new Dimension(77, 20));
      this.s.setPreferredSize(new Dimension(77, 20));
    }
    getContentPane().add(this.c, "South");
    this.d.add(this.e);
    getContentPane().add(this.h, "Center");
    this.a.add(this.j, new GridBagConstraints(0, 0, 2, 1, 1D, 0D, 18, 2, new Insets(10, 0, 0, 5), 0, 0));
    this.a.add(this.k, new GridBagConstraints(2, 0, 2, 1, 1D, 0D, 18, 2, new Insets(10, 0, 0, 5), 0, 0));
    this.a.add(this.m, new GridBagConstraints(0, 1, 2, 1, 1D, 0D, 10, 2, new Insets(10, 0, 0, 5), 0, 0));
    this.a.add(this.n, new GridBagConstraints(2, 1, 2, 1, 0D, 0D, 18, 2, new Insets(10, 0, 0, 5), 0, 0));
    this.a.add(this.o, new GridBagConstraints(0, 2, 2, 1, 1D, 0D, 10, 2, new Insets(10, 0, 5, 5), 0, 0));
    this.a.add(this.p, new GridBagConstraints(2, 2, 2, 1, 0D, 0D, 18, 2, new Insets(10, 0, 5, 5), 0, 0));
    if (lx.aS == 3);
    this.a.add(this.r, new GridBagConstraints(1, 3, 1, 1, 0D, 0D, 13, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.a.add(this.s, new GridBagConstraints(2, 3, 1, 1, 0D, 0D, 17, 0, new Insets(0, 10, 0, 0), 0, 0));
    this.h.add(this.a, new GridBagConstraints(0, 0, 1, 1, 1D, 1D, 10, 1, new Insets(5, 5, 5, 5), 0, 0));
    this.c.add(this.d, new GridBagConstraints(0, 0, 1, 1, 1D, 1D, 17, 2, new Insets(0, 5, 5, 5), 0, 0));
  }

  public final void keyTyped(KeyEvent paramKeyEvent)
  {
  }

  public final void keyPressed(KeyEvent paramKeyEvent)
  {
  }

  public final void keyReleased(KeyEvent paramKeyEvent)
  {
    if (paramKeyEvent.getSource() == this.k)
      a(this.k, 10);
  }

  private static void a(JPasswordField paramJPasswordField, int paramInt)
  {
    String str;
    paramJPasswordField.setText(str);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -