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.
Related
I usually write java code using a simple text editor and .bat files to compile and run. I'm not used to IDEs like Eclipse or Netbeans and as a result every GUI I've made so far has been written by hand.
Questions:
Can I use eclipse to build a GUI easily (e.g. drag-drop features)?
Can this generated code use only the basic java packages (swing, awt) and not any other package provided by the IDE?
I'm saying this because -correct me if I'm wrong- from what I have read so far, I understand that Eclipse and other IDEs use their own packages (to achieve better layouts for example). I would like to avoid this dependency and if possible copy-paste the code generated by Eclipse and then work in the simple way I'm used to.
Thanks in advance.
[edit]
Having tried it for a couple of days, I can now say that WindowsBuilder is exactly what I was looking for. Thank you for all your replies.
Eclipse uses the Standard Widget Toolkit (SWT, not included in JRE by default), Netbeans uses Swing (included).
Since recent Eclipse versions, it includes WindowBuilder to create Swing or SWT via drag'n'drop. WindowBuilder is even bidirectional, so code generation is supported as well as reflecting hand-made changes. It don't know if Netbeans includes this feature, too. In 'New' dialog of Eclipse you find everything you need under the WindowBuilder category.
Yes , You can use the feature of drag and Drop in java by going through these few Steps:
Help → Eclipse MarketPlace → WindowBuilder(Install)
Can I use eclipse to build a GUI easily (e.g. drag-drop features)?
Yes, go to the Marketplace and pull in WindowsBuilder; it supports bi-directional GUI drag-n-drop / direct-code editing.
Can this generated code use only the basic java packages (swing, awt) and not any other package provided by the IDE?
The code generated by the Swing Design tool is strictly Swing/AWT based.
It does offer design tools for SWT and GWT as well.
If you want to create Drag n Drop Swing GUI, you should try Netbeans. Eclipse may have a plugin but i usually find netbeans very good in GUI and it is also recommended by Sun for making Swing/AWT GUI
I haven't seen such in Eclipse. In Netbeans you can of course. But I am warning you! Create the GUI by hand. Netbeans is using GroupLayout to build drag and drop GUI, and that's a nightmare when you look at it!!! If eclipse has the same function, don't expect more than this!! Apart from that, not like .NET, most Java developers create everything by hand (Yes, real programming..That's why most say Java is hard). So, it is better if you can get used to it :)
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'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.
I'm trying to learn swing and I was thinking you guys may know a really good swing based open source application that I could study and inspire from. I'm looking for something that has a real world use, not just some concepts explained (like examples in most books and tutorials).
Thank you!
It's certainly less well-known than some of the other projects mentioned here, but have a look at GoGrinder. The code is well written and documented.
It might also be a good idea to look for something that you'll actually use. I find it easier to read the source of applications that I'm familiar with from using them.
In the same spirit as the answer suggesting to check NetBeans, I would suggest to get the sources of IntelliJ IDEA Community Edition and IntelliJ Platform from their git repository. At some point, IDEA was IMO a state of the art Swing application (fast, responsive, not ugly, nice user experience, etc).
Maybe you could have a look at the open source NetBeans IDE. It is huge, but it is using Swing intensively and is well designed and documented. Moreover, it is also a generic platform to build modular GUI applications.
The Swing Tutorial is filled with excellent code, and the Swing code itself is available for study in most IDEs.
jEdit is a programmer's text editor that I wrote some plugins for a few years ago. Partially due to the plugin system, the code is well documented, and after having been in development for many years is generally very high quality.
You could take a look at the jgoodies examples. They are not plain swing though, and I don't know the license.
I'm looking for the following:
A nice debugger that allows me to easily view variable values if I use breakpoints.
Works very nicely in Windows 7.
Has something similar to the Toolbox pane in Visual Studio.
Built in intellisense, and code completion with the TAB key.
Long term support. I mean something that will last and stay in active development for years. I don't want a pet project IDE that will stop developing in a year. I'm just learning so it'll be very dificult at first to switch IDE's.
I'm new so I don't really know which IDE provides what I need between the two. Any help?
Well, I switched from Eclipse to Visual Studio, and I use both just about every day.
I found it hard to get used to the little differences at first, but now I am proficient in both IDEs.
I can't speak to whether or not Netbeans would be easier to learn, but Eclipse shouldn't be hard at all.
Both IDEs will provide all of the features that you have listed, and you should be able to customize both of them to get them to work almost exactly like Visual Studio.
So you want to learn Java and your first question is about which IDE to learn ? I suggest you look at BlueJ which is an IDE designed for people who want to learn Java. From my, I admit limited, experience with the IDEs you mention, BlueJ is the one which gets least in one's way when trying to learn Java as opposed to learning the IDE. Once you've exhausted BlueJ's capabilities there is an easy progression to NetBeans through a plug-in but you would probably not find it too difficult to step up to Eclipse instead.
Yes, I know you want to choose between Eclipse and NetBeans but BlueJ might be of interest.
This is a common debate, and there are obviously merits on both sides (this might be better served as a community wiki page). I prefer Eclipse, but to answer your questions as well as I can briefly:
Works very nicely in Windows 7.
Both are fine.
Has something similar to the Toolbox pane in Visual Studio.
Sorry, not familiar. Neither are short on panes, though Eclipse has a richer cache of third party plugins that might give you the experience you want.
Built in intellisense, and code completion with the TAB key.
I believe both are Ctrl-Space by default. If you're working in Java in Eclipse, there's an automated pop-up after a half second delay each time you type a separator (.) character.
Long term support. I mean something that will last and stay in active development for >years. I don't want a pet project IDE that will stop developing in a year. I'm just >learning so it'll be very dificult at first to switch IDE's.
Both are very mature products. I'd imagine Eclipse's fortunes are a little more secure simply because NetBeans might experience some turbulence during the Oracle acquisition of Sun.
My only other comment is that it's always seemed to me that Netbeans had far nicer "click-and-go" project templates out of the box, while Eclipse offered richer third party library integrations and a better debugger.
Probably both will do. Personally, I'd rather use Netbeans, because it's easier to get started right-out-of-the box. Eclipse depends more on plugins.
Why not try both and see which one suits your individual tastes more?
Both are find but if you want to build GUI's, Netbeans has the edge as it has a built in GUI builder, including a toolbox of controls to use with it.
Eclipse does not have a GUI builder. The commercial Eclipse distribution, MyEclipse does have a GUI builder - it's actually the one from Netbeans.
Neither Intellij IDEA is the Cadillac of Java IDEs
Netbeans = Great out of box experiance
Eclipse = Highly customizable with plugins and (so I've heard) slightly better intellisence-like capabilities.
If possible, I'd say try both (despite the bandwidth problem). If you get basic Java Development versions, the sizes aren't that big (48 MB for NetBeans and 92 MB for Eclipse)
I personally prefer NetBean's in-built capabilities since I don't like having to install plugins to make my experience the way I want it (and not all Eclipse plugins are free) but most of my fellow java devs prefer Eclipse's simplicity and ease of use.
I think you should try Intellij Idea, it the most powerful-intuitive java IDE I've never seen (http://www.jetbrains.com/idea/index.html). The new Community Edition is free and more than enough for java developpement. As it is highly configurable you can choose 'TAB' for auto completion, but I think you can learn from existing combinations that are well design.
Regards.
Java has some really nice IDEs available and many will do what you require.
I dont know you, but I use VS with Resharper so I m very used to those shortcuts, if you do too then have a look at IntelliJ ( they have a comunity edition)
Otherwise you can get eclipse and get the IntelliJ keymap ( or try to get the default VS keymap)
Netbeans is nice too, but I had some problems with it ( ie didnt build, rancomly crashing, etc)
Also most offer Source Control integration ( in Eclipse you have many flavours of subversion for example)
I guess you ll have to play around and find what suits you
Cheers