Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java GUI 设计  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:Panel问题 [Re:API]
API





发贴: 4
积分: 0
于 2004-10-28 20:12 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
代码如下,大家帮我看一下,谢谢了~~

import java.awt.*;
import java.awt.event.*;
public class abc {
public static void main(String[] args) {
MyForm w = new MyForm("abc");
}
}

class MyForm extends Frame {
public MyForm(String s) {
super ( s );
setLayout(null); //采用空布局
addWindowListener(new WindowAdapter() { //退出
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
}
});
this.setBounds(300, 200, 260, 260); //设置宽高
setVisible(true); //设置可见

int n = 5;
Button[] button = new Button[n * n];
Panel panel = new Panel();
panel.setLayout(new GridLayout(n, n));
panel.setBounds(10, 50, 150, 150);
add(panel);

for (int i = 0; i < button.length; i++) {
button[i] = new Button(""+i);
panel.add(button[i]);
}
}
}




话题树型展开
人气 标题 作者 字数 发贴时间
5991 Panel问题 API 169 2004-10-27 22:08
4949 Re:Panel问题 kavinwang 34 2004-10-28 08:38
4767 Re:Panel问题 zgxsj 173 2004-10-28 16:13
4933 Re:Panel问题 API 861 2004-10-28 20:12
4795 Re:Panel问题 zhongjinao 41 2004-11-02 17:54
4875 Re:Panel问题 xiaobing 66 2004-11-04 23:42
4894 Re:Panel问题 xericfish 30 2004-11-11 15:56

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923