⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setvisibletest.java

📁 用java 实现的IE browser适合于学者
💻 JAVA
字号:
package com.hnjchina.example.qq;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.*;
/**
 * @author Jove
 */
public class SetVisibleTest {
	private static Button button_B;
	public static void main(String[] args) {
		final Display display = new Display();
		final Shell shell = new Shell();
		shell.setSize(278, 101);
		shell.setLayout(new RowLayout());
		shell.setText("SWT Application");
		{
			final Composite composite = new HideInvisibleComposite(shell,SWT.NONE);
			composite.setLayout(new RowLayout());
			{
				final Button button_A = new Button(composite, SWT.NONE);
				button_A.addSelectionListener(new SelectionAdapter() {
					public void widgetSelected(SelectionEvent e) {
						button_B.setVisible(!button_B.isVisible());
						composite.layout();
					}
				});
				button_A.setText("button1");
			}
			{
				button_B = new Button(composite, SWT.NONE);
				button_B.setText("button2");
			}
			{
				final Button button_C = new Button(composite, SWT.NONE);
				button_C.setText("button3");
			}
		}
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -