JAVA跨类引用问题
我想用JAVA写个密码生成器,用来生成复杂的密码。
可是用一个类引用另一个类的时候总是出问题。
我已经定义一些全局变量了,大家帮忙看看。
package cipher;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.*;
import java.awt.*;
import java.util.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JCheckBox;
import javax.swing.JButton;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.*;
import java.lang.Integer;
import java.math.*;
/**
* <p> Title: </p>
*
* <p> Description: </p>
*
* <p> Copyright: Copyright (c) 2007 </p>
*
* <p> Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Frame1 extends JFrame {
JPanel contentPane;
JLabel jLabel1 = new JLabel();
JTextField jTextField1 = new JTextField();
JLabel jLabel2 = new JLabel();
JCheckBox jCheckBox1 = new JCheckBox();
JLabel jLabel3 = new JLabel();
JTextField jTextField2 = new JTextField();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
static String name;
static int Mname;
public Frame1() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
/**
* Component initialization.
*
* @throws
java.lang.Exception */
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(null);
setSize(new Dimension(462, 399));
setTitle( "Frame Title ");