currently i'm developing my UIs with SWT / JFace. I like some of the widgets of JFace like ComboViewer, ListViewer, they help me a lot to populate data, filter data and update data to the lists and combo boxes.
But in lack of some additons (like a "nicer" autocomplete, or using a L&F, not platform independed without serving a lot of librarys or building a HUGE all in one Jar) i would like to use Swing.
Is it possible to use there widgets in Swing? And do you think I have any advantages using swt / jface? (I'm not developing eclipse addons, just for daily use)
Related
I have a rather large Java application that uses Swing extensively. The look-and-feel used by the application is Metal and we have a custom theme that lightens some of the colours. I'm building a new component within this application (it's a large project that will deploy in a few years) and would like to use JavaFX for all the GUI parts (several reasons, including being a little more future proof, better APIs, and new widgets I would like to use). However, I don't want to upset the common look-and-feel of the application.
Is there any way (aside from writing lots and lots of my own CSS) to make all the JavaFX components look like the Swing components?
To get a Swing Metal look in JavaFX, start writing lots and lots of your own JavaFX CSS. I know it's not the answer you want, but it is the answer that is.
You could put put the JavaFX components that you need inside the Swing Components. For example, you could put a JavaFX ImageView inside a Swing panel. That way, you get the Swing look (and compatibility) on the outside but the JavaFX functionality on the inside.
I found this tutorial helpful:
https://docs.oracle.com/javase/8/javafx/interoperability-tutorial/swing-fx-interoperability.htm
But other than that, I don't think JavaFX has a look and feel identical to metal.
I have created a simple interface using the Eclipse WindowBuilder plugin. My goal is to load blender models using jMonkeyEngine (jME3). I believe that jME3 only supports swing and AWT, while WindowBuilder mainly uses SWT.
Currently I have a window with a TabFolder. On the current tab (displayed below) is a composite (which allows me to freely place SWT components, like the button). I would like to have my model somehow displayed in the area specified below.
I am fairly new to jME3 and WindowBuilder, so I would appreciate a thorough response or some resources to help me with this.
Is possible use JTree in Eclipse plugin development instead of standard JFace tree?
I'm developing it in Kepler, wan't work with custom icons etc. like in JTree.
You can use JTree and other Swing controls using SWT_AWT bridge. However, this is far from trivial, as Swing will have its own event loop, you'll have to figure out which UI thread different code should run on, translate between different types of events (e.g. when resizing) etc. Generally it's better to figure out how to achieve your purposes in the SWT/JFace/RCP way.
I know that JavaFX 2.2 provides FXCanvas for embedding new JavaFX components into existing SWT Composites. Is it possible to do it the other way around?
My motivation for trying this, is that there are currently some components missing in JavaFX. For example a TreeTable. I want to implement my application in JavaFX, use SWT as a fallback for missing components, and migrate those to JavaFX as soon they are ready.
no - you can not embedd heavy weight (=SWT) into a lightweight container (=FX) - JavaFX will get a TreeTable in FX8
How do I extend a simple InputDialog in an eclipse plugin to put additional checkboxes, radio buttons, etc?
You need to create your own dialog box. You do that by using SWT, the Eclipse UI framework. If you are a good Java coder, the best thing you can (IMHO) do is look at the SWT code snippets.
Another option, perhaps better one, is using JFace. It is a framework built on top of SWT. JFace makes it easier to build the UI and it works with SWT without hiding it. You can find many code examples of doing dialog boxes with JFace here.