gui界面开发演示
2015-09-03 19:29
423 查看
/* * 功能:gui界面开发演示 * * */ package com.test1; import java.awt.*; import javax.swing.*; public class Demo1 extends JFrame { //把需要的swing组件,定义到这里 JButton jb1 = null; public static void main(String[] args) { Demo1 demo1 = new Demo1(); } //构造函数 public Demo1(){ //创建一个button按钮 jb1 = new JButton("我是按钮"); //添加JButton组件 this.add(jb1); //给窗体设置标题 this.setTitle("Hello World"); //设置大小, 按像素 this.setSize(400, 300); //设置初始位置 this.setLocation(500, 200); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //显示 this.setVisible(true); } }
相关文章推荐
- Codeforces GYM 100114 C. Sequence 打表
- Access restriction: The type * is not accessible due to restrict,报错问题
- 在Closing事件中,将e.Cancle设置成true,则Windows无法关机和重启系统的解决办法
- poj 2299 Ultra-QuickSort(树状数组)
- 2012-2013 ACM-ICPC, NEERC, Central Subregional Contest C Sequence (打表)
- 一篇讲得非常好的build模式的解释文章
- maven -- 问题解决(二)解决“Could not calculate build plan”问题
- STL vector, deque, list对比
- [刷题]Implement Queue by Two Stacks
- 九度OJ 题目1119:Integer Inquiry
- 让UITextView文字垂直居中
- UITextFiledView页面之间的相互传值
- Android UI设计(引导界面):ViewPager之三PagerTabStrip与PagerTitleStrip添加标题栏的区别
- jquey.fullpage详解
- UINavigaionController中的传值(协议)
- Android UI设计——ViewPage的无限循环(五)
- Arduino LM35温度检测
- RYU的GUI安装
- 黑马程序员—————Java基础--------GUI
- Android UI设计——ViewPage中自定义标题栏(四)