让我们一起爱米兰
站内搜搜:
移动设备
请扫描二维码
或访问
m.milan100.com
您所在的位置 -> 米兰百分百 -> JAVA -> java中swt实现绝对定位

java中swt实现绝对定位

点击数:1799 发表时间:2011-02-07 12:27:19 作者: 来源链接:
分享到:
分享到微信

import java.awt.*;
import javax.swing.*;
public class Test extends JFrame{
public Test(){
this.setSize(500,500);
this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
this.setResizable(false);
this.setLayout(null);//屏蔽 默认布局
JButton button = new JButton("Test");
int x = 30;//坐标x
int y = 30;//坐标y;
int width = 200;//组件宽
int height = 200;//组件高
button.setBounds(x,y,width,height);
this.getContentPane().add(button);
}
public static void main(String [] args){
new Test().setVisible(true);
}
}

0
很 好
0
一 般
0
差 劲
热门新闻
相关文章
上一篇: 使用objectinputstream接收object报错class not found
下一篇: 【学习】JSP教程
评论区
匿名

返回首页 | 收藏本页 | 回到顶部
Copyright 2010. 米兰百分百 Powered By Bridge.
京ICP备15050557号