swt

Problems With SWT on Mac

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 05:32:53
问题 I've got a java project that uses an SWT UI and I'm having trouble deploying it on any Mac OS X computers. The program itself works perfectly on Windows when it is either run from within Eclipse or from a jar file. On Mac, the program also works fine in Eclipse, but when I try to run it from a jar file, I get the following error: 2010-04-30 13:33:04.564 java[17825:41b] *** _NSAutoreleaseNoPool(): Object 0x10b9b0 of class NSCFString autoreleased with no pool in place - just leaking Stack:

Toggle Button in Eclipse Forms Section Toolbar

最后都变了- 提交于 2019-12-02 04:43:11
问题 How do I implement a toggle button, as pictured below, in the section toolbar of Eclipse UI Forms? I only find examples for adding actions to the section toolbar. 回答1: I think the key is: IAction.AS_CHECK_BOX toggleBotton = new Action(Messages.toolTipMessage, IAction.AS_CHECK_BOX) { @Override public void run() { } }; toggleBotton.setImageDescriptor(...); toggleBotton.setEnabled(...); getManagedForm().getForm().getToolBarManager().add(toggleBotton); 来源: https://stackoverflow.com/questions

How to update the list of items in the SWT Combo box?

只谈情不闲聊 提交于 2019-12-02 04:38:25
问题 I have a UI with a Combo box. The list of items, which can be chosen, has to be refreshed every time the combo is about to open the list. Is there any way - i.e. to add a listener which will inform UI that Combo is about to open? Unfortunately I am not able to observe model to update the list when it changes. 回答1: Unfortunatelly there is no such method for SWT Components. In Swing it would be easy with the help of the PopupMenuListener Interface. A workaround I can think of would be to

how to add close button with swt.TabItem?

一个人想着一个人 提交于 2019-12-02 04:33:26
问题 TabFolder tabFolder = new TabFolder(composite, SWT.CLOSE); TabItem tab1 = new TabItem(tabFolder, SWT.CLOSE); tab1.setText("Tab 1"); TabItem tab2 = new TabItem(tabFolder, SWT.CLOSE); tab2.setText("Tab 2"); I have an swt.TabFolder and there are some swt.TabItems on it. i want to have a close button with those TabItems so i may close the tabs i want on runtime. and i dont want to use CTabFolder or CTabItem can someone tell me what can i do for this purpose? public DomainUI(Composite composite,

Display numbers on a tray icon with SWT

两盒软妹~` 提交于 2019-12-02 04:06:47
问题 I would like to show some numbers on my tray icon indicating a number of events that happened to the user like what is done in this facebook notifications icons: Do you think that it is possible ? Thank you 回答1: You can do this using the TaskBar and TaskItem classes although it may not work on all platforms. TaskBar taskBar = Display.getDefault().getSystemTaskBar(); // TODO may return null if not supported on the platform // Get application item TaskItem taskItem = taskBar.getItem(null); if

DJ Native Swing Browser in Java Swing For mac

断了今生、忘了曾经 提交于 2019-12-02 03:46:05
I have a Java application made with Swing and I have used one DJ Native Swing Browser. When I tried to use that on OS X its throwing a NoClassDefFoundError all the time even though I have added swt.jar. Can some one please tell me what I am doing wrong ? this is my stack trace. Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/eclipse/swt/SWT at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.initialize_(SWTNativeInterface.java:213) at chrriis.dj.nativeswing.swtimpl.NativeInterface.initialize(NativeInterface.java:71) at chrriis.dj.nativeswing.swtimpl.core

java button pressed for 3 seconds

天涯浪子 提交于 2019-12-02 03:36:42
I created a button and I want these: When the user clicks the button, it stays pressed like 3 seconds. After 3 seconds the button should be again look pressable. So the user cannot click the button again without waiting 3 secs. I tried these: { button3 = new Button(c20, SWT.PUSH | SWT.CENTER); button3.setText("QUERY"); button3.setBounds(205, 131, 62, 40); button3.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent event) { try { start_query(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } setPressedIcon();///?? public

ArrayIndexOutOfBoundsException in com.ibm.icu.text.BreakDictionary.main in SWT Application

可紊 提交于 2019-12-02 03:03:27
I am getting Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at com.ibm.icu.text.BreakDictionary.main(BreakDictionary.java:40) When I run/debug my SWT program in Eclipse. What might be causing this? When I put a breakpoint on the 1st line of my main() , it doesn't even seem to run till that point. UPDATE Even in a new SWT project, with a Application Window created from the template, without any changes, the error still occurs ... If you want to see the code, http://pastie.org/3547493 (its whats generated from Eclipse with Google Window Builder Pro plugin) You are running

Problems With SWT on Mac

江枫思渺然 提交于 2019-12-02 02:08:34
I've got a java project that uses an SWT UI and I'm having trouble deploying it on any Mac OS X computers. The program itself works perfectly on Windows when it is either run from within Eclipse or from a jar file. On Mac, the program also works fine in Eclipse, but when I try to run it from a jar file, I get the following error: 2010-04-30 13:33:04.564 java[17825:41b] *** _NSAutoreleaseNoPool(): Object 0x10b9b0 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x944acf4f 0x943b9432 0x678fb79 0x35a19b1 0x359ba7f) 2010-04-30 13:33:04.566 java[17825:41b] ***

JFace DialogCellEditor: how to make buttons always appear?

本秂侑毒 提交于 2019-12-02 02:05:44
I use JFace DialogCellEditor to show a button in a cell of a row of my JFace TableViewer which triggers a dialog when activated. This behaviour works well with the following code but the button only appears when the cell of the table hosting the button is explicitly selected. public class CompareDialogCellEditor extends DialogCellEditor { public CompareDialogCellEditor(Composite parent) { super(parent); } @Override protected Button createButton(Composite parent) { Button button = super.createButton(parent); button.setText(""); button.setImage(AbstractUIPlugin.imageDescriptorFromPlugin