swt

Prevent SWT ScrolledComposite from eating part of it's children

↘锁芯ラ 提交于 2019-11-27 18:04:51
问题 What did I do wrong? Here is an excerpt from my code: public void createPartControl(Composite parent) { parent.setLayout(new FillLayout()); ScrolledComposite scrollBox = new ScrolledComposite(parent, SWT.V_SCROLL); scrollBox.setExpandHorizontal(true); mParent = new Composite(scrollBox, SWT.NONE); scrollBox.setContent(mParent); FormLayout layout = new FormLayout(); mParent.setLayout(layout); // Adds a bunch of controls here mParent.layout(); mParent.setSize(mParent.computeSize(SWT.DEFAULT, SWT

how to embed SWT browser in swing jframe

荒凉一梦 提交于 2019-11-27 15:45:26
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? 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 separate thread. Here is a screenshot on my Windows 7 box with Java 7: 来源: https://stackoverflow.com/questions

SWT components relayout after visibility set to false

南笙酒味 提交于 2019-11-27 15:31:49
Lets say if I have a GridLayout composite with column = 1. (Something like a vertical flow layout) I have added Label 1, Label 2, Label 3 to this composite, and they will appear accordingly. ---------- Label 1 | Label 2 | Label 3 | ---------- So is it possible that if I set the visibility of Label 2 to be false , can Label 3 move up to replace Label 2? And if Label 2 visibility is set back to true , Label 3 will move down? A very simple solution could use GridData::exclude property. For example, Code import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt

Build one jar per platform for multi-platform SWT application

冷暖自知 提交于 2019-11-27 14:52:47
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, Linux x86/x64 and so on. Does anyone have any further insight? Using the aforementioned methods, I

swt browser No more handles Error

两盒软妹~` 提交于 2019-11-27 14:50:41
问题 I wrote a simple program. just a CTabFolder and a WelcomTab inherent from CTabItem. I want to fill my WelcomeTab by a browser which render my htmls. at the init() method of WelcomeTab I Create a Browser but when program want to construct it I get this Error Exception in thread "main" org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)] at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.browser.Mozilla.initMozilla(Unknown Source) at org

Adding a remove button to a column in a table

岁酱吖の 提交于 2019-11-27 14:29:25
Is it possible to add a Remove button to a cell in a table? I have a table with 5 columns, I would like to add a 6th column. I want the 6th column to have a remove button in each row. Example Row: | 10002 | part | Metal | 001 | Yes | Remove | That way the user can remove any unwanted rows by just clicking the button. I have a markup column in the table and it is ComboBox . I created a class that extends EditingSupport . Would I need to make a another class extending EditingSupport , but creating a button instead of ComboBox ? EDIT public class AplotDataTableViewer extends TableViewer { public

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

筅森魡賤 提交于 2019-11-27 13:49:33
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. Eugene 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 = Platform.getBundle("org.mozilla.xulrunner"); //$NON-NLS-1$ if (bundle != null) { URL resourceUrl =

Libraries for pretty charts in SWT? [closed]

一个人想着一个人 提交于 2019-11-27 12:10:32
I know the following libraries for drawing charts in an SWT/Eclipse RCP application: Eclipse BIRT Chart Engine (Links to an article on how to use it) JFreeChart Which other libraries are there for drawing pretty charts with SWT? Or charts in Java generally? After all, you can always display an image... I have not used BIRT or JGraph, however I use JFreeChart in my SWT application. I have found the best way to use JFreeChart in SWT is by making a composite an AWT frame and using the AWT functionality for JFreeChart. The way to do this is by creating a composite Composite comp = new Composite

Running SWT based, cross-platform jar properly on a Mac

杀马特。学长 韩版系。学妹 提交于 2019-11-27 11:29:30
I have been working on a SWT-based project which is intended to be deployed as Java Web Start, and thus be used on multiple platforms. So far I have managed to tackle the exporting problem that arises due to the system-specific libraries SWT depends on (see relevant thread ). The resultant jar seems to work start fine on 32/64-bit linux and 64-bit windows, however execution fails on a Mac with the following output: $ java -jar dist/test.jar Adding { file:/Volumes/LaCie/ChiBE_Local/swt/swt-cocoa-macosx-x86_64-3.6.1.jar } to the classpath ***WARNING: Display must be created on main thread due to

Packaging Java apps for the Windows/Linux desktop

我与影子孤独终老i 提交于 2019-11-27 10:30:00
I am writing an application in Java for the desktop using the Eclipse SWT library for GUI rendering. I think SWT helps Java get over the biggest hurdle for acceptance on the desktop: namely providing a Java application with a consistent, responsive interface that looks like that belonging to any other app on your desktop. However, I feel that packaging an application is still an issue. OS X natively provides an easy mechanism for wrapping Java apps in native application bundles, but producing an app for Windows/Linux that doesn't require the user to run an ugly batch file or click on a .jar is