Tag Archives: SWT

SWT Style Bits – Bitwise Or and Bitwise And

Ever wondered how SWT Style bits work? It is actually very simple. The style bits are a multitud of 2 SWT.NONE = 0, // 00000000 binary SWT.MULTI = 2, // 00000010 binary SWT.SINGLE = 4; // 00000100 binary SWT.READ_ONLY = … Continue reading

Posted in Eclipse | Tagged | 3 Comments

Browser Tales – Java to JavaScript and vice versa with the SWT Browser Widget

The SWT Browser widget makes it very easy to run HTML and JavaScript within Eclipse. This widget encapsulates a browser (system dependent) into a SWT widget. The following screenshot is from the second example below. This example is based on … Continue reading

Posted in Eclipse | Tagged , , | 1 Comment

JavaScript in the SWT Browser widget

At the Eclipse Summit Europe I listened to a talk of Boris Bokowski about Eclipse and the Web. Among other things I learned that you can execute JavaScript directly on the SWT Browser Widget and I wanted to give a … Continue reading

Posted in Eclipse | Tagged , | 4 Comments

SWT – Putting a file into the clipboard

I recently got the question how you can put a file into the system clipboard. SWT makes this trivial: [sourcecode language=”java”] package de.vogella.desktop.clipboard; import org.eclipse.swt.dnd.Clipboard; import org.eclipse.swt.dnd.FileTransfer; import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.widgets.Display; /** * Utility class for putting files into the … Continue reading

Posted in Eclipse | Tagged | 5 Comments