swt

Synchronizing “Frontend” and “Backend” in Java (and SWT)

↘锁芯ラ 提交于 2019-12-13 20:14:39
问题 Edit: So the code is actually working fine - all objects are modified as they should be. It's only the surface that seems to have issues updating itself while the method is still running... I'm working on a project atm which is basically about solving a Sokoban-riddle. Now, we've implemented both the GUI and the algorithm stuff to solve the riddle, but the connection seems to be tricky. For example, in the GUI I choose "solve" and the algorithm solves the riddle (visible in the console), but

Export composite to image independent of the screen resolution

孤街醉人 提交于 2019-12-13 20:13:57
问题 Is there a way in SWT to export a composite to an image which always has the same size/resolution? The problem is that we have a Dashboard which looks always different when opening on screens with different display size/resolution. The question is now can I export the Dashboard to an image wich has a fixed size and always looks the same no matter on which screen size/resolution it has been created? For the time being we do it like that but as said it depends on the display it has been created

Jface dialog with ScrolledComposite

╄→尐↘猪︶ㄣ 提交于 2019-12-13 18:35:55
问题 I am trying to display scrollable composite in my dialog window. But it do not get the scrollbars. I also don't get the "OK" "Cancel" buttons. How to fix it? public class MyDialog extends Dialog { public MyDialog (Shell parentShell) { super(parentShell); } protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText("test"); newShell.setSize(200, 100); } protected Control createDialogArea(Composite parent) { ScrolledComposite sc = new ScrolledComposite

Java JWebbrowser DocumentCompleted Event

我的未来我决定 提交于 2019-12-13 18:24:31
问题 I am working on chrriis.dj.nativeswing.swtimpl.components.JWebBrowser, I tried demo and everything looks fine but I was unable to find any event to detect documentcomplete 回答1: There were no answers to original question for long time, so i am reporting my findings on the problem, if someone else may like to use. As far I found there is no DocumentCompleted Event But I have achieved similar results by adding listeners using webBrowser.addWebBrowserListener(new WebBrowserListener() { public

How to import a SSL certificate file with SWT Browser

血红的双手。 提交于 2019-12-13 17:35:43
问题 With SWT Browser, is there any way to import a SSL certificate file into Java and make it work with SWT Browser? With Firefox, you can import it by Edit-Preferences-Advanced-Encryption-View Certificates-Import command, but since Mozilla doesn't share profile with each other, we are not able to reuse that. Is there any way? Any advices? Thanks in advance! 回答1: SWT Browser is just a component to display web pages using one of the engines. There is no extra-compatibility. Certificates are

ProgressBar using Threads in SWT

馋奶兔 提交于 2019-12-13 17:31:09
问题 In my SWT Application i wish to use a progress bar (org.eclipse.swt.widgets.ProgressBar) i found examples but could not understand the proper flow and usage i need to perform background task for which, i was paused at the algorithm phase like i can analyze that there should be two threads one for background job, another for a progressbar both should execute simultaneously, i could not figure out the Implementation of this,i found plenty of examples but,i was puzzled where should i place my

Menu doesn't show up with SWT on Mac OS X

被刻印的时光 ゝ 提交于 2019-12-13 17:27:36
问题 For some reason, the menu doesn't show up at all when I run my simple SWT application on OS X. This problem doesn't happen with other SWT applications that I've written, and I'm not sure what I'm doing differently. When I run my program, the menu I see at the top of the screen belongs to Eclipse, which happens to be the IDE I'm using. Also, while the Eclipse menu is visible, it is not clickable or responsive in any way. Here's what the menu looks like now (to avoid confusion as to what I

SWT/Swing -> Threads n' Hell

杀马特。学长 韩版系。学妹 提交于 2019-12-13 17:09:52
问题 I have an SWT application. I was frustrated at SWT for not making it easy to do what I wanted to do. So I used Swing. Swing made my life easy. Yay. Except now, the two have to talk. The issue is, they are running on different threads, and whenever I try to run an SWT GUI method from Swing, I get: Exception in thread "AWT-EventQueue-0" org.eclipse.swt.SWTException: Invalid thread access Oh joy. So, how do I fix this? If this was Objective-C, I could use: - (void)performSelector:(SEL)aSelector

How to track mouse over SWT composite made from sub controls?

孤人 提交于 2019-12-13 13:15:12
问题 I have a created my own control: I want to track the mouse and added a MouseTrackListener . Unfortunately MouseEnter and MouseLeave events are also generated, when the mouse moves over the parts of my composite (that is the label and the button). [Mouse enter] - mouse enters the empty space [Mouse hover] - mouse is over the empty space [Mouse exit] - mouse moved over label [Mouse enter] - mouse leaves label and enters empty space [Mouse hover] - mouse over empty space [Mouse exit] - mouse

Opening HTML files in SWT browser from .jar with hyperlinks working

落爺英雄遲暮 提交于 2019-12-13 07:45:17
问题 I have a set of help files for my SWT application that I have open in-application using the Browser control. Navigation through the help files is done through hyperlinks of relative pathnames (i.e: <a href="aboutUs.htm"> , so only one html file is actually opened by java code, helpHome.htm. I am opening this using String homeURL = this.getClass().getResource("/help/helpHome.htm").toString(); and browser.setURL(homeURL); This works beautifully when I'm just debugging it in Eclipse.