I started implementing a solution for myself to manage user/application preferences, but then thought to myself there has to be a solution out there already. I started looking and found the JFace API. I got excited, but then noticed it is designed to work with SWT. My application is written using Swing. I tried looking for a similar solution for Swing, but have not had any luck.
I'm looking for the equivalent of JFace for Swing (if that exists).
Is there a solution out there for managing preferences like JFace in Swing?
I looked for a while, but was unable to find a preference manager similar to the JFace implementation. So, I ended up creating my own library that originally partially implemented interfaces in the JFace preferences library, but since has deviated.
The library is called jpreferences and is hosted on Github.
EDIT:
Go figure, when I tried creating a SourceForge project named jpreferences there was a project already by that name. If only I had thought to search for jpreferences instead of preference manager. Oh well, now anyone looking for what I was looking for has more choices.
You would find here the two main "PreferenceDialog" implementation for big open-source projects.
One of them is much more complete... and is the org.eclipse.jface.preference.PreferenceDialog class, in SWT.
I don't know of a similar implementation in Swing, but should I develop one, I would consider using XWT as a more declarative approach to build it, since XWT isn't linked to eclipse (e4), and you can use it with Swing.
Related
I am new to programming,
Can anyone suggest how to construct/edit the user interface in Java GWT with ui binder. A GUI editor/designer should be handy but unfortunately I couldn't find one
I am working on an existing project that uses Java and GWT with ui binder with the ui.xml files.
Eclipse Luna as the ide(python in the backend that's another story)
Searched across the internet to find that there is a GWT designer tool but that is discontinued on latest GWT. Rest all other tutorials says to add/edit the .java and .ui.xml codes which is a tired process as my project has got plenty of sheets.
Thanks in adavnce
Just do it by hand.
No editor exists anymore. The old editor you found is dead.
I guess because it was not good enough.
Never used it, programming should be done by hand.
This is more like a work around(as I wouldn't consider this an actual fix/answer)
Here is what I did
Loaded my Project onto Eclipse Kepler with GWT 2.6.1(this version has the fixed designer tool)
Voila, it works like a charm and now I can easily edit/modify the UI.
I know its a dead end if I can't move with an updated version, but its okay for now.
Hope I find an alternate.
Many thanks for the suggestions and answers.
I'm a .net developer and I am studying Swing for Java and I have a question.
Is there any way to build the form controls by dragging and drop like a simple .net windows application project or WPF project?
I am using eclipse and it seems that everybody works with controls by adding positioning and width, height by code, I find that a pain in the a**.
Yes! Take a look at Window Builder for Eclipse (install it from the update site). Netbeans has also a built-in editor, if you prefer that IDE.
You need to install a plugin to do that.
In Eclipse you can try WindowBuilder.
In Netbeans this ability comes within the standard package.
Java's Swing framework tries to address a broad set of platforms, and it does this by separating out look-and-feel concerns, layout concerns, etc. The most painful part of setting up a form is the layout, and that is driven by the LayoutManagers.
There are various LayoutManager implementations built to be used in conjunction with form designer tooling. I've personally had good results with IntelliJ's designer. See some screen shots and feature listings here.
I would personally not recommend using any Drag and Drop builders. In some IDEs the generated code is not editable. Some IDEs allow you to edit the code, but the bottom line is no matter what IDE you use the generated code is very difficult to maintain. After a while you will find it difficult to work with it yourself.
Instead, since you are just starting out, I would recommend using a good layout manager right away. While we are on that, give the jdk's layout managers a wide berth. They are horrible and that's what causes most people to go in for the drag and drop solution. Instead try the Jgoodies Form Layout. Its very easy to understand and use. The link is here:
http://www.jgoodies.com/freeware/formsdemo/index.html
After you have understood that, try to give this builder I wrote a shot. It makes life even more simple:
http://code.google.com/p/swingobjects/source/browse/SwingObjects/src/org/aesthete/swingobjects/view/SwingObjFormBuilder.java
I cannot find one online and I am surprised there isn't one... but is there an online Java GUI Layoutmanager at least?
WindowBuilder for Eclipse is phenomenal. One of the things that awesome about it is that you can hand modify its' generated code and it will pick that up without a problem.
What do you mean by an online GUI builder? If you want one that's a webapp, it's not likely you're going to find one.
If you're looking for a GUI to build a GUI, I would recommend the Netbeans IDE. I forget where it is exactly in the IDE, but you can basically just do file->new->java-gui (or something of the sort) and you will get a very nice interface for constructing swing gui's.
I'd like to create an MDI application using SWT.
I've done extensive searches and reach that the Decorations Object is the one responsable for trying supporting behavior. However, I've a Linux box, and the example provided
doesn't work for me.
The output of the example provided by the above link is:
Image
However, on Linux (GTK), I see only labels without control bars or boxes!
You might want to take a look at the Eclipse Rich Client Platform. It's built on SWT and gives you the full flexibility of the Eclipse User Interface (with views and editors) - and lots of other interesting stuff like a smart plug-in and modularization system or a full-fledged online help. Take a look at the RCP Mail Demo - it's a simple demo program that shows you how to create different views and move them around. (I'd offer my tutorial, but it's written in german. You'll find lots of good stuff around the net.) If you're still interested, there's a book named Eclipse Rich Client Platform available by Jeff McAffer - excellent guide.
Use the Novocode Application Framework. It has a Desktop Form for exactly that, and I like it, even if tabs are all the hype now. I already used it with great success!
(source: novocode.com)
I have just installed Eclipse 3.4 and found out that there is not a plugin to create Swing applications yet. I also have found that there is a Matisse implementation in MyEclipse IDE, but I'd like to now whether there is such a Matisse plugin for free.
Instatiations Swing Designer is the best in my opinion. We settled on it after trying may different Eclipse plugins.
there isnt one for free. myeclipse is the only way to run matisse inside eclipse.
Although this is not a true answer to your question, you may as well look at alternative solutions in terms of layout management: Matisse and GroupLayout are neither the only way, nor the best one, to define your GUI forms.
I would suggest you take a look at:
MigLayout (very powerful and quite
simple)
and DesignGridLayout (quite powerful
and very simple)
Both are open source and have a friendly license (not GPL).
A quick search on Google will give you the links immediately.
Disclaimer: I am one of DesignGridLayout both project owners, but I point you to it because I'm convinced it provides a better way to define Swing layouts.
I did a quick Google search and found that you could use Netbeans Matisse and Eclipse in parallel:
NetBeans Wiki: UsingNetbeansMatisseAndEclipseInParallel
It seems to basically involve building the Swing GUI in Netbeans and doing the other coding tasks from within Eclipse.