import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.events.*;
class TopFrame extends Shell {
TopFrame(Display display) {
super(display);
this.setBounds(400,400,640,480);
create_sub_object();
}
void create_sub_object() {
//button
push_btn=new Button(this,SWT.PUSH);
push_btn.setBounds(10,10,75,30);
push_btn.setText("PUSH");
push_btn.addSelectionListener(new SelectionListener()
{
public void widgetDefaultSelected(SelectionEvent e) {
;
}
public void widgetSelected(SelectionEvent e) {
label.setText("push button clicked");
}
});
check_btn=new Button(this,SWT.CHECK);
check_btn.setBounds(110,10,75,30);
check_btn.setText("CHECK");
radio_btn=new Button(this,SWT.RADIO);
radio_btn.setBounds(210,10,75,30);
radio_btn.setText("RADIO1");
radio_btn1=new Button(this,SWT.RADIO);//在同一个父窗口中只能有一个被选中
radio_btn1.setBounds(310,10,75,30);
radio_btn1.setText("RADIO2");
//label
label=new Label(this,SWT.BORDER);
label.setBounds(200,300,200,50);
label.setText("Label 控件");
}
Button push_btn;
Button check_btn;
Button radio_btn;
Button radio_btn1;
Label label;
protected void checkSubclass() { //想要继承Shell,必须重写此方法
;
}
}
public class myswt {
public static void main(String[] args) {
Display display=new Display(); //主程序对象
TopFrame top_frame=new TopFrame(display); //主窗口对象
top_frame.open(); //打开窗口
while(!top_frame.isDisposed()) { //如果窗口没有被销毁则一直循环
if(!display.readAndDispatch()) {
display.sleep(); //无消息则休眠
}
}
display.dispose();
}
}相关推荐
告别示教器!用C#和ABB PC SDK 6.08打造你的第一个Windows机器人控制台(附完整连接代码)
本文详细介绍了如何使用C#和ABB PC SDK 6.08开发Windows机器人控制台应用,实现无示教器的机器人控制。从环境配置、SDK引用到机器人发现、连接及状态监控,提供了完整的代码示例和架构设计建议,帮助开发者快速掌握上位机控制技术。
SWT控件总结
控件palette 1.System Choose component 选择组件:允许选择组件类型并将其拖放到设计画布上 Tab Order标签的顺序:设置所选选项卡顺序 2.Composites Composite 复合:能够包含其他控件的控件 Group 集团:提供带有可选标题的蚀刻边界 Scrolled Composite :在滚动框中包含其他控件的控件 SashForm:以行或列的方式排列它的子控件(由方向指定) TabFolder:实现了笔记本用户界面比
基于python+mediapipe的手势拖动识别(无gpu)
手势点方块拖动
SWT –标签示例
什么是标签? Label是最常用和最常用的窗口小部件,它显示静态信息,例如String或Image,并且不涉及用户输入。 如何创建标签小部件? 此代码段将在位置x = 100,y = 50,宽度= 300,高度= 30处创建标签,并显示“我是标签”文本。 Label label = new Label(shell, SWT.BORDER); label.setSize(300,...
首个基于LBS方案的3D传感器,VoxelSensor解析
该传感器将结合OQmented的Lissajous模式的MEMS扫描镜,与每帧逐行工作的光栅扫描相比,Lissajous轨迹扫描速度更快,并且能耗很低,它可以更快地捕获完整的场景和快速移动,并且需要更少的数据处理,可满足AR/VR对于低延迟、高效率的需求。简单来讲,Switching Pixels的区别是专注于识别激光事件,性能比普通事件相机更好,但也可以使用事件相机的算法。在具体应用中,它需要在X和Y方向发射一个或多个脉冲光束,以在X和Y轴上定位,而Z轴,也就是深度,则是通过计算光返回的时间来测量。
OpenSceneGraph编译、安装、开发环境
详细描述WIndows 10下使用Visual Studio 2019编译OpenSceneGraph 3.6.5的操作流程
SWT常用标签详解
1按钮组件(Button) (1)Button组件常用样式 SWT.PUSH按钮 SWT.CHECK多选按钮 SWT.RADIO单选按钮 SWT.ARROW箭头按钮 SWT.NONE默认按钮 SWT.CENTER文字居中与SWT.NONE SWT.LEFT左对齐 SWT.RIG
宇瞳杯安防镜头设计
宇瞳杯安防镜头设计
关于SWT常用组件(按钮,复选框,单选框(Button类))
Button是SWT中最常用的组件.Button类的继承关系图: Button类的构造方法是newe Button(Composite parent,int style)它有两个参数: 第一个参数:是Button创建在哪个容器上.Composite是最常用的容器,而Shell是 Composite的子类.所以此参数也能接受Shell和任何继承自Composite的子类. 第二个参数用...
【Dify】PPT生成工具应用
本文介绍了一款自动化PPT生成工具,通过智能接口将文本内容高效转化为结构化演示文档。该系统采用三阶段工作流(内容输入、HTTP请求上传、文件输出),无需复杂操作即可生成专业PPT。工具适用于教学课件、产品发布、企业培训等场景,能显著提升内容表达效率,特别适合初学者快速制作演示材料。文章详细说明了核心节点、应用场景及开发资源,为文本到PPT的自动化转换提供了实用解决方案。
【大数据Java基础-Java基础01】环境搭建(一)Sublime Text3搭建Java编译环境(Windows系统)
1. 首先配置好Java环境变量 我的jdk版本是1.8.0_191,存放目录是C:\Program Files\Java,因此添加以下环境变量 (1)系统变量→新建 JAVA_HOME 变量,变量值为: C:\Program Files\Java\jdk1.8.0_191 (2)系统变量→找到 Path 变量→编辑,末尾加入: ;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin 如果Path变量末尾本身有“;”,则上述路径前面则不需要加“;” (3)系统变量→新建 CL
SWT 和 JFace, 第 1 部分:如何创建简单的 SWT 应用程序
在这篇 SWT 和 JFace 系列的第一篇文章中,可以了解如何使用 Java™、Eclipse 以及 SWT 和 JFace 库创建简单的 SWT 应用程序。 还可以了解如何使用基本的控件和布局创建简单的 SWT GUI。可以使用标准窗口小部件工具箱(Standard Widget Toolkit,SWT)和 JFace 库来开发用于 Eclipse 环境的图形用户界面,而且还可以将
图像处理:张量分解在图像处理领域的应用
随着计算机视觉和图像处理技术的快速发展,图像数据呈现出高维、多模态、海量等特点。传统的矩阵分解方法已经无法有效处理这些复杂的图像数据。张量分解作为一种高阶矩阵分解方法,可以很好地捕捉图像数据的高维结构信息,在图像处理领域展现出巨大的应用前景。本节介绍几种常用的张量分解算法,包括高阶SVD(HOSVD)、Tucker-ALS、CP-ALS等。这些算法的核心思想是通过迭代优化的方式,交替更新张量分解的因子矩阵,直到收敛为止。综上所述,本文系统地介绍了张量分解技术在图像处理领域的应用。
swt显示图片
可以用Button或者Label来显示图片,他们都有setImage的API,但是两者都有一定的限制,
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
IMSL CNL 7.0.0 (x86-64)Crack
IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件
SWT 和 JFace,第 1 部分: 如何创建简单的 SWT 应用程序
在这篇 SWT 和 JFace 系列的第一篇文章中,可以了解如何使用 Java™、Eclipse 以及 SWT 和 JFace 库创建简单的 SWT 应用程序。 还可以了解如何使用基本的控件和布局创建简单的 SWT GUI。 可 以使用标准窗口小部件工具 箱(Standard Widget Toolkit,SWT)和 JFace 库来开发用于 Eclipse 环境的图形用户界面,而且
TMS_WebGMaps_1.9.8.0_Full_Source
TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder
java swt 关闭_java-如何使用swt.TabItem添加关闭按钮?
TabFolder tabFolder = new TabFolder(composite, SWT.CLOSE);TabItem tab1 = new TabItem(tabFolder, SWT.CLOSE);tab1.setText("Tab 1");TabItem tab2 = new TabItem(tabFolder, SWT.CLOSE);tab2.setText("Tab 2");...
计算机控制技术及应用
《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。
SWT 和 JFace,第 1 部分: 简介
在这篇 SWT 和 JFace 系列的第一篇文章中,可以了解如何使用 Java™、Eclipse 以及 SWT 和 JFace 库创建简单的 SWT 应用程序。 还可以了解如何使用基本的控件和布局创建简单的 SWT GUI。 可以使用标准窗口小部件 工具箱(Standard Widget Toolkit,SWT)和 JFace 库来开发用于 Eclipse 环境的图形用户界面,而且还可以将它们用...
swt入门
Eclipse中用SWT和JFace开发入门 可以使用标准窗口小部件工具箱(Standard Widget Toolkit,SWT)和 JFace 库来开发用于 eclipse 环境的图形用户界面,而且还可以将它们用于开发单独的 GUI 本机应用程序。在本文中,我将介绍一些基本的 SWT(基本 GUI 对象的名称)类型,并展示如何综合使用它们来创建有用的应用程序。 关于
SWT常用组件
一、基础组件1.按钮组件(Button)(1)Button组件常用样式SWT.PUSH按钮SWT.CHECK多选按钮SWT.RADIO单选按钮SWT.ARROW箭头按钮SWT.NONE默认按钮SWT.CENTER文字居中与SWT.NONESWT.LEFT左对齐SWT.RIGHT右对齐SWT.BORDER深陷型按钮SWT.FLAT平面型按钮一个Button可以指定多个样式,只要将指定的各个样式用符号“
java swt gridlayout_java-重新排序GridLayout SWT
您要查找的方法是Control#moveAbove(Control控件)和Control#moveBelow(Control控件)以对项目进行重新排序:private static List labels = new ArrayList();private static List colors = new ArrayList();public static void main(String...
SWT常用组件列表及使用
最近一直在使用swt开发kettle 插件,下面是我整理的swt常用组件的一些样式和使用方法。一、按钮(Button)1、Button常用样式 样式 说明 SWT.NONE 无 SWT.PUSH 按钮 SWT.CHECK 多选按钮 SWT.RADIO 单选按钮 SWT.ARROW 箭头按钮 SWT.NONE 默认按钮 SWT.CENTER
java学习第一天--窗体程序开发之swt学习
学习目的: 通过学习swt,完成窗体程序开发。 学习进展: 今天已初步学习SWT,对swt的各种控件及控件常用方法有了一定的了解,并仿照网友程序进行模仿开发学习。 学习问题: 对swt的布局理解的还不是很透彻,对各控件的事件了解的不够全面,同时欠缺事件。 学习内容: 了解到当前java进行窗体程序开发,主要有三种方式,SWT、swing、awt三种,其中对于Eclip
《java-SWT浏览器实现》
import org.eclipse.swt.SWT; import org.eclipse.swt.browser.Browser; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org
SWT控件
面板(Composite) 面板(Composite类)是最常用的容器。面板的构造方法格式如下: new Composite(Composite parent,int style) 第一个参数表示该容器创建在哪个容器上,第二个参数表示容器的式样。Composite的式样一般都是用SWT.NONE,这时Composite在界面是 不显示出来的,只是发挥着容器的作用。如果...
IBM实验室对SWT, Swing 和 AWT 的特征比较
Table 1. SWT vs. AWT and Swing Feature comparison Function/Role/Aspect AWT Swing SWT (style) Display static text
320



被折叠的 条评论
为什么被折叠?



