GUI framework Java - java

I am looking for some framework or toolkit (style drag and drop) for creating gui in Java. I need to do quite complex application with dockings, toolbars, tables etc.
Which one would be best?

The Netbeans Platform might be what you are looking for, it is based on Swing, and the Netbeans IDE can be a showcase for it, check http://platform.netbeans.org/
I think the equivalent on SWT is http://www.eclipse.org/platform/

If you're looking for a GUI builder, NetBeans has a decent one. Otherwise, you can just write it yourself in Swing or SWT?

Start reading Swing Architecture and then use Netbeans UI builder and finally complement it with JIDE Software libraries.
JIDE have several libraries, for instance:
JIDE Docking:
JIDE Grids:
And many more. The only inconvenient I see is, you need a good understanding on how does Swing works before using it ( or you can acquire that knowledge in the process )

eclipse rcp, spring rich client, griffon
all of these frameworks are good to avoid writing boiler-plate code all over again (support for docking, window management, dialog management, preferences management).
i must note that complete drag 'n drop is not supported in none of them out of the box, but there are IDE's that help you in building Swing panels, components, ... in a visual editor. both Eclipse IDE and NetBeans IDE have a GUI Builder/visual editor.
my prefered choice is spring rich client because it's easy to get started, it's swing-based, it integrates with docking frameworks, component libraries, ... and it uses spring.
if you need a pluggable architecture then you should take a look at eclipse, or netbeans.
edited: i mean eclipse rcp

Related

Difference between Java Swing application & Netbeans platform Swing

I want to develop a simple desktop application that connects to the Java DB , using Java Swing for the interface design.
I am new to Swing so I tried some tutorials on the net and came across
the Netbeans platform Swing components.
What is
the difference between the Java Swing architecture and the Netbeans Swing components?
Which one will be appropriate for developing interfaces
for desktop applications in Java?
From The NetBeans Platform:
The NetBeans Platform is a generic framework for Swing applications. It provides the "plumbing" that, before, every developer had to write themselves—saving state, connecting actions to menu items, toolbar items and keyboard shortcuts; window management, and so on.
It is an API built with Swing, that is supposed to provide some extra 'built-in' functionality. Since you need to know Swing to be able to use it. I suggest you concentrate on Swing for now.
Actually, it will be better to move on Intellij Idea from Jet Brains. It’s much more better than NetBeans IDE. Of course, it’s only my opinion.

Eclipse RCP with google Windowbuilder pro

Can I use Eclipse RCP framework with google's window builder pro for desktop application development.
I also want to know more about Eclipse RCP, what are the advantages when comapared to swing.
Yes you can use WindowBuilder Pro for Eclipse RCP development. Window Builder Pro has great support for SWT, JFace, and Eclipse RCP specific stuff like Views and Perspectives for example you can create perspectives in visual editor.
For second questions
You can directly compare Swing and Eclipse RCP, Swing equivalent is SWT, and they have comparable features. SWT has better OS native widgets look.
SWT is set of widgets that you can use. On top of SWT JFace is built- JFace is set of high level frameworks for MVC, wizards, databinding, working with table/treeview,combos ...
On top of SWT and JFace is Eclipse RCP is built which provides application framework for plugins, with support for extensions, perspectives/views,actions, menus, and basically for extendability.
As your first question, yes, WindowBuilder Pro can create SWT code.
As for the second, there are a lot of comparisons on the pros and cons of Swing vs RCP, and the core verdict is that It Depends. Personally I would reccomend going thr RCP route for any major work, but keep in mind that it's a complete stack and not just a widget toolkit, and the things you will need to learn are correspondingly more.

Is there some framework for testing GUI based on AWT?

