- 浏览: 248121 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
tanglingshuai:
liulehua 写道根本原因是:没有把该对象对应的主键保存到 ...
关于: org.hibernate.StaleStateException: Batch update -
javeye:
转载了你的文章http://javeye.iteye.com/ ...
关于在tomcat下配置 error-page 500错误不能在IE下转发页面的问题 -
imlsq:
嘿嘿, 使用SEAM 7-8个月时间了还是放弃使用SEAM的想 ...
发现一个Seam做的企业应用,blackberry的在线商店 -
yuanliyin:
我也在用,唯一不爽的就是性能!
发现一个Seam做的企业应用,blackberry的在线商店 -
perfect:
假的 ,大家不要上当 ,根本不能用
HttpWatch 6.1.41 许可文件
Breezy简介 -- 快速开发Swing程序!
Breezy:
sf 项目主页: http://sourceforge.net/projects/breezy/
下载: http://sourceforge.net/project/showfiles.php?group_id=158540&package_id=177653&release_id=412125
用户讨论区: http://www.hexiao.cn/bbs/thread.php?fid=9
大家都知道开发Swing程序有三大难点:
布局设置,事件处理,和数据绑定. 使用netbean中的新的布局管理器已经解决了第一个问题, 那么后面两个呢?
Breezy 就是用来简化后面两个问题而推出的.
下面我们先来看看一个简单的例子:
package test;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import net.sf.breezy.event.EventInstaller;
import net.sf.breezy.event.annotations.ActionPerformed;
import net.sf.breezy.event.annotations.DefAction;
@SuppressWarnings("serial")
public class TestBreezy extends JFrame {
private JButton button = new JButton("Test Breezy!");
public TestBreezy() {
this.setLayout(new BorderLayout());
this.add(button,BorderLayout.CENTER);
// 用来处理所有的Breezy的Annotations
EventInstaller.processEventAnnotation(this);
this.setSize(400, 300);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
EventInstaller.setAction(button, "action");
}
// button的事件响应方法
@ActionPerformed("button")
public void myButtonAction() {
System.out.println("God, this is terrific!");//设置另外一个事件
}
// 使用id注册另外一个事件响应方法
@DefAction(id="action", name="Button")
void action(ActionEvent e) {
System.out.println(e + ":" + e);
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
JFrame frame = new TestBreezy();
frame.setVisible(true);
}
}
怎么样, 看起来不错吧.
现在Breezy几乎支持所有的Swing EventListeners. 详细情况请查看类net.sf.breezy.event.annotations.*
当然了, 作为一个优秀的框架,还要有可扩展性,在Breezy中开发者还可以自定义自己的事件响应Annotation 来实现自己的功能. 详细情况请查看API.
数据绑定问题主要 就是 JTable 和JTree的问题:
使用Breezy来处理该问题,有点类似于Hibernate中的xml映射数据库属性字段差不多. 可以很方便的映射.
请看下面的例子: 和Breezy文档:
package test;
import java.util.Date;
public class Name {
private String name = "Starwhisperer";
private Date time = new Date();
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
}
User.java
package test;
import java.util.Date;
import net.sf.breezy.datatable.TableField;
public class User {
@TableField(head = "名称", editable = false)
private String name;
@TableField(head = "年龄", editable = false, type = "number")
private int age;
@TableField(head = "阵营", type = "boolean", editable = false)
private boolean light;
@TableField(head = "时间", type = "time", pattern = "yyyy/MM/dd")
private Date date = new Date();
@TableField(head = "名称", property = "name", type="string")
private Name nameBean = new Name();
public Name getNameBean() {
return nameBean;
}
public void setNameBean(Name nameBean) {
this.nameBean = nameBean;
}
public boolean isLight() {
return light;
}
public void setLight(boolean light) {
this.light = light;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
}
DataTableTest .java
package test;
import java.awt.BorderLayout;
import java.util.LinkedList;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import net.sf.breezy.datatable.DataTable;
import net.sf.breezy.datatable.DataTableScrollPane;
public class DataTableTest {
private JFrame mainFrm = new JFrame();
protected void setUp() {
mainFrm.setSize(100, 600);
mainFrm.setLocationRelativeTo(null);
mainFrm.setLayout(new BorderLayout());
mainFrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
DataTableTest test = new DataTableTest();
test.setUp();
test.testTable();
}
public void testTable() {
java.util.List list = new LinkedList();
for(int i = 0; i < 120; i ++) {
User u = new User();
u.setAge(33);
u.setName("Cain " + i);
list.add(u);
}
DataTableScrollPane<User> pane = DataTable.getEntityTablePane(list, User.class);
mainFrm.add(pane, BorderLayout.CENTER);
mainFrm.setVisible(true);
}
}
映射文件:datatable-mappings.xml
<?xml version="1.0"?>
<class-mapping>
<class name="test.User">
<property name="age" head="年龄" />
<property name="light" head="光芒" type="boolean" editable="true"/>
<property name="nameBean" property="time" head="姓名" pattern="yyyy/mm/dd" type="time"/>
<property name="date" head="Date"/>
<property name="name" head="Name"/>
</class>
</class-mapping>
也是很简单的吧. 关于JTree的应用也是很简单的哦. 详细情况请查看用户文档:
更多信息请关注 用户交流论坛: http://www.hexiao.cn/bbs/thread.php?fid=9
发表评论
-
学习使用Java DataBase (Derby) -- 嵌入式数据库
2006-04-13 21:19 1722学习使用Java DataBas ... -
在derby(Java DB) 中操作 clob 和 blob
2006-04-14 15:23 1444在前面一篇文章中, ... -
利用swing开源组件和netbeans快速构建豪华swing界面
2006-04-15 13:41 1386利用swing开源组件和netbeans快速构建豪华s ... -
Java Pet Store 开始全面使用 Web 2.0 技术
2006-05-16 21:58 1012Java Pet Store 开 ... -
Hibernate Validator 简介
2006-05-17 10:35 1224Hibernate Validator 简介 ... -
Google发布AJAX开发工具 Google Web Toolkit
2006-05-17 21:17 847Google Web Toolkit - Build ... -
解析 Hibernate Validator
2006-05-18 15:17 1440任何获得Matrix授权的网站,转载请保留以下作者信 ... -
Spring in Action 笔记(I)
2006-05-22 14:13 839By : icess ,我的部落格 http:// ... -
Spring in Action 笔记(II)
2006-05-25 00:04 1106... -
Spring in Action 笔记(III) -- 在Spring下的Hibernate数据操作
2006-05-27 11:01 794Spring in A ... -
Spring in Action 笔记 (IV) -- i18n问题和自定义属性编辑器
2006-05-29 11:24 936Spring in Action 笔记 (IV) -- i18 ... -
最新消息 ,开源嵌入式数据库 Derby(JavaDB) 绑定在JDK 1.6中.
2006-06-18 18:48 1661如下:Source: Fran ... -
callisto(Eclipse 3.2) 迟到了 ?
2006-06-30 23:04 738在今天早些时候访问 callisto 的主页(http://w ... -
Callisto 终于可以下载了.
2006-07-01 04:47 729Callisto 终于可以下载了. Eclipse 3.2 ... -
最近想研究一下DWR 收集一些从入门到精通的系列资料
2006-07-13 15:55 909最近想研究一下DWR 收集一些从入门到精通的系列资料, 以备将 ... -
decode javascript.encode using java
2006-08-01 13:18 1502在前面一篇文章(http://www.hexiao.cn/bl ... -
Wicket 入门示例 :Hello World.
2006-08-05 10:38 1179Wicket http://wicketframework.o ... -
Wicket 教程2: 如何使用Label,MultiLineLabel,Border,BoxBorder
2006-08-07 15:29 1349上次介绍了一个wicket的一个HelloWorld入门示例, ... -
Wicket 教程3:使用 PageView 来调试页面
2006-08-08 09:22 1527使用 PageView 来调试页面.Wicket中提供了一个P ... -
Wicket 教程4:如何使用 Include,Panel,Fragment,Link
2006-08-08 09:25 2028Wicket 教程4:如何使用 ...
相关推荐
breezy-pdf-lite-php PHP客户端,这是由Google Chrome提供支持 > PDF服务。 依存关系 BreezyPDF Lite:HTML到PDF的生成即服务 安装 composer require jitendra/breezy-pdf-lite-php 用法与范例 use BreezyPdfLite ...
一键部署,然后开始从Web应用程序或命令行生成PDF。 入门 1.提交要转换HTML 这是通过Web服务器上的POST请求完成的。 在本示例中,我们将使用一些示例HTML。 curl -X POST -H ' Authorization: Bearer PRIVATE_...
Breezy是旨在简化Swing上Java GUI应用程序开发的框架。 通过Breezy中的内置和自定义注释,开发人员可以以最少的精力进行事件处理,数据绑定和数据验证。
安装将此行添加到您的应用程序的Gemfile中: gem 'breezy_pdf_lite' 然后执行: $ bundle或将其自己安装为: $ gem install breezy_pdf_lite用法BreezyPDFLite需要进行一些配置才能使用。 在应用程序中的某个位置...
这些在Debian中可用(尽管可能不是builddeb开发版本所需的版本)。 它还需要安装dpkg-dev软件包(对于dpkg-mergechangelogs工具): apt-get install dpkg-dev 该插件可以通过两种方式安装。因为您可能正在使用...
微风计时器 :timer_clock: Breezy计时器的目标是成为一个非常简单的计时库,可以将其放入生产代码中而不会改变最终性能。 请参阅“以获取更多信息。目的简单易用直接在生产代码中使用, 释放时无需修改代码,只需...
Breezy for Chrome提供了一种快速,简单的方法,可将来自Xing,Indeed Resumes,AngelList,Dribbble和Github的候选人吸引到您在Breezy上的职位。 这很简单。 只需浏览到受支持的服务上的用户个人资料,单击右上方的...
Breezy for Chrome提供了一种快速,简单的方法,可从LinkedIn,Xing,Indeed Resumes,AngelList,Dribbble和Github寻求候选人到Breezy的职位。这很简单。只需浏览到受支持的服务上的用户个人资料,单击右上方的...
如果您公司的招聘部门使用作为应用程序跟踪系统,则此应用程序可能会增强您的招聘分析功能。 这个应用程式可让您: 将所有候选数据存储在SQL数据库中,并根据需要完全匿名。 提供有关您当前的职位空缺,候选人以及...
利用和文档类型,使用户能够辨别哪个应用程序(如果有多个)将打开/导入文件。 在下面,您将找到有关如何编辑Info.plist文件以将AirDrop接收器支持添加到您的应用程序的一些资源。 还需要处理打开文件的URL(与...
如果您公司的招聘部门使用作为应用程序跟踪系统,则此应用程序可能会增强您的招聘分析功能。 这个应用程式可让您: 将所有候选数据存储在SQL数据库中,并根据需要完全匿名。 提供有关您当前的职位空缺,候选人...
设计管理员由多个组件组成:每天运行的几个cron作业: package_metadata同步器从UDD导入软件包元数据候选同步器确定候选者调度程序根据lintian,vcswatch和上游数据确定准备处理哪些程序包,并将它们排队。...
Breezy是用于Rails,React和Redux的数据和导航库,可帮助开发人员在不使用API或客户端路由的情况下构建具有丰富数据支持的应用程序。 最重要的是,它补充了经典的Rails。 您在经典Rails中工作时喜欢的功能; 表单...
This is meant to be a breezy book that you could read at one or two sittings, just to get the sense of what this subject is about and how it fits together. In that wise it is quite different from a ...
2、堆区(heap) — 一般由程序员分配释放, 若程序员不释放,程序结束时可能由OS回收 。注意它与数据结构中的堆是两回事,分配方式倒是类似于链表。 3、全局区(静态区)(static)—,全局变量和静态变量的存储...
*整合您的日历和ats*指定面板采访者,持续时间,开始时间等等*保存和重用面板*轻松处理相互冲突的会议*立即搜索多个候选可用性窗口申请人跟踪系统支持:* avature.*竹子* Breezy.* clearcompany.*谷歌雇用*温室* IBM...
On the other hand, neither could the content be described as too breezy, for we include most of the important theorems of the basic theory. The material covered in this book is on the fuzzy boundary ...
This is not intended to be a breezy marketing overview of IPv6 and how it "provides integrated and interoperable technologies to enable exciting new scenarios for personal and enterprise computing.
This is not intended to be a breezy marketing overview of IPv6 and how it "provides integrated and interoperable technologies to enable exciting new scenarios for personal and enterprise computing." ...