panel.setLayout(null);
component.setBounds(x, y, width, height);
component.setBounds(x, y, width, height);
解决方案 »
- SWT 中如何在TREE中添加一个item
- 新人提个简单的问题 在线等。。。。。
- 请教一下高手,下面的程序是怎么了?调不好
- 游戏怎么编译
- 我要是想在文本框里面显示 ArrayList中的内容怎么写呢?
- 求救,谁知道怎么用Installanywhere将我备份出来的数据库安装到sqlserver2000中
- 为什么不能装载mysql驱动?
- 幫我寫個小程序
- 我觉得jbuilder5不是没有中文帮助的问题!!!!是缺乏例子的问题
- 求教:如何编制一个applet程序,不用每次都下载,就象activeX一样,除非版本更新,否则下在一次即可。
- 怎么把当前日期直接转换成象2004-08-14这样的形式?
- (急)能够解决立即给分
setLayout(null);
然后使用
以JButton为例
button.setBounds(10,20,100,30);
说明button放在坐标为(10,20)的位置
长为100,高为30
JPanel panel = new JPanel()
panel.setLayout(null);
panel.add(button)
这样就把button固定在JPanel上了