swt

SWT - Table / Combo box

做~自己de王妃 提交于 2019-12-06 13:36:57
How can I add a combo box to a specific column in my table? I would like for my last column to have a combo box with 3 selections (Yes, No, Both). I will include my table code, so you can better show me how and were the new code would go. ////////////////////////////////////////////////////////////////////////// // createTableViewer() // ////////////////////////////////////////////////////////////////////////// private TableViewer createTableViewer(Composite parent) { viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER); createColumns

Print using SWT Browser Widget

回眸只為那壹抹淺笑 提交于 2019-12-06 13:17:31
问题 I want to print the contents of a SWT Browser Widget. but it prints the only the visible part of the browser not the full content of it. Please help. 回答1: I've modified the SWT Browser snippet to selected code, and it work for me like a charm.. import org.eclipse.swt.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; import org.eclipse.swt.browser.*; public class BrowserPrintTest { public static void main(String [] args) { Display display = new Display(); final Shell shell

How can i have a disabled Text that is scrollable?

北战南征 提交于 2019-12-06 12:19:39
My Text is declared as, Text text= new Text(parent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.WRAP); It should be disabled in some cases. But when I do text.setEnabled(false); the text's scroll bar gets disabled too and i am not able to see the value in the Text completely. My Text Field cannot be READ ONLY. It should be editable in some cases. I am aware of setEditable() method in Text, but I would like to have the same behaviour as when the Text is disabled i.e, background color change, no blinking cursor(caret), unable to do mouse clicks and the text being not selectable etc. I was able

Supporting SWT on Windows/Mac & 32bit/64bit

核能气质少年 提交于 2019-12-06 11:27:52
I'm currently working with the DJProject to put a browser into my Java Swing application. DJProject uses SWT to run and I have very little experience with SWT. I want to support Windows and Mac both 32bit and 64bit. I understand there is a swt.jar file for each of these platforms. I have all 4 swt.jar libraries added to my classpath as a library to the main application. My problem is when I try running the application on a Mac for example I get the error: Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM how would I go about to

Custom widget shapes in SWT

僤鯓⒐⒋嵵緔 提交于 2019-12-06 11:15:43
I'm trying to work out how to make SWT widgets (e.g. Label, Frame) be some shape other than rectangular. I've made a custom shaped main window using the setRegion() method. Now I would like the widgets in the window to follow the same shape. I've tried using the setRegion() method on the widgets themselves (they inherit it) but nothing happens. How do I make an SWT widget have a custom shape? I've managed to work it out. It seems my difficulty was arising from a misunderstanding of how to define a custom region. The setBounds() method defines the coordinate system for the custom region. I was

How to add a row to a table using swt

人走茶凉 提交于 2019-12-06 11:10:45
I am learning swing and have one doubt regarding insertion of row to a table. My requirement is such that I have to add a new row by pressing a add button. But I am not able to proceed. please find the code below: If some one know please help me.... {public class TableShellExample { Display d; Shell s; TableViewer tableViewer; CellEditor cellEditor; TableShellExample(){ d = new Display(); s = new Shell(); s.setSize(250,250); s.setText("Table Shell Example"); GridLayout g1 = new GridLayout(); g1.numColumns = 3; s.setLayout(g1); final Table table = new Table(s,SWT.BORDER |SWT.CHECK|SWT.MULTI |

no swt-mozilla-gtk-4332 in java.library.path

亡梦爱人 提交于 2019-12-06 11:01:55
(See update at bottom for new information.) I have a Java SWT application that includes an integrated browser. Everything works fine on Windows and on CENTOS 6.5. I was asked to get the application to work on a new computer to which I installed CENTOS 7. I keep receiving the no swt-mozilla-gtk-4332 in java.library.path error message. I am aware of the various pages that talk on this issue. For instance: StackOverflow 10165693 , 6518568 , 7130980 Jazz.net , Eclipse.org I am using Firefox 24.8.0. That came with CENTOS 7. I just updated all the software too. The references indicated that I should

Non resizable window with JFace

荒凉一梦 提交于 2019-12-06 09:30:02
I how it's possible to setup non resizable window with JFace API. Consider code below that creates application window. I can't find any methods to setup window as not resizable on shell object or application window parent. Is there something I'm missing? public class Application extends ApplicationWindow { public Application() { super(null); } protected Control createContents(Composite parent) { prepareShell(); return parent; } protected void prepareShell() { Shell shell = getShell(); shell.setSize(450, 300); } public static void main(String[] args) { Application app = new Application(); app

How to make child Tree Items checked/un-checked if parent Tree was made checked/un-checked

不问归期 提交于 2019-12-06 09:27:29
I'm having a Check-box Tree View structure, consisting of parent and child nodes. I want to make all the child nodes [of the parent node] appear as checked if parent Tree is checked. Similarly, if parent Tree is unchecked then its childrens should be unchecked. The best way to achieve this would be using the JFace CheckboxTreeViewer as it has the following predefined methods to simplify the task. setSubtreeChecked - Sets the child elements checked on selecting the parent node getCheckedElements - Gets all the checked tree elements final CheckboxTreeViewer treeViewer = new CheckboxTreeViewer

SWT.WebKit doesn't load: No More Handles - [Safari must be installed to use a SWT.WEBKIT-style Browser]

耗尽温柔 提交于 2019-12-06 09:17:18
问题 I'm having trouble using SWT.WEBKIT as the Browser for a SWT-Based Java app, and I am now getting this stacktrace upon starting the application on a new machine: Exception in thread "main" org.eclipse.swt.SWTError: No more handles [Safari mus t be installed to use a SWT.WEBKIT-style Browser] at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.browser.WebKit.create(Unknown Source) at org.eclipse.swt.browser.Browser.<init>(Unknown Source) [...] Now, I did follow all the steps from