swt

Changing org.eclipse.swt.widgets background color in Windows

醉酒当歌 提交于 2019-12-17 09:55:24
问题 Right now I am trying to change the background color of a org.eclipse.swt.widgets.Button with the following code: Button sceneButton = new Button(border, SWT.TOGGLE | SWT.FLAT); sceneButton.setBackground(Color.RED); This works fine when I run the program in Solaris, but does nothing when I run the code in Windows. Is this possible? If not, is there some kind of workaround that would allow me to change the background color (even if the "color" is an image) while still displaying text in the

Eclipse Bug: Unhandled event loop exception No more handles

狂风中的少年 提交于 2019-12-17 06:28:51
问题 I've built a GUI using Swing and the MigLayout. I am using Eclipse 4.2.2 (64-bit) on Windows 7 Ultimate. Every time I click back into the window to edit my code, a popup comes up, then I'm prompted to restart Eclipse, and the Event log says the following: org.eclipse.swt.SWTError: No more handles at org.eclipse.swt.SWT.error(SWT.java:4387) at org.eclipse.swt.SWT.error(SWT.java:4276) at org.eclipse.swt.SWT.error(SWT.java:4247) at org.eclipse.swt.widgets.Widget.error(Widget.java:468) at org

Possible causes of Java VM EXCEPTION_ACCESS_VIOLATION?

一曲冷凌霜 提交于 2019-12-17 02:31:55
问题 When a Java VM crashes with an EXCEPTION_ACCESS_VIOLATION and produces an hs_err_pidXXX.log file, what does that indicate? The error itself is basically a null pointer exception. Is it always caused by a bug in the JVM, or are there other causes like malfunctioning hardware or software conflicts? Edit: there is a native component, this is an SWT application on win32. 回答1: Most of the times this is a bug in the VM. But it can be caused by any native code (e.g. JNI calls). The hs_err_pidXXX.log

常用UI框架通过Graphics完全自定义组件的方法

痞子三分冷 提交于 2019-12-14 17:49:22
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> flash/flex: 每一个在flash player中的可视化对象都包含flash.display.Graphics类的实例。 基于flex框架,通常override protected function updateDisplayList(w:Number,h:Number):void; awt/swing: 通过继承JComponent类或其子类,有两种方法获取Graphics或者Graphics2D类的实例: 1.从@override void paintComponent(Griphics g),绘制结果是持久的。 2.通过调用JComponent实例的方法getGraphics方法获取,绘制结果非持久的。 swt/jface: 通过继承Composite类或其子类自定义组件。 有两种使用GC对象的方法: 1.使用GC的构造方法来创建GC对象。 GC(Drawable drawable)或者GC(Drawable drawable,int style) 2.通过addPaintListener( new PaintListener(){ public void paintControl(PaintEvent e){ e.gc.drawOval(0,0,80,80); } } ); 来源:

swt browser控件与java交互

房东的猫 提交于 2019-12-14 17:14:32
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1、java调用browser页面里的js [javascript] view plain copy final Browser browser = new Browser(shell, SWT.FILL_WINDING); browser.evaluate("fun()");//fun是一个定义好的js函数 2、js中调用java函数 写一个类继承BrowserFunction类 [java] view plain copy import org.eclipse.swt.browser.Browser; import org.eclipse.swt.browser.BrowserFunction; public class CallJava extends BrowserFunction { public CallJava(Browser browser, String name) { super(browser, name); } @Override public Object function(Object[] arguments) { System.err.println(arguments); return super.function(arguments); } } 将这个类注册为一个回调方法:

TreeViewer selections and the Clipboard

≡放荡痞女 提交于 2019-12-14 03:54:42
问题 Is it possible to place more than one object (which represent TreeViewer selections) into the clipboard? Here's my Cut code. static public void Cut(EssentialData dataInst) { IStructuredSelection selection = (IStructuredSelection)dataInst.getTreeViewer().getSelection(); if(selection == null) { System.err.println("selection received was null"); return; } Object[] objects = selection.toArray(); //because setContents requires a Transfer object for every object sent List<Transfer> typesList = new

How do I fix NullPointerException and putting data into NatTable

和自甴很熟 提交于 2019-12-14 03:35:41
问题 When I try to use this piece of code: students.add(new Student("John","1", 3)); students.add(new Student("Chris","2", 2)); NatTable table = createTable(shell, students); table.refresh(); NullPointerException appears, maybe it is because something is wrong with getters in Student class or maybe in generating the table. Also one of the messages when this problem appears is ReflectiveColumnPropertyAccessor.getDataValue. Also I need to fix ColumnGroup in NatTable to display many exams properly.

Eclipse RCP view not coming on the left side on the screen

筅森魡賤 提交于 2019-12-13 21:09:06
问题 After taking cue from this ques. I ended up here but the problem is, view is coming on right hand side of the screen and not occupying the full space. Here is the current screenshot . and the code is public class MonitorView extends CoreView { public MonitorView(final Composite parent) { super(parent); setDisplayName(I18N("Visual Monitoring of iCommand")); // setLayout(new FillLayout()); final Composite composite=GUIToolkit.newComposite(parent, SWT.FILL, new GridData(SWT.TOP,SWT.LEFT,true

java.lang.NoClassDefFoundError while using SWT Add-on (AutocompleteComboInput)

谁说我不能喝 提交于 2019-12-13 21:01:21
问题 I am trying to implement an autocomplete Combo in SWT using AutocompleteComboInput. I have added net.sf.swtaddons_0.1.1_bin_src.jar to the library via "Add External JAR". import net.sf.swtaddons.autocomplete.combo.AutocompleteComboInput; ... subjectCodeCombo = new Combo(tab3Composite, SWT.DROP_DOWN); // other code modifying Combo appearance here... // returns a String[] of items retrieved from database String[] subjectCodeArray = dbQuery.subjectsToArray(); subjectCodeCombo.setItems

Bulding an multi-platform SWT application using Ant

允我心安 提交于 2019-12-13 20:24:24
问题 I'm writing an SWT application which can be used on Windows (32/64 bit) and Mac OSX (32/64 bit). Apart from the JRE I rely on the SWT library found here. I can find four versions of the SWT library depending upon my target platforms (as mentioned above). When building my application, how can I compile using the correct SWT Jar? If possible, I'd like to try and avoid hard-coding the Jar version, platform and architecture. The SWT Jars are named like this: swt-win32-x86_64.jar swt-win32-x86_32