swt

Is it possible to get the vertical/horizontal scroll bar visible when the SWT List is in disabled state?

南笙酒味 提交于 2019-12-23 03:46:12
问题 I have a list in a composite and is defined in the following way : List list = new List(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); when the list is in disabled state (list.setEnabled(false);), and the values inside the list are more than the height of the list, is there any way to make the vertical scroll bar enabled? 回答1: The scroll bars are handled by the OS. Consequently, the OS will decide when to show/hide the scroll bars and when to let the user use them. You can't influence

Embed custom widget in SWT Tree or Table

时间秒杀一切 提交于 2019-12-23 03:37:06
问题 Using SWT, Is it possible to create a custom widget and insert it to a Table or Tree as if it was a TreeItem or TableItem ? I tried to create a class and extend TreeItem but I'm getting this warning: MyClass illegally extends TreeItem Is there a way to do this? 回答1: Most SWT widgets are not designed to be extended and enforce this by checking that the current class is in the org.eclipse.swt.widgets package. This can be worked around but is very strongly discouraged. Widgets generally contain

Why is there no text in JFreeChart?

只愿长相守 提交于 2019-12-23 03:02:00
问题 JFreeChart seems to be working, except for all the text. It just doesn't show up at all, and I've no idea why. I attached a picture of a window with a pie graph that I got from a tutorial site. As you can see, the text isn't visible. (sorry my twitter feed was really long) Thanks Edit: Here is the code that generates the above graph: package analyzer_main; import java.awt.Font; public class FloatChart extends Composite implements Screen { JFreeChart floatChart; public FloatChart(Composite

How do you utilize SWT's Hi-DPI support for icons?

£可爱£侵袭症+ 提交于 2019-12-23 01:38:10
问题 According to Eclipse Project Neon - New and Noteworthy, SWT supports auto-scaling for Hi-DPI monitors. Does SWT only support "auto-scaling", or does it provide additional features such as defining different images for various DPIs or zoom levels? If so, what are the classes I need to be looking into? 回答1: SWT's Image has a new constructor that accepts an ImageDataProvider in order to provide image data for different zoom levels. if the application is moved to a monitor with different DPI or

Communicating between classes

不问归期 提交于 2019-12-23 01:14:01
问题 I have a form that is divided into two classes. Each class represents the widgets on part of the form. What is the best way to allow these classes to share data between each other and update each other. Example: Button in class A is clicked. Update text field in class C 回答1: This is very short what you can do: public class ButtonFrame extends JFrame implements ActionListener { private TextFieldFrame frame; public ButtonFrame(TextFieldFrame frame) { this.frame = frame; // init your components

flickering of image in SWT

喜欢而已 提交于 2019-12-23 01:13:42
问题 I am building an SWT application, I have used a ScrolledComposite and a Composite inside that. This has a few more buttons and checkboxes . All this is inside a Composite . Now I tried to put this main composite in the tab. It worked fine but the image flickers a lot even if I don't scroll or resize. If I put this main composite inside a shell, its working perfect without any flicker. Why is this happening? 回答1: Did you set the SWT.DOUBLE_BUFFERED style bit on your Composite? That might fix

Force Eclipse (Helios) to use a newer version of SWT at application runtime

老子叫甜甜 提交于 2019-12-22 12:57:25
问题 I'm developing an RCP project using Eclipse-Helios. The version of SWT that is installed (in the plugins directory) is [org.eclipse.swt-win32-3.6.2, & org.eclipse.swt.jar] I require new API functionality that is only available from swt-3.8. (specifically, I wish to set the custom colours, for an SWT color dialog before opening.) I have downloaded 3.8.1 from the SWT/Eclipse downloads site [ http://download.eclipse.org/eclipse/downloads/drops/R-3.8-201206081200/#SWT ] The SWT download is NOT a

Non resizable window with JFace

喜你入骨 提交于 2019-12-22 12:15:38
问题 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

SWT - Table Viewer - hiding columns and getting values from columns

混江龙づ霸主 提交于 2019-12-22 11:16:58
问题 I am trying to create an arraylist from the data in my table. I need to get the values from the visible columns, but I also need to get values from columns that are not visible in the table. Using SWT with a Table Viewer, I have no idea on how to not display columns in my table. I also have no idea on how to pull the data from the table by specifying column names. I have always used Swing, so I have always used a Table Model Class. In swing it is pretty simple to create the columns, hide them

Deploy Java application on MacOSX (from a Windows system)

无人久伴 提交于 2019-12-22 11:02:25
问题 Here's the deal. I'm just starting with Java programming, I've made a simple application that uses SWT graphic library and I want to deploy it on a Mac (running the latest version of MacOS X). I did all the programming in my Windows 7 machine, so here are my questions: Q1) Can I make an executable file for MacOS X from my Windows machine? How? (I saw that it's possible to create .exe files on Windows, instead of using .jar; I want to do the same for the Mac, of course it won't be an .exe) Q2)