资源简介
java-界面组件案例大全(内含139个完整Demo),初学AWT和Swing设计GUI的有用资源!

代码片段和文件信息
/*
* Copyright (c) 1995 2008 Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Oracle or the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS
* IS“ AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL
* EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE DATA OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package layout;
/*
* GridLayoutDemo.java
*
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GridLayoutDemo extends Jframe {
static final String gapList[] = {“0“ “10“ “15“ “20“};
final static int maxGap = 20;
JComboBox horGapComboBox;
JComboBox verGapComboBox;
JButton applyButton = new JButton(“Apply gaps“);
GridLayout experimentLayout = new GridLayout(02);
public GridLayoutDemo(String name) {
super(name);
setResizable(false);
}
public void initGaps() {
horGapComboBox = new JComboBox(gapList);
verGapComboBox = new JComboBox(gapList);
}
public void addComponentsToPane(final Container pane) {
initGaps();
final JPanel compsToExperiment = new JPanel();
compsToExperiment.setLayout(experimentLayout);
JPanel controls = new JPanel();
controls.setLayout(new GridLayout(23));
//Set up components preferred size
JButton b = new JButton(“Just fake button“);
Dimension buttonSize = b.getPreferredSize();
compsToExperiment.setPreferredSize(new Dimension((int)(buttonSize.getWidth() * 2.5)+maxGap
(int)(buttonSize.getHeight() * 3.5)+maxGap * 2));
//Add buttons to experiment with Grid Layout
compsToExperiment.add(new JButton(“Button 1“));
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 22601 2010-09-23 23:13 components\components-BorderDemoProject.zip
文件 9883 2010-09-23 23:15 components\components-ButtonDemoProject.zip
文件 10076 2010-09-23 23:15 components\components-ButtonHtmlDemoProject.zip
文件 85669 2010-09-23 23:16 components\components-CheckBoxDemoProject.zip
文件 61579 2010-09-23 23:16 components\components-ColorChooserDemo2Project.zip
文件 34311 2010-09-23 23:15 components\components-ColorChooserDemoProject.zip
文件 21164 2010-09-23 23:15 components\components-ComboBoxDemo2Project.zip
文件 36103 2010-09-23 23:15 components\components-ComboBoxDemoProject.zip
文件 17040 2010-09-23 23:16 components\components-ConverterProject.zip
文件 36776 2010-09-23 23:13 components\components-CustomComboBoxDemoProject.zip
文件 13779 2010-09-23 23:15 components\components-CustomIconDemoProject.zip
文件 28183 2010-09-23 23:15 components\components-DialogDemoProject.zip
文件 10908 2010-09-23 23:16 components\components-DynamicTreeDemoProject.zip
文件 18258 2010-09-23 23:16 components\components-FileChooserDemo2Project.zip
文件 10099 2010-09-23 23:15 components\components-FileChooserDemoProject.zip
文件 22675 2010-09-23 23:15 components\components-FormattedTextFieldDemoProject.zip
文件 22828 2010-09-23 23:15 components\components-FormatterFactoryDemoProject.zip
文件 12267 2010-09-23 23:15 components\components-fr
文件 7797 2010-09-23 23:15 components\components-fr
文件 8732 2010-09-23 23:15 components\components-fr
文件 14035 2010-09-23 23:15 components\components-GenealogyExampleProject.zip
文件 21636 2010-09-23 23:15 components\components-GlassPaneDemoProject.zip
文件 46683 2010-09-23 23:16 components\components-HtmlDemoProject.zip
文件 169684 2010-09-23 23:17 components\components-IconDemoProject.zip
文件 10073 2010-09-23 23:15 components\components-Internalfr
文件 16110 2010-09-23 23:16 components\components-JWSFileChooserDemoProject.zip
文件 8956 2010-09-23 23:15 components\components-LabelDemoProject.zip
文件 61769 2010-09-23 23:16 components\components-la
文件 48706 2010-09-23 23:16 components\components-la
文件 9923 2010-09-23 23:15 components\components-ListDemoProject.zip
............此处省略126个文件信息
相关资源
- java串口通信全套完整代码-导入eclip
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
- 基于jsp的bbs论坛 非常详细
- [免费]java实现有障碍物的贪吃蛇游戏
评论
共有 条评论