There is a lot of frameworks support testing Java GUI based on Swing but I can't find any open-source framework supporting AWT GUI testing. The framework should support script writing (not mere recording of user actions). Is there such framework or tool?
You likely can use awt.Robot to write yourself such a tool.
Also meanwhile Swing and AWT can much better be mixed than in older times, you should consider to rewrite your UI, or at least do futur development Swing based.
a good open source framework for Java GUI testing is Maveryx.
It has many good point:
It can handle Swing, AWT, Java Web Start (and soon) applets and SWT.
There are no custom script language, you can write your test case in java.
Thera are no GUI MAP dependences, you don't need any "capture and replay", only write your test and go!
It's fully compatible with JUnit through the Maveryx Eclipse plug-in.
Mauro

SWT or Swing for Plugin Project

I'm creating a plugin project that will have a menu and toolbar item, that when clicked, will open a dialog for user interaction (input, searching, etc.). Should I create the dialog using SWT or Swing?
One advantage of doing it in Swing is that you don't have to supply any other libraries, because Swing is part of JRE. With SWT you have to do it and you have to have separate dlls for specific platforms.
UPDATE:
Since you mentioned that you have to create Eclipse plugin, I think you have a clear choice here - SWT. It is what Eclipse is based on.
SWT.
Debate over the merits of Swing and SWT is irrelevant. Your plug-in will integrate with a platform built on SWT. Using the same user-interface toolkit will simplify your development and testing, and produce better results.
There are cases where it's useful to use Swing within Eclipse, such as when you have an existing codebase that would be impractical to port. There is an SWT/AWT bridge; I have not used it.
Like #eugener, I prefer Swing to SWT, but both are rich, well-maintained frameworks that will serve the purpose. NetBeans and Eclipse are widely used exemplars. SWT binaries for popular platforms aren't too hard to integrate. The SWT FAQ may offer some perspective.
You'll need some other criteria to decide.
Since you're integrating Code Barrel into Eclipse, and SWT is part of the Eclipse project...
Actually, you should be looking at the Eclipse Plug-in Architecture and see how it works.

MVC/MVP/MVVM frameworks for Java GUI applications

Can anybody recommend a (preferably open-source) framework for decoupling GUI from model in Java desktop applications?
Fundamentally decoupling a GUI model from your core java code is best done with a databinding library. Which is to say you have your pojo business code, you have the GUI component code, and you don't fancy writing a load of logic to sync them up all the time whilst updating the view and implementing the business logic. So don't. Find a mature databinding framework for the GUI widgets you are using and learn that; have it keep the screen controls in sync with your pojo code.
JGoodies and beanbindings are good examples of Swing variants of binding onto an OO model. The core bits of JGoodies are opensource. If you go to /articles on the jgoodies site it has articles on pattern and databinding. Whilst each binding framework has different classes the patterns for writing good clean code are portable between GUI frameworks and bindings frameworks.
If you download the now opensource WindowsBuilderPro tool then it has excellent examples in both Swing and SWT of doing good databindings. The swing jphonebook example uses the beanbindings library. WindowsBuilderPro is a drag and drop GUI builder; you used to have to pay for it as a leading drag and drop GUI builder which works with the leading free GUI libraries. It was bought by google and opensourced so that they could beef up its graphical screen builder support for GWT (the Google web GUI framework).
That GUI builder tool has both excellent sample code and is an excellent opensource tool now. It does the same example of a phonebook in both Swing and SWT GUI libraries to demo its drag-and-drop GUI builder tool power. So it is a great way to compare and contrast Swing to SWT whilst learning databindings.
Java Swing actually makes good use of MVC for just this purpose.
I would strongly suggest you to try the ZK framework. I have not found until today such a srtong framework. In my company we have applied new projects within a few weeks using the latest patterns like MVVM. The style of programming is much like developing a classic 'desktop' app.
PS: I am in no way related to the ZK people. I am just using their framework.
From your reaction to the suggestion that Swing is an MVC framework for desktop apps, I think that you really need some kind of generator framework that will generate the 'model' and 'view' code from higher level specifications. Examples I'm (more or less) familiar with are Eclipse EMF, GEF and related technologies.
Biscotti is a great framework

Categories