swt

What is the purpose of Layout in SWT applications?

。_饼干妹妹 提交于 2019-12-02 12:29:51
What is the usage of the Layout in SWT application, since, we can omit it in our applications. What is the benefit of having it? Automatic layout requires less of your time than manual/absolute layout. First, it's less effort overall to specify a layout with desired properties than an absolute layout. You can quickly add, move or remove items in an automatic layout, without tweaking the absolute positions of all other items. Next, these factors sometimes make automatic layout necessary: Localization: Translated labels can be longer or shorter, requiring layout adjustments. Resizing dialogs and

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

跟風遠走 提交于 2019-12-02 11:32:48
问题 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:/

How to display a hint message in an SWT StyledText

微笑、不失礼 提交于 2019-12-02 10:05:31
SWT Text has a method called setMessage() which can be used to display a message as a hint for the user, indicating the purpose of the field. It seems that StyledText does not have a setMessage() method. Can something similar be done with StyledText nonetheless? Recently, I had the need to display a hint within a StyledText. Thus I share my solution here. The setMessage() method of the StyledTextMessage shown below can be used to display a hint on a StyledText widget. The class adds a paint listener to draw the message text and several listeners and display filters to redraw the message

error at building libjingle on Mac OS X 10.7.2 like “error: string.h: No such file or directory”

谁说胖子不能爱 提交于 2019-12-02 09:41:52
I failed to build libjingle on Mac OS X 10.7.2. The output was the following when I run $path_to_swtoolkit/hammer.sh according to the README of libjingle. MBP17:talk rei25$ ~/Desktop/swtoolkit/hammer.sh scons: Reading SConscript files ... scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead. File "/Users/rei25/Desktop/swtoolkit/site_scons/site_init.py", line 203, in BuildEnvironmentSConscripts scons: done reading SConscript files. scons: Building targets ... ________Compiling build/dbg/obj/third_party/expat-2.0.1/lib/xmlparse.o third_party/expat-2.0.1

OS X Java .app bundle cannot open other apps?

点点圈 提交于 2019-12-02 09:18:35
I've written a Java SWT application for OS X, exported it as a .jar and bundled it into .app. Everything works just as expected except for a critical part within my app; it requires to open other apps. I've tried Runtime.exec(); as well as ProcessBuilder to do this, calling the open command on the other apps that I require to launch. This works perfectly fine from Eclipse or if I launch my exported .jar through Terminal. It does, however, not work when started by double-clicking the .app. I'm wondering if this is an error on my part, or a restriction by either Java or OS X. Because Mac apps

DJ Native Swing Browser in Java Swing For mac

允我心安 提交于 2019-12-02 08:03: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

JFreeChart: Add and sync a srollbar when zooming a chart (Eclipse plugin / SWT)

拟墨画扇 提交于 2019-12-02 07:28:09
I am using JFreeChart library to plot something in an Eclipse view and currently my code for view initialization looks as follows: @Override public void createPartControl(Composite parent) { JFreeChart chart = null; // Created via different object chart = graph.createLineChart("Test Graph", "x", "y"); ChartComposite frame = new ChartComposite(parent, SWT.NONE, chart, true); frame.setRangeZoomable(false); parent.layout(true); } I wanted to add scrolling to my graph when the user zooms in, but so far all the examples that I found (in the demo package, here , and other sources) are based on Swing

Setting size of inner region of Java SWT shell window

你。 提交于 2019-12-02 06:08:12
问题 In a Java SWT shell window, how do I set its inner size than its whole window frame size? For instance, if I use shell.setSize(300, 250) this would make the whole window appearing as exactly 300x250. This 300x250 includes the size of the window frame. How can I set the inner size, that is the content display region of the shell window to 300x250 instead? That's this 300x250 excludes the width of the window frame. I tried to minus some offset values but the thing is different Operating Systems

java button pressed for 3 seconds

六眼飞鱼酱① 提交于 2019-12-02 05:48:52
问题 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

How to load image to view in RCP?

≡放荡痞女 提交于 2019-12-02 05:45:36
I am developing an RCP plugin project that includes certain views.First view take employee details like name , address etc.There is an option to upload employee image using browse button.Second view shows the details that have entered in the first view.All details except photo is displaying fine. It shows a red square in the place of photo label. My code for setting photo is shown like this : Label photoLabel = new Label(parent, SWT.NONE); photoLabel.setBounds(420, 233, 100, 106); photoLabel.setImage(SWTResourceManager.getImage(FormDataViewClass.class,photoUploadPath)); where photoUploadPath