如题,给段代码,多谢
解决方案 »
- java随机数的获得
- java编程问题
- QQ靚号,不要钱啦!!!
- jar文件在用IE浏览,在IE端是怎么处理的?求求求求各位了!着急!
- 定时执行程序的问题,用过timer的朋友进来帮我一下,急啊!!!!!
- HttpSession这个类的具体功能是什么,请指教
- 如何实现简繁转换,即知道一个简体字,怎样得到它相应的繁体字?
- 这个小程序那里错了?很简单的。
- 在JFrame中如何显示word/excel文件?
- Set HashMap LIst如何实现分页,能举例说明吗
- 为什么用length方法获得的文件长度总为0
- 谁能提供emf-sdo-runtime-2.2.0.zip的有效连接或者Email给我?
import javax.swing.*;
import java.awt.Rectangle;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;public class Frame1 extends JFrame
{
private JButton jButton1=new JButton(); public Frame1 ()
{
try {
jbInit();
}
catch(Exception exception) {
exception.printStackTrace();
}
this.setVisible(true);
} private void jbInit () throws Exception
{
this.setBounds(300,180,400,300);
getContentPane().setLayout(null);
jButton1.setBounds(new Rectangle(127, 120, 139, 36));
jButton1.setMnemonic('C');
jButton1.setText("点我(C)");
jButton1.addActionListener(new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
jButton1_actionPerformed(e);
}
});
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.getContentPane().add(jButton1);
} public static void main (String[] args)
{
Frame1 frame1=new Frame1();
} public void jButton1_actionPerformed (ActionEvent e)
{
this.setVisible(false);
JFrame jf1=new JFrame("子窗口");
jf1.setBounds(100,50,800,600);
jf1.setDefaultCloseOperation(jf1.EXIT_ON_CLOSE);
jf1.setVisible(true);
}
}