swt

SWT standalone scrollbar widget

放肆的年华 提交于 2019-12-21 20:35:10
问题 Is there a way to create a "standalone" scrollbar in SWT? I would like to have a scrollbar which I have full control over myself and use it to control the contents of another widget in a way which isn't possible with the "built-in" scrollbars in the Table widget, for example. 回答1: I agree that you probably can't get a scrollbar alone, but I've worked around that with using a Canvas ( or ScrolledComposite ) and then set the content of that composite to exactly the same size as the

Combining Aero Glass effects and SWT

廉价感情. 提交于 2019-12-21 14:01:50
问题 As a pet project, I've been playing with the concept of integrating Aero Glass effects into my SWT application. Łukasz Milewski has an excellent blog post explaining how this can be accomplished, which pretty much boils down to this: final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FormLayout()); final MARGINS margins = new MARGINS(); margins.cyTopHeight = -1; final Composite c = new Composite(shell, SWT.NORMAL); c.setBackground(new Color

Looking for a Combo(Viewer) in SWT/JFace which supports autocomplete

拥有回忆 提交于 2019-12-21 07:48:06
问题 I'm looking for a Combo(Viewer) in SWT/JFace which supports autocomplete / type-ahead, i.e. the user can enter a couple of characters and the drop down list should show all matching elements. 回答1: You can also check out the org.eclipse.jface.fieldassist.AutoCompleteField class. It's not a combo, just a text field, but it adds auto complete functionality as if it were a combo very easily. You can do something as simple as this: Text textField = new Text(parentComposite, SWT.BORDER); new

XULRunner error in Eclipse / SWT

不打扰是莪最后的温柔 提交于 2019-12-21 06:50:58
问题 I'm trying to run the Enhanced JavaScript Bridge example found here. I created a new project, and added a reference to SWT via: Project(right-click)-->Properties-->Libraries-->Add Variable-->Configure Variable-->New However I cannot get this project to run. The error I get depends on what SWT library I'm referencing: org.eclipse.swt.win32.win32.x86_64_3.103.2.v20150203-1351.jar : Error is Could not instantiate Browser: org.eclipse.swt.internal.mozilla.init.XPCOMInit.GREVersionRange_sizeof()I

Exporting jar with VM arguments

ぐ巨炮叔叔 提交于 2019-12-21 06:02:00
问题 I've written a Java application with Eclipse that uses SWT for the UI. (see SWT Exception when running jar: Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access for detail). I exported as JAR and was having trouble getting it to run from Finder as well as from Terminal. I finally got it to run from Terminal with java -XstartOnFirstThread -jar CommonDenom.jar I still, however, cannot get it to run when I export as a JAR from eclipse. This is because it needs the

Java SWT application - Bring To Front

試著忘記壹切 提交于 2019-12-21 04:24:25
问题 I am currently developing an SWT java application on Windows 7. Usually the application will be minimized, and when there is an event on the serial port the application should maximizes itself. The following code does the maximization part. private void bringToFront(final Shell shell) { shell.getDisplay().asyncExec(new Runnable() { public void run() { if(!shell.getMaximized()){ shell.setMaximized(true); } shell.forceActive(); } }); } But sometimes the SWT application is maximized behind

Java SWT application - Bring To Front

不羁的心 提交于 2019-12-21 04:24:15
问题 I am currently developing an SWT java application on Windows 7. Usually the application will be minimized, and when there is an event on the serial port the application should maximizes itself. The following code does the maximization part. private void bringToFront(final Shell shell) { shell.getDisplay().asyncExec(new Runnable() { public void run() { if(!shell.getMaximized()){ shell.setMaximized(true); } shell.forceActive(); } }); } But sometimes the SWT application is maximized behind

Find composite location on screen

狂风中的少年 提交于 2019-12-20 12:54:13
问题 I am implementing a on screen keyboard in Java for SWT and AWT. One important thing is to move the keyboard to a position where the selected text field can show and is not lying behind the on screen keyboard. For AWT i can detect the position of the current selected component with Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (owner == null) { return; } Point ownerLocation = owner.getLocationOnScreen(); Dimension ownerSize = owner.getSize(); How

Future of GUI development in Java? [closed]

落爺英雄遲暮 提交于 2019-12-20 10:34:25
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago . Considering that Sun/Oracle decided to not develop Swing any further after they "invented" JavaFX JavaFX doesn't really work and some

在Eclipse中用SWT设计界面

雨燕双飞 提交于 2019-12-20 10:19:46
摘自 http://www.tulaoshi.com/n/20160129/1488574.html 在Eclipse中用SWT设计界面 1. 为什么要使用SWT?   SWT是一个IBM开发的跨平台GUI开发工具包。至于为什么IBM要费劲自己另起炉灶开发一个GUI工具包,而不是使用Sun现有的由AWT, Swing, Java 2D, Java 3D等构成的Java GUI框架,那就说来话长了。(记得在一个BBS上读过一个关于SWT起源的调侃类的帖子)。   在SWT之前,Sun已经提供了一个跨平台GUI开发工具包AWT (Abstract Windowing Toolkit)。虽然AWT框架也使用的是原生窗口部件(native widgets),但是它一直未能突破LCD问题。LCD问题导致了一些主要平台特征的遗失。如果你不明白的话(其实我也没明白),换句话说,如果平台A有窗口部件(widgets)1–40,而平台B有窗口部件(widgets)20–25,那么跨平台的AWT框架只能提供这两个窗口部件集的交集。   为解决这个问题,Sun又创建了一个新的框架。这个框架不再使用原生窗口部件,而是使用仿真窗口部件(emulated widgets)。这个方法虽然解决了LCD问题,并且提供了丰富的窗口部件集,但是它也带来了新的问题。例如