//下面是源代码(代码为本人写的)
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
public class Login extends JFrame
{
private JButton exit;
public void init(){
exit = new JButton();
exit.setText("退出");
exit.setBounds(160, 60, 60, 18);
this.add(exit);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setTitle("Login");
this.setSize(300,150);
//this.setFocusable(true);
//this.getRootPane().setDefaultButton(exit); //得到焦点监听
this.setVisible(true);
this.setLocationRelativeTo(null);
//左键执行
exit.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
System.out.println("exit");
}
});
}
/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub
Login l = new Login();
l.init();
}
}
//下面是采用Font End plus 反编译后的代码
// Decompiled Using: FrontEnd Plus v2.03 and the JAD Engine
// Available From: http://www.reflections.ath.cx
// Decompiler options: packimports(3)
// Source File Name: Login.java
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.PrintStream;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Login extends JFrame
{
public Login()
{
}
public void init()
{
exit = new JButton();
exit.setText("\u9000\u51FA");
exit.setBounds(160, 60, 60, 18);
add(exit);
setDefaultCloseOperation(3);
setTitle("Login");
setSize(300, 150);
setVisible(true);
setLocationRelativeTo(null);
exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
System.out.println("exit");
}
final Login this$0;
{
this$0 = Login.this;
super();
}
});
}
public static void main(String args[])
{
Login l = new Login();
l.init();
}
private JButton exit;
}
观察到在反编译后的代码中包含:
final Login this$0;
{
this$0 = Login.this;
super();
}
反编译的时候都会出现多余的上述代码,明显的去除该部分代码后,反编译后的代码与源代码是一致的。问题是:
是否所有的包含内部监听器类的class文件在反编译后都会出现上述的类型代码?
上述代码的作用又是什么?
|