- 浏览: 1158180 次
- 性别:
- 来自: 火星郊区
-
博客专栏
-
-
OSGi
浏览量:0
文章分类
- 全部博客 (695)
- 项目管理 (48)
- OSGi (122)
- java (79)
- Vaadin (5)
- RAP (47)
- mysql (40)
- Maven (22)
- SVN (8)
- 孔雀鱼 (10)
- hibernate (9)
- spring (10)
- css (3)
- 年审 (6)
- ant (1)
- jdbc (3)
- FusionCharts (2)
- struts (4)
- 决策分析 (2)
- 生活 (10)
- 架构设计 (5)
- 破解 (2)
- 狼文化 (4)
- JVM (14)
- J2EE (1)
- 应用服务器 (1)
- 我的链接 (5)
- 数学 (2)
- 报表 (1)
- 百科 (6)
- Flex (7)
- log4j (2)
- PHP (1)
- 系统 (2)
- Web前端 (7)
- linux (6)
- Office (1)
- 安全管理 (5)
- python (2)
- dom4j (1)
- 工作流 (3)
- 养生保健 (4)
- Eclipse (8)
- 监控开发 (1)
- 设计 (3)
- CAS (1)
- ZK (41)
- BluePrint (3)
- 工具 (1)
- SWT (7)
- google (2)
- NIO (1)
- 企业文化 (2)
- Windoes (0)
- RCP (7)
- JavaScript (10)
- UML (1)
- 产品经理 (2)
- Velocity (10)
- C (1)
- 单元测试 (1)
- 设计模式 (2)
- 系统分析师 (2)
- 架构 (4)
- 面试 (2)
- 代码走查 (1)
- MongoDB (1)
- 企业流程优化 (1)
- 模式 (1)
- EJB (1)
- Jetty (1)
- Git (13)
- IPV6 (1)
- JQuery (8)
- SSH (1)
- mybatis (10)
- SiteMesh (2)
- JSTL (1)
- veloctiy (1)
- Spring MVC (1)
- struts2 (3)
- Servlet (1)
- 权限管理 (1)
- Java Mina (1)
- java 系统信息 (6)
- OSGi 基础 (3)
- html (1)
- spring--security (6)
- HTML5 (1)
- java爬虫搜索 (1)
- mvc (3)
最新评论
-
Tom.X:
http://osgia.com/
将web容器置于OSGi框架下进行web应用的开发 -
chenyuguxing:
你好, 为什么我的bundle export到felix工程中 ...
在Apache Felix中运行bundle -
string2020:
<niceManifest>true</ni ...
Bundle Plugin for Maven -
jsonmong:
OSGI,是未来的主流,目前已相当成熟。应用OSGI比较好的, ...
基于OSGi的声明式服务 -
zyhui98:
貌似是翻译过来的,有很少人在linux上做开发吧
如何成为“10倍效率”开发者
实现像网页上的那种用户单击一个Text框然后框下面出现一个日历控件,点击Text框以外的地方日历消失,怎么实现?
- import org.eclipse.swt.SWT;
- import org.eclipse.swt.events.MouseAdapter;
- import org.eclipse.swt.events.MouseEvent;
- import org.eclipse.swt.graphics.Color;
- import org.eclipse.swt.graphics.Point;
- import org.eclipse.swt.widgets.Display;
- import org.eclipse.swt.widgets.Shell;
- import org.eclipse.swt.widgets.Text;
- public class DateTimeDemo extends Shell
- {
- private static Display display;
- private Text text;
- public static void main(String args[])
- {
- try
- {
- display = Display.getDefault();
- DateTimeDemo shell = new DateTimeDemo(display, SWT.SHELL_TRIM);
- shell.open();
- shell.layout();
- while (!shell.isDisposed())
- {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
- }
- display.dispose();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- public DateTimeDemo(Display display, int style)
- {
- super (display, style);
- createContents();
- }
- protected void createContents()
- {
- setText("DateTime" );
- setSize(471 , 140 );
- text = new Text( this , SWT.BORDER);
- text.setEditable(false );
- text.setBackground(new Color(display, 255 , 255 , 255 ));
- text.setBounds(122 , 41 , 228 , 25 );
- text.addMouseListener(new MouseAdapter()
- {
- public void mouseUp(MouseEvent e)
- {
- DTDialog dialog = DTDialog.getInstance(DateTimeDemo.this );
- dialog.open();
- }
- });
- }
- public Point getDtLocation()
- {
- return new Point(text.getLocation().x + DateTimeDemo. this .getLocation().x,
- text.getLocation().y + DateTimeDemo.this .getLocation().y + 60 );
- }
- public void setDate(String str)
- {
- text.setText(str);
- }
- @Override
- protected void checkSubclass()
- {
- // Disable the check that prevents subclassing of SWT components
- }
- }
- import org.eclipse.swt.SWT;
- import org.eclipse.swt.events.FocusAdapter;
- import org.eclipse.swt.events.FocusEvent;
- import org.eclipse.swt.events.SelectionAdapter;
- import org.eclipse.swt.events.SelectionEvent;
- import org.eclipse.swt.layout.FillLayout;
- import org.eclipse.swt.widgets.DateTime;
- import org.eclipse.swt.widgets.Dialog;
- import org.eclipse.swt.widgets.Display;
- import org.eclipse.swt.widgets.Shell;
- public class DTDialog extends Dialog
- {
- private Object result;
- private Shell shell;
- private DateTime dateTime;
- private DateTimeDemo parent;
- private static DTDialog instance;
- public static DTDialog getInstance(DateTimeDemo parent)
- {
- if (instance == null )
- {
- instance = new DTDialog(parent);
- }
- return instance;
- }
- private DTDialog(DateTimeDemo parent)
- {
- super (parent, SWT.NO_TRIM);
- this .parent = parent;
- }
- public Object open()
- {
- if (shell == null || shell.isDisposed())
- {
- createContents();
- shell.open();
- shell.layout();
- Display display = getParent().getDisplay();
- while (!shell.isDisposed())
- {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
- }
- display.dispose();
- }
- else
- {
- shell.setLocation(parent.getDtLocation());
- shell.setVisible(true );
- shell.setFocus();
- }
- return result;
- }
- protected void createContents()
- {
- shell = new Shell(getParent(), SWT.NO_TRIM);
- shell.setLayout(new FillLayout());
- shell.setSize(272 , 140 );
- shell.setLocation(parent.getDtLocation());
- shell.setText("SWT Dialog" );
- dateTime = new DateTime(shell, SWT.CALENDAR);
- dateTime.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- parent.setDate(formatDt());
- }
- });
- dateTime.addFocusListener(new FocusAdapter()
- {
- public void focusLost(FocusEvent e)
- {
- parent.setDate(formatDt());
- shell.setVisible(false );
- }
- });
- }
- private String formatDt()
- {
- return dateTime.getYear() + "-" + dateTime.getMonth() + "-" + dateTime.getDay();
- }
- public Shell getShell()
- {
- return shell;
- }
-
}
发表评论
-
RCP开发者的好去处之ICON系列(持续更新中... ...)
2012-03-31 10:13 1130为了找个合适的图片是不是头大的不像样子了?OK,我现在就 ... -
RAP 整合 Spring (基于 Spring-osgi )
2012-03-31 10:12 1393RAP 介绍请见: http://www.eclipse. ... -
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
2012-03-25 14:50 1470引用 在rcp的路径添加了mysql驱动,并添加之cla ... -
解决JFace Dialog中ScrollComposite无法滚动
2012-03-26 10:26 1602今天写了一个Jface的dialog,作为配置界面,其中有 ... -
JFace进度条
2012-03-27 08:01 1121Java代码 someB ... -
getConfigurationElementsFor 无法获得扩展点的信息
2012-03-26 10:27 1095做项目的时候RCP程序在eclipse调试环境下面运行正常 ... -
测试rcp 和 rap 何时触发 组建.addListener(SWT.xxx, new Listener() )的方法
2012-02-24 14:22 1292Java代码 直接通过反射让组建监 ... -
RAP 界面显示不完全的问题
2012-02-24 14:22 1244rap运行第一刷新界面总是刷新不完整,组件错位,后台报Layo ... -
Uploading files with RAP 1.4
2012-02-17 11:37 1623One of the new things in RAP 1. ... -
【RAP】CAS PIA 快速浏览入口地址
2012-02-07 08:23 1248下面的链接是访问RAP应用的入口。有2中方式,图片上已经注明。 ... -
RAP 与 RCP的区别
2012-02-07 08:23 1330RAP 可以让开发人员使用 JAVA API 和按照 E ... -
将Eclipse RAP部署到Tomcat中
2012-02-07 08:23 1151在上次成功将我的RCP项目迁移到浏览器中运行后,开始研究 ... -
RAP(Rich AJAX Platform)的可部署文件下载
2012-02-07 08:24 1144这是我自己做的RAP的可部署文件,可以下载下来解压到Tom ... -
Eclipse rcp/rap 开发经验总结(15) -rap如何使用js
2012-02-03 08:11 14611. 把输入的字符串当 javascript 执行 ... -
Eclipse rcp/rap 开发经验总结(14) -rap 图片、数据缓存处理
2012-02-03 08:10 1527一、概述 在进行了 rap 的基本学习之后,您对 rap ... -
Eclipse rcp/rap 开发经验总结(13) -Rap/Rcp保存按钮处理方式
2012-02-03 08:10 1091一、概述 在做项目的过程中,处理编辑区的保存机制的时候。发 ... -
Eclipse rcp/rap 开发经验总结(12) -Rap 优化之组件的销毁
2012-02-03 08:10 883一、概述 经过几个月的rap 项目实战,总结了一些小 ... -
Eclipse rcp/rap 开发经验总结(11) -rcp/rap与spring ibatis集成
2012-02-03 08:10 13231. rcp/rap 与 spring 集成 Activa ... -
Eclipse rcp/rap 开发经验总结(10) -Rap不同系统间的差异和处理方式
2012-02-01 08:01 1407平常进行 rap 程序开发一般都是在 win ... -
Eclipse rcp/rap 开发经验总结(9) - rap上传与下载
2012-02-01 08:01 1064一 上传 上传即将文件上传到服务器上,在客户端需 ...
相关推荐
SWT自带的DateTime控件属实不好用...1、日历控件可自定义设置常见的几种日期格式; 2、可以绑定注册到其他控件如:文本框、按钮、标签上使用; 3、可以绑定注册控件后给指定其他控件赋值。 使用者可以自己再次进行扩展
在这个“SWT日期时间选择控件.rar”压缩包中,包含的是一个针对SWT框架自定义封装的日期和时间选择器控件。这个控件允许用户方便地选取特定的日期和时间,提高了用户界面的交互性和用户体验。 在SWT中,虽然有基础...
`swt-datepicker.jar`是包含这个日期时间选择控件类的库文件,它应该包含了控件的实现代码以及必要的资源。开发者可以通过在他们的项目中引入这个JAR文件,来使用这个功能。通常,引入外部库的方式是在构建路径中...
8. **API接口**: 为了便于其他组件或服务使用这个日期控件,可能会提供一组公共方法,例如`show()`来弹出日历,`selectDate(Date date)`来设置或获取日期等。 开发这样一个控件需要深入理解Java编程,SWT或JFace库...
SWT使用JNI(Java Native Interface)来实现这一目标,它允许Java代码直接调用操作系统提供的API,从而避免了Java AWT和Swing中的“重量级”组件带来的性能问题。 ### 2. 自定义控件的基础 在SWT中,自定义控件通常...
用 SWT 来显示 日历控件 源码 很实用
而"swt实现的日历附带说明使用"这个主题涉及到的是如何在SWT应用中集成日历功能,特别是使用了JDatePicker这个组件。 JDatePicker 是一个基于Java Swing的组件,它提供了日历选择器的功能。虽然SWT主要用在非Swing...
Java使用SWT JFreeChart控件实现的小游戏.zipJava使用SWT JFreeChart控件实现的小游戏.zipJava使用SWT JFreeChart控件实现的小游戏.zipJava使用SWT JFreeChart控件实现的小游戏.zipJava使用SWT JFreeChart控件实现的...
SWT(Standard Widget Toolkit)是Java编程中用于创建图形用户界面(GUI)的一种库,它为开发者提供了丰富的控件和对话框。在SWT中,`MessageBox`是一个用于显示简单的消息对话框的类,通常用来向用户显示警告、确认...
SWT(Standard Widget Toolkit)是Eclipse基金会推出的一种用于创建Java GUI应用程序的开源库,它提供了丰富的用户界面组件,使得开发者能够构建出功能强大的桌面应用。在SWT中,虽然内建了一些基本的控件,但并没有...
在IT行业中,有时候我们需要在Java应用中集成第三方控件或者组件来实现特定的功能,比如在SWT(Standard Widget Toolkit)环境中嵌入Word编辑器。这篇博客"SWT中嵌入Word控件应用"可能就是讲述如何在Java SWT界面中...
**SWT控件详解** SWT(Standard Widget Toolkit)是由Eclipse基金会开发并维护的一套用于构建图形用户界面(GUI)的开源库,它是Java语言中的一个GUI工具包,主要面向那些希望创建高性能、原生外观的应用程序的...
本教程集合了SWT中的所有控件及其使用代码,旨在帮助开发者快速理解和应用这些控件。 1. SWT控件基础 SWT提供了丰富的控件集,包括按钮(Button)、文本框(Text)、列表(List)、表格(Table)、树(Tree)、...
SWT中实现shell Canvas Composite等控件的背景透明
总的来说,这个示例涵盖了SWT GUI开发、时间选择控件的使用、Java定时任务的实现以及通过批处理文件运行Java应用程序的技巧。通过深入学习和理解这些内容,开发者可以创建出具有复杂交互和定时功能的桌面应用程序。
根据提供的文件信息,可以看出本文主要讨论的是如何在 SWT (Standard Widget Toolkit) 的 Table 控件中实现文本换行的功能。SWT 是一个用于开发基于 Java 的桌面应用程序的工具包,它提供了丰富的用户界面组件来帮助...
SWT 使用 OLE 函数调用com控件的资料 SWT 使用 OLE 函数调用com控件的资料SWT 使用 OLE 函数调用com控件的资料SWT 使用 OLE 函数调用com控件的资料 SWT 使用 OLE 函数调用com控件的资料
本文将深入探讨如何使用Draw2D模拟SWT中的RadioButton和CheckedBox控件,以及这些控件在实际应用中的作用和实现方式。 首先,RadioButton和CheckedBox是GUI中的两种常见选择控件。RadioButton通常用于提供一组互斥...
- **绘制机制**:在SWT中,控件的绘制主要是通过监听`PaintListener`接口实现的。当控件需要重新绘制时,系统会自动调用监听器中的`paintControl`方法。 **实践步骤**: 1. **继承Canvas**:通常情况下,自定义控件...