我不知道它之前工作有什么问题,我只是通过添加 if 和读取文件来更改它,代码是一个通用的 jframe,它读取文件并设置出现的按钮,它读取文件但它不再工作了。我已经测试过它是否正确读取了文件,所以它不是数据。下面是我的代码。如果没有正确缩进,我很抱歉 谢谢
import java.awt.AWTException;
import java.awt.Color;
import java.awt.ComponentOrientation;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
/*
* To change this license header, choose License Headers in Project
Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author cyoung
*/
public class Frametemplate {
final static boolean shouldFill = true;
final static boolean shouldWeightX = true;
final static boolean RIGHT_TO_LEFT = false;
String text1 = "";
boolean Button1 = false;
String Redirect1 = "";
String Redirect2 = "";
String Class ="";
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Frametemplate().Start1();
}
});
// TODO code application logic here
}
小怪兽爱吃肉
相关分类