zoukankan      html  css  js  c++  java
  • java 设置密文显示框

     1 package test;
    2
    3 import java.awt.Container;
    4 import java.awt.Font;
    5 import java.awt.GridLayout;
    6 import java.io.File;
    7 import java.util.EmptyStackException;
    8 import java.util.Iterator;
    9 import java.util.Stack;
    10
    11 import javax.swing.Icon;
    12 import javax.swing.ImageIcon;
    13 import javax.swing.JButton;
    14 import javax.swing.JFrame;
    15 import javax.swing.JLabel;
    16 import javax.swing.JPanel;
    17 import javax.swing.JPasswordField;
    18 import javax.swing.JScrollPane;
    19 import javax.swing.JSpinner;
    20 import javax.swing.JSplitPane;
    21 import javax.swing.JTabbedPane;
    22 import javax.swing.JTextField;
    23 import javax.swing.JToggleButton;
    24
    25 public class ImplementsDemo {
    26 public static void main(String[] args) throws EmptyStackException{
    27 JFrame f=new JFrame("Welcome To Earth!");
    28 JPasswordField ps1=new JPasswordField();
    29 JPasswordField ps2=new JPasswordField();
    30 ps2.setEchoChar('#');
    31 JLabel lab1=new JLabel("默认的回显:");
    32 JLabel lab2=new JLabel("回显设置@:");
    33 lab1.setBounds(10, 10, 100, 20);
    34 lab2.setBounds(10, 40, 100, 20);
    35 ps1.setBounds(110, 10, 80, 20);
    36 ps2.setBounds(110, 40, 50, 20);
    37 f.setLayout(null);
    38 f.add(lab2);
    39 f.add(ps1);
    40 f.add(lab1);
    41 f.add(ps2);
    42 f.setSize(300,100);
    43 f.setLocation(300,200);
    44 f.setVisible(true);
    45
    46 }
    47
    48 }
  • 相关阅读:
    Markdown语法
    简易银行管理系统
    登录sql sever
    MainActivity中R为红色
    PLC STL any数据类型
    Oracle ORA-12541,ORA-12514错误
    Myeclispe下struts-config.xml文件无法图形界面打开
    SSH报错
    Myeclispe 代码自动补全
    Mac下多个jdk自由切换
  • 原文地址:https://www.cnblogs.com/dennisac/p/2437864.html
Copyright © 2011-2022 走看看