eclipse插件教程-弹出界面框

来源:互联网 发布:安赛蜜 知乎 编辑:程序博客网 时间:2024/05/19 17:25
package com.youhua.link.actions;import org.eclipse.swt.SWT;import org.eclipse.swt.graphics.Color;import org.eclipse.swt.layout.FillLayout;import org.eclipse.swt.widgets.Display;import org.eclipse.swt.widgets.Label;import org.eclipse.swt.widgets.Shell;public class Main {public static void main(String[] args) {// TODO Auto-generated method stubDisplay display = new Display();Shell shell = new Shell(display);shell.setText("hello");shell.setBounds(100,100,200,50);shell.setLayout(new FillLayout());Label label = new Label(shell,SWT.CENTER);label.setText("fd");Color red = new Color(display,255,0,0);label.setForeground(red);shell.open();while(!shell.isDisposed()){if(!display.readAndDispatch()){display.sleep();}}red.dispose();display.dispose();}}



利用SWT组件,单独编写一个框,该弹框可以独立运行。

0 0
原创粉丝点击