类中的Java类
好的,我编译了我的脚本,它输出了5个类,BankValueGUI,BankValueGUI$1,BankValueGUI$2等等。我不小心删除了源文件,所以我不得不将其反编译,但是它没有反编译成1.java文件,而是反编译成5。。在尝试再次将类放入主类时,我继续收到错误,以下是主要来源:类中的Java类,java,eclipse,Java,Eclipse,好的,我编译了我的脚本,它输出了5个类,BankValueGUI,BankValueGUI$1,BankValueGUI$2等等。我不小心删除了源文件,所以我不得不将其反编译,但是它没有反编译成1.java文件,而是反编译成5。。在尝试再次将类放入主类时,我继续收到错误,以下是主要来源: package scripts.BankChecker; import javax.swing.GroupLayout; import javax.swing.GroupLayout.SequentialGr
package scripts.BankChecker;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.SequentialGroup;
import javax.swing.JFileChooser;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class BankValueGUI extends javax.swing.JFrame
{
private javax.swing.JButton inputFileButton;
private JFileChooser inputFileChooser;
private javax.swing.JTextField inputFileField;
private javax.swing.JLabel jLabel1;
private javax.swing.JButton startButton;
public BankValueGUI()
{
initComponents();
}
private void initComponents()
{
inputFileChooser = new JFileChooser();
jLabel1 = new javax.swing.JLabel();
inputFileField = new javax.swing.JTextField();
inputFileButton = new javax.swing.JButton();
startButton = new javax.swing.JButton();
inputFileChooser.setAcceptAllFileFilterUsed(false);
inputFileChooser.setApproveButtonText("Choose this file");
inputFileChooser.setApproveButtonToolTipText("Make sure there is one account per line, in user:pass format");
inputFileChooser.setCurrentDirectory(new java.io.File(System.getProperty("user.home")));
inputFileChooser.setDialogTitle("Choose the text file containing accounts to check");
inputFileChooser.setFileFilter(new javax.swing.filechooser.FileNameExtensionFilter("TEXT FILES", new String[] { "txt", "text" }));
inputFileChooser.addActionListener(new BankValueGUI$1(this));
setDefaultCloseOperation(3);
jLabel1.setText("Input File:");
inputFileField.setEditable(false);
inputFileField.setText("The file containing accounts to check");
inputFileButton.setText("Browse");
inputFileButton.addActionListener(new BankValueGUI$2(this));
startButton.setText("Start");
startButton.setEnabled(false);
startButton.addActionListener(new BankValueGUI$3(this));
GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(8, 8, 8)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(inputFileField, -2, 331, -2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(inputFileButton)
.addGap(0, 12, 32767))
.addGroup(layout.createSequentialGroup()
.addComponent(startButton, -1, -1, 32767)
.addContainerGap()))));
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(inputFileField, -2, -1, -2)
.addComponent(inputFileButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(startButton)
.addContainerGap(-1, 32767)));
pack();
}
private void inputFileButtonActionPerformed(java.awt.event.ActionEvent evt) {
inputFileChooser.showOpenDialog(this);
}
private void inputFileChooserActionPerformed(java.awt.event.ActionEvent evt) {
inputFileField.setText(inputFileChooser.getSelectedFile().getAbsolutePath());
startButton.setEnabled(true);
}
private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {
ScriptWorker.inFile = inputFileChooser.getSelectedFile();
ScriptWorker.guiDone = true;
dispose();
}
public static void main(String[] args)
{
try
{
for (javax.swing.UIManager.LookAndFeelInfo info : ) {
if ("Windows".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(BankValueGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(BankValueGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(BankValueGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(BankValueGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
java.awt.EventQueue.invokeLater(new BankValueGUI$4());
}
}
这是全班同学的答案
class 1 implements ActionListener {
@Override
public void actionPerformed(final ActionEvent evt) {
BankValueGUI.access$0(BankValueGUI.this, evt);
}
}
class 2 implements ActionListener {
@Override
public void actionPerformed(final ActionEvent evt) {
BankValueGUI.access$1(BankValueGUI.this, evt);
}
}
class 3 implements ActionListener {
@Override
public void actionPerformed(final ActionEvent evt) {
BankValueGUI.access$2(BankValueGUI.this, evt);
}
}
class 4 implements Runnable {
@Override
public void run() {
new BankValueGUI().setVisible(true);
}
}
不用担心,我正在使用一个扩展的库,所以TRIBOTs库,所以在您这方面会有更多关于TRIBOT相关内容的错误
但它并没有反编译成1.java文件,而是反编译成5
那是因为它不是一节课
按照约定,匿名类被编译为名为包含class$Number
的类,但没有理由不创建一个显式名为该类的类-因此无法知道BankValueGUI$1
是一个嵌套类,而不是同名的顶级类
在尝试再次将类放入主类时,我继续收到错误
类名必须是有效的Java标识符。Java标识符不能以数字开头。(见附件)
反编译器没有创建一个名为BankValueGUI$1的类,这是相当可疑的,但这只是反编译器中的一个bug(或者至少是一个“特性”)。在JVM中没有内部类的概念。java编译器javac将内部类编译为单独的类,如BankValueGUI$1等,这些非静态类中的每个类都有一个成员this$0,它引用外部类实例 因此,每个内部类本身都是一个单独的类(尽管不能为类使用这样的名称,因为它们无法通过编译器)。类名和方法名必须是有效的Java标识符(JLS第3.8节) 至于您的错误,请看一下:
class 1 implements ActionListener {
@Override
public void actionPerformed(final ActionEvent evt) {
BankValueGUI.access$0(BankValueGUI.this, evt);
}
}
}
这里access$0是javac添加的一个方法,它支持内部类访问外部类实例的字段,access$0不是一个有效的名称。显然,你会犯错误
反编译您的类文件并期望代码只需很少的更改,这不是一项容易的任务。你可能需要改变很多。更具体地说,您必须使所有这些类都成为内部类。您是否检查了回收站;)?你把你的类命名为1-4了吗?是的,我也试过recuva工具,运气不好:/你通常可以通过右键单击项目并选择“从本地历史还原…”来恢复Eclipse中丢失的源文件