类名.this
来源:互联网 发布:你见过最恐怖的事 知乎 编辑:程序博客网 时间:2024/06/02 05:33
1.当在内部类中 使用this 表示内部类的对象, 为了访问外部层类的对象,可以使用 外层类.this
eg:
class QZZW extends JFrame { //验证码验证类 10位验证码
private JTextField jt = new JTextField();
private JButton jb = new JButton();
private String password;
public QZZW(){
this.password = Connect.getControlInfo();
Container container = getContentPane();
container.setLayout(new GridLayout(1, 3));
JLabel jl = new JLabel("PASSWORD:"); //标签属性设置
jl.setHorizontalAlignment(SwingConstants.CENTER);
jl.setSize(50, 10);
jb.setText("OK");
jb.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO 自动生成的方法存根
String jtcontent = jt.getText();
if(password == "false"){
new MyDialog(QZZW.this, "YOUR NET IS FUCK").setVisible(true);
}
if(jtcontent.length() == 10 && password.indexOf(jtcontent) > -1){
UiLu.jfmain.setVisible(true);
setUnval();
}
}
});
container.add(jl);
container.add(jt);
container.add(jb);
this.setSize(400,50);
this.setTitle("Input Your PassWord");
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setVisible(true);
}
public void setUnval(){
this.setVisible(false);
}
}
0 0
- 类名.this
- 类名.this
- 类名.this
- 类名.this
- 类名.this
- this与类名.this的异同
- 类名.this与this的区别
- 类名.this与类名.class
- 类名.this与类名.class (
- 类名.this与类名.class
- 类名.this与类名.class
- 类名.this与类名.class
- 类名.this与类名.class
- 类名.this与类名.class
- 类名.this与类名.class
- 类名.this与类名.class
- 类名.this与类名.class
- 类名.class 类名.this 详解
- EXCEL VBA字符串替换
- appendChild() , insertBefore()插入节点需注意的问题
- Map.Entry接口源码简析
- 数据结构顺序表定义和实现
- python MRJob
- 类名.this
- Android的多语言实现
- SQL Server 2000 视图部分内容提要
- JetBrains WebStorm 注册码>
- How to enable cURL in PHP / XAMPP
- MM模块-控制采购订单中某些项目的输出显示
- Jenkins任务构建后notification形式通知到手机
- 随机梯度下降(Stochastic gradient descent)和 批量梯度下降(Batch gradient descent )的公式对比、实现对比
- Map集合遍历的两种方式图解