首页 > 其他 > 详细

控件绝对定位函数

时间:2015-04-07 11:58:54      阅读:219      评论:0      收藏:0      [点我收藏+]

技术分享


审美布局能力实在太差。驾驭不了这种界面美化函数,弃疗了。、调了好久才出来下面这个玩意,以后再也不瞧不起美工了。。。


技术分享



<span style="font-size:18px;">//祭上代码
import java.awt.FlowLayout ;
import javax.swing.JFrame ;
import javax.swing.JButton ;
import javax.swing.JLabel ;
import javax.swing.JTextArea ;
import java.awt.*;

class Tester{
    public static void main(String args[]){
        JFrame frame = new JFrame("记事本") ;
        frame.setLayout(null) ;
        JTextArea ta = new JTextArea(20,20) ;
        JButton open = new JButton("打开") ;
        JButton newF = new JButton("新建") ;
        JButton help = new JButton("帮助") ;
        frame.setSize(400,300) ;
        //title.setBounds(45,5,150,20) ; 
        open.setBounds(0,0,60,20) ;
        newF.setBounds(60,0,60,20) ;
        help.setBounds(100,0,60,20) ;
        ta.setBounds(5,40,400,200) ;
        frame.add(open) ;
        frame.add(newF) ;
        frame.add(help) ;
        frame.add(ta) ;
        frame.setVisible(true) ;
    }
};

</span>


控件绝对定位函数

原文:http://blog.csdn.net/u012566693/article/details/44917413

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!