swt

Eclipse - Cannot load 32-bit SWT libraries on 64-bit JVM

眉间皱痕 提交于 2019-12-11 18:13:17
问题 I'm trying to run a java project called To-Do-O (source - http://www.ohloh.net/p/to-do-o/enlistments) After I loaded the projects into Eclipse and run the main.java, it returns the following error: Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM I tried adding -d32 as many of the solution suggests [see iamge], but it returns another message Error: This java instance does not support a 32-bti JVM. Please install the desired version.

Java SWT added Label not visible

允我心安 提交于 2019-12-11 18:04:36
问题 I'm new to SWT and currently struggling to make a Label instance visible. At the moment, I need to resize the window manually to make it appear. I found a similar question on SO that mentions the cache of SWT. So I tried the suggested call of shell.layout(); but it does not work for me. Here is my code: public class SimpleTextEditorCount { private Display display = new Display(); private Shell shell = new Shell(this.display); private StyledText styledText; private boolean unsaved; private

Learning Threads - Running a method only after the other has finished

社会主义新天地 提交于 2019-12-11 17:33:25
问题 In my button execution, I am calling 2 methods. plotButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { startPrinterListOperation(); showAplotPlotterDialog(); } }); The startPrinterListOperation(); takes some time to complete its task. But I do not want the method showAplotPlotterDialog(); to run until the first one has completed. So I am trying to use thread management to achieve this. Here is what I have tried. plotButton.addSelectionListener

Jogl: How to make a transparent background on com.jogamp.opengl.swt.GLCanvas?

℡╲_俬逩灬. 提交于 2019-12-11 16:51:56
问题 I searched & read multiple forums about openGL transparency and I found this piece of code gl.glEnable(GL2.GL_BLEND); gl.glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA); gl.glEnable(GL2.GL_ALPHA_TEST); gl.glAlphaFunc(GL2.GL_GREATER, 0.1f); gl.glClearColor(0, 0, 0, 0); Some people wrote this code inside the init method and got result. I really don't know anymore about Blending, but I added this code and nothing happened! Is there any mistake or misunderstanding here!? How can I do

Fire event after expand/collapse tree

筅森魡賤 提交于 2019-12-11 15:33:47
问题 I need to fire event resize after collapse and expand. When I try to do that using SWT.Collapse and SWT.Expand, there is no changes on tree because its fire before its happen. Is there any way to this? 回答1: Try calling Display.asyncExec to schedule a Runnable in the SWT.Collapse/Expand listener. The Runnable will not run until the current Tree operation is complete. 来源: https://stackoverflow.com/questions/18868107/fire-event-after-expand-collapse-tree

SWT: Integrate clickable link into StyledText

落爺英雄遲暮 提交于 2019-12-11 15:19:08
问题 With the help of this question I was able to figure out how I can display a link inside a StyledText widget in SwT. The color is correct and even the cursor changes shape when hovering over the link. So far so good, but the link is not actually clickable. Although the cursor changes its shape, nothing happens if clicking on the link. Therefore I am asking how I can make clicking the link to actually open it in the browser. I thought of using a MouseListener , tracking the click-location back

No Scroll on View in Eclipse RCP

☆樱花仙子☆ 提交于 2019-12-11 15:05:58
问题 I am supposed to create a scroll bar in my Eclipse RCP view and I referred to the ScrolledComposite javadoc and taking help from this. private void createComposite2(final Composite parent,final String text, int compositeNumber) { final ScrolledComposite rightScrolled = new ScrolledComposite(parent, SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER); group=GUIToolkit.newGroup(rightScrolled, SWT.NONE, text, null); rightScrolled.setContent(group); group.setLayout(new FillLayout()); rightScrolled

How to disable or enable a MMenu (not MMenuItem) in an Eclipse E4 application

ぐ巨炮叔叔 提交于 2019-12-11 14:46:58
问题 I have an Eclipse E4 application with a MMenu (in the main menu of the application and in popup menus of different parts) that contains items provided at runtime by a dynamic menu contribution. What I want to achieve is to disable the menu element, if the menu contribution does not provide any item. Something like @CanExecute for handler classes for commands or direct menu items. 回答1: Do you use the latest version of eclipse and you have an Application.e4xmi file? If so, for your "Dynamic

When centering dialog, first appears on topleft corner for some milliseconds

和自甴很熟 提交于 2019-12-11 14:30:13
问题 I'm generating a dialog with a lot of content. I want to pack the dialog to the childrens height, and I want to center it on screen, so I'm doing this after adding all the childrens: shell.open(); shell.layout(); shell.pack(); //for wrap the dialog size to it's content width and height. //the dialog must be centered after doing shell.pack(); Rectangle parentSize = getParent().getBounds(); Rectangle shellSize = shell.getBounds(); int x = parentSize.x + (parentSize.width - shellSize.width) / 2;

Find browser type/version of SWT Browser

杀马特。学长 韩版系。学妹 提交于 2019-12-11 14:28:53
问题 I am having problems with an Eclipse SWT Browser not loading certain styles on one machine. I am expecting the machine to use IE 10 as the native browser but I am not sure how I can confirm this. Is there a way to determine the type/version of the Browser which SWT decides to load the page using? 回答1: Based on the accepted answer to this question: How can you detect the version of a browser? you can do something like this: public static void main(String[] args) { final Display display = new