swt

How can I creating executable JAR with SWT that runs on all platforms?

邮差的信 提交于 2019-11-27 01:54:41
问题 SWT comes with a base JAR and one specific JAR per platform (Windows, Linux/32bit, Linux/64bit, Mac, AIX, ...). How can I create an executable JAR that will select the correct platform JAR at runtime? [EDIT] I was thinking to supply all platform JARs in a subdirectory and in main() would then modify the class loader. Has anyone already tried this? 回答1: Look at this, there is a code sample: Create cross platform java swt application 回答2: For my current job I needed to supply an executable jar

Create GUI using Eclipse (Java) [duplicate]

醉酒当歌 提交于 2019-11-27 00:11:25
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Best GUI designer for eclipse? Is there any Eclipse Plugin tool(s) who can help to create Graphical User Interface for (swing, awt or swt), because I'm tired of writing everytime the code of Panels, Labels, ... Thanks 回答1: Yes. Use WindowBuilder Pro (provided by Google). It supports SWT and Swing as well with multiple layouts (Group layout, MiGLayout etc.) It's integrated out of the box with Eclipse Indigo, but

How would one use IDecorationContext api from Eclipse JFace

为君一笑 提交于 2019-11-26 23:35:54
问题 Is there an example out there for using IDecorationContext for label decorations? By the looks of it, IDecorationContext class seems to provide some sort of contextual decoration support, but for the life of me, I can not find any sample code using this feature... Has anybody actually used decoration context feature and if so, what use cases did it solve? PS: I am looking for a way to apply image decorations to object labels and depending on where the object is displayed, the base icon size

How to update SWT GUI from another thread in Java

混江龙づ霸主 提交于 2019-11-26 22:55:28
问题 I am writing a desktop application using SWT. What is the simplest way to update GUI controls from another thread? 回答1: Use Display.asyncExec or Display.syncExec, depending on your needs. For example, another thread might call this method to safely update a label: private static void doUpdate(final Display display, final Label target, final String value) { display.asyncExec(new Runnable() { @Override public void run() { if (!target.isDisposed()) { target.setText(value); target.getParent()

How to make SWT Browser control use Mozilla instead of IE on Windows?

落爺英雄遲暮 提交于 2019-11-26 22:23:30
问题 I want to make SWT use Firefox on all platforms I run my app on. But SWT of course used IE on Windows by default. Any idea how to make SWT use Mozilla on windows. I know that I need to have XULRunner installed on the machine. 回答1: Funny you've asked - I just needed the same for our project. Go to ATF site (http://wiki.eclipse.org/ATF/Installing) - there's how to d/l XUL Runner from Zend site. This code will let you run the browser without registering the XULRunner: Code: Bundle bundle =

SWT FileDialog: Selecting directories instead of files

六眼飞鱼酱① 提交于 2019-11-26 21:34:13
问题 Can I use the SWT FileDialog to select folders instead of files? 回答1: You could use the DirectoryDialog instead. Here is some sample code: public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.open(); DirectoryDialog dialog = new DirectoryDialog(shell); dialog.setFilterPath("c:\\"); // Windows specific System.out.println("RESULT=" + dialog.open()); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); }

maven project: SWT 3.5 dependency: any official public repo?

China☆狼群 提交于 2019-11-26 20:40:43
问题 Well, in short, I may need to grab new SWT version instead of 3.3 we're using for now. The project now has only this dependency and builds fine: <dependency> <groupId>org.eclipse.swt.win32.win32</groupId> <artifactId>x86</artifactId> <version>3.3.0-v3346</version> </dependency> AFAICGoogle, there is no more recent version in the public maven repo: http://repo1.maven.org/maven2/org/eclipse/swt/ So: Is there some public maven repo with recent builds? If not, where do you get the jars you

SWT on Windows 64-bit

心不动则不痛 提交于 2019-11-26 20:31:39
问题 My application throws the exception below. Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SW T libraries on 64-bit JVM. How to solve this? What is the name of jar file needed? 回答1: On 64-bit JVM's you need the 64-bit SWT. Current versions can be downloaded here: http://archive.eclipse.org/eclipse/downloads/drops/R-3.6.1-201009090800/index.php#SWT Note the first two downloads, the first is for x32, the other for x64. Note: Even on 64bit Windows, if you use the

Build one jar per platform for multi-platform SWT application

*爱你&永不变心* 提交于 2019-11-26 18:27:19
问题 There are a couple of questions to this topic already, but none of them seem to work properly. Here is a list of them: Bulding an multi-platform SWT application using Ant Build multi-platform executable for a SWT application (Eclipse) Build multi-platform executable for a SWT application using maven SWT jar for different platform Create cross platform Java SWT Application My requirement is to build an ant script that creates one jar per platform , i.e. one for Windows x86, one for Windows x64

how to embed SWT browser in swing jframe

和自甴很熟 提交于 2019-11-26 17:15:18
问题 I want to embed my SWT browser in swing jframe. I try sample, but it need to resize the window to load browser window. what can I do to repaint the canvas, with out resizing? 回答1: Here is a working example on GIT showing how to embed SWT in a traditional Swing JPanel: https://gist.github.com/caprica/6890618 (Text version: here) The trick is to create a java.awt.Canvas linked to an SWT shell. This canvas can be added to any tradionnal Swing component. The SWT shell loop is managed by a