谢谢各位大虾,饿是新手
解决方案 »
- java的泛型怎么做
- 一个PreparedStatement的问题,进者有分~谢谢了
- override-equivalent应怎么理解?
- 各位大虾!小弟想学swt,打但是我的ECLIPSE3.1开发不了,请看内容帮忙,253了
- BufferedReader用完以后,为什么要用flush()
- 小问题:关于Math类中的IEEEremainder(arg1,arg2)函数
- 关于Random函数问题,本人在线给分!
- JCreator中如何在debug时对变量进行跟踪?????
- Applet如何从JavaScript中取数据?
- java中判断本机操作系统的类和方法
- 关于文件中文本的动态加载问题?
- NullPointerException 方面的问题 谢谢
import java.swing.*;public public class main extends JFrame{
JButton jb = new JButton("新窗口");
JPanel jp = new JPanel(); private void JBInit(){
jp.add(jb);
this.add("Center", jp);
this.setSize(400, 130);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
} public main() {
try {
addListener();
JBInit();
} catch (Exception exception) {
exception.printStackTrace();
}
} public static void main(String[] args) {
main m = new main();
m.setVisible(true);
} private void addListener(){
jb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
newFrame nf = new newFrame();
nf.setVisible(true);
}
});
}
}//新窗体
import java.swing.*;public public class newFrame extends JFrame{ private void JBInit(){
this.setSize(400, 130);
this.setResizable(false);//禁止改变窗体大小
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
} public newFrame() {
JBInit();
}
}
import java.awt.event.ActionListener;不好意思
刚才漏掉了
frame.setResizable(false);
就可以了