import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class jj extends JFrame implements ActionListener
{
String a="jiang chao say:hello world!";
JButton ok=new JButton("确定");
JButton cancel=new JButton("取消");
JLabel label=new JLabel("请输入姓名");
JTextField text1=new JTextField(50);
public jj()
{
super("example");
//text.setEditable(false);
setLayout(new FlowLayout());
add(ok);add(cancel);
add(label);add(text1);
setSize(600,600);
setLocation(100,100);
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{
//jc wj=new jc();
// String a="jiang chao say:hello world!";
text1.setText(a);
}
}
public static void main(String []args)
{
jj wj=new jj();
}
}
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class jc extends JFrame implements ActionListener{
String s="hello world!";
JButton ok=new JButton("确定");
JButton cancel=new JButton("取消");
JLabel label=new JLabel("请输入姓名");
JTextField text=new JTextField(10);
public jc()
{
super("example");
setLayout(new FlowLayout());
text.setEditable(false);
add(ok);add(cancel);
add(label);add(text);
ok.addActionListener(this);
setSize(600,600);
setLocation(400,400);
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{
jj jx=new jj();
jx.setVisible(true);
setVisible(false);
}
}
public static void main(String []args)
{
jc wj=new jc();
}
}
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class jj extends JFrame implements ActionListener
{
String a="jiang chao say:hello world!";
JButton ok=new JButton("确定");
JButton cancel=new JButton("取消");
JLabel label=new JLabel("请输入姓名");
JTextField text1=new JTextField(50);
public jj()
{
super("example");
//text.setEditable(false);
setLayout(new FlowLayout());
add(ok);add(cancel);
add(label);add(text1);
setSize(600,600);
setLocation(100,100);
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{
//jc wj=new jc();
// String a="jiang chao say:hello world!";
text1.setText(a);
}
}
public static void main(String []args)
{
jj wj=new jj();
}
}
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class jc extends JFrame implements ActionListener{
String s="hello world!";
JButton ok=new JButton("确定");
JButton cancel=new JButton("取消");
JLabel label=new JLabel("请输入姓名");
JTextField text=new JTextField(10);
public jc()
{
super("example");
setLayout(new FlowLayout());
text.setEditable(false);
add(ok);add(cancel);
add(label);add(text);
ok.addActionListener(this);
setSize(600,600);
setLocation(400,400);
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{
jj jx=new jj();
jx.setVisible(true);
setVisible(false);
}
}
public static void main(String []args)
{
jc wj=new jc();
}
}
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class jj extends JFrame implements ActionListener
{
String a="jiang chao say:hello world!";
JButton ok=new JButton("确定");
JButton cancel=new JButton("取消");
JLabel label=new JLabel("请输入姓名");
JTextField text1=new JTextField(50);
public jj()
{
super("example");
//text.setEditable(false);
ok.addActionListener(this);
setLayout(new FlowLayout());
add(ok);add(cancel);
add(label);add(text1);
setSize(600,600);
setLocation(100,100);
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{
jc wj=new jc();
// String a="jiang chao say:hello world!";
text1.setText(wj.s);
}
}
public static void main(String []args)
{
jj wj=new jj();
}
} 莫非你要这样 ?