Can I build attractive GUI in Java? If yes, how should I do it? Or should I use some other language or tool to do it?
Filthy Rich Clients is a good book for learning how to use Java to build attractive GUIs that go beyond the usual Swing look.
You can use SWT, which as the other answer mentions is nice for a more native look. You can use JavaFx if you want to add a lot of visual candy, or you can use flash or other technologies and just perform remote operations.
Good luck.
You can just modify Swing look'n'feel as per this Java tutorial.
Attractive is quite subjective, but you can take a look to the Substance LaF (https://substance.dev.java.net/) and the Pushing Pixels blog (http://www.pushing-pixels.org)
If you are looking for a native look and feel in every platform you could use SWT. It's the one used in Eclipse.
You can build very attractive GUI using Java. You can use SWT: The Standard Widget Toolkit.
You have also mentioned if you can use other programming language then you can go for VIsual Basic.It will be easier than compare to Java. As we have to just drag and drop over there.
There are lots of answers on here about using SWT for an attractive native look and feel. However, I would suggest that Swing, set to use the native look and feel, is pixel perfect now, at least on Windows, using java 6. There is no longer a reason to use SWT. I work on a very large Swing project and you would be hard pressed to tell it is not a native windows app.
Edit: Here are a couple of links to some Sun blogs posts that touch on the subject -
http://weblogs.java.net/blog/bino_george/archive/2004/11/hifi_swing_or_i_1.html
http://weblogs.java.net/blog/chet/archive/2006/10/java_on_vista_y.html
Java is just a language. You cannot build a GUI in Java. Period.
The JDK libraries, however, can build guis through various means. You can use AWT, Swing, SWT, JavaFX or GWT libraries to build GUIs--or you can build your own library if you really want.
You can also just create an AWT frame and draw anything you want in it. (I worked on an waveform analyzer (o-scope looking thing) with a GUI written entirely in AWT.
Now, most of those libraries are fairly platform independent, if you want to restrict yourself to a single platform, you can do anything that can be done in C or any other language.
Therefore your question doesn't make too much sense. Are you saying that you want to put in minimum effort and get a good interface? Swing will be less effort than just about any other toolkit out there and can be skinned in more ways than most.
Or are you saying that you want to specify the exact GUI? In that case, don't use swing but there are a bunch of alternatives that should do just what you want.
Can you be more specific (Do you really want help?), or were you just trying to bash Java?
Related
I'm new to Java frond end technologies. If we want to develop a cross platform java app and the look and feel should be like somewhat JQuery UI. If we don't want to use swing or Nimbus for front end, then what is the best option to achieve the JQuery UI look? I guess we can't use JQuery, as the app is a cross platform one. (must be running on linux, Solaris and Mobile) what you suggest?
Is Jerry can be a good option? (I never tried this thing. Find it here.
Thanks in advance.
If you want to create a cross-platform client side application there are basically three good (mature, proven, well-supported) options in Java:
Use Swing with pluggable look & feels to get the exact look you want. Nimbus is an example of a Swing look and feel, but there are many more. You can also create your own custom look and feels - this is quite a lot of work but does give you the flexibility to define exactly the look that you want. Swing is part of the standard Java distribution and behaves pretty much the same on all platforms, so if portability is your biggest concern, the Swing is a solid choice.
Use SWT which is the GUI toolkit from Eclipse. It's a great toolkit, though does have some native dependencies so you might have issues on mobile. SWT provides more of a "native" look and feel to each platform that you run it on.
Use JavaFX 2.0 which is the relatively new rich client framework from Oracle. Probably more suitable for graphical / rich media apps. Supports CSS-like styling which could be useful.
I'm not really familiar with Jerry, but it looks more like a DOM manipulation library rather than a GUI toolkit so I don't think it will help you much (unless you decide to move away from a client GUI and instead build a web-based front end).
Question in short:
What is the easiest way to mimic a swing based (skinned, customized) java GUI with .NET means?
Question explained:
Our main app has a swing based skinned (and customized) java GUI.
Apart from that we are going to build some smaller GUI equipped tools. Some of them will be .NET based windows applications with a windows forms GUI.
Now, to get a uniform user experience the GUIs of these .NET tools should be as close to our java based GUI as possible in both appearence and handling.
What is the easiest way to accomplish this?
What is the easiest way to accomplish this?
The easiest way to get a uniform Swing / Swing-like user interface is to implement everything in Java and Swing.
I've not heard of a Swing look-alike UI library for .NET. I guess it is theoretically possible, but it would be a lot of effort: probably orders of magnitude more work than implementing the tools the easy way.
So your practical alternatives are 1) implement the new tools in Java / Swing, 2) reimplement the old tools in .NET, or 3) forget about having a common UI look-and-feel.
This is not a joke answer ...
Try Windows Presentation Foundation (WPF) Themes instead WinForms as allow to change the controls Look & Feel. I think is not as easy and pluggable like Swing but could serve as an starting point.
So far I've only built "small" graphical applications, using swing and JComponents as I learned at school. Yet I can't bear ugly JButtons anymore. I've tried to play with the different JButton methods, like changing colors, putting icons etc. but I'm still not satisfied. How do you make a nicer GUI in java ?
I'm looking for not-too-heavy alternatives (like, without big frameworks or too complicated libraries).
Swing supports changing the Look & feel.
This tutorial explains how:
UIManager.setLookAndFeel(lookAndFeelClassName);
Another way is to start your app with the L&F:
java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel MyApp
Here is a list of 10 very nice look and feels.
I am using SWT. Try it , it is really very nice java gui framework, eclipse is build around it. You can use also this plugin for eclipse to create your forms Instantiations.
Have you at least tried with nimbus look'n'feel? that is a little bit better than the others..
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
only downside is that it requires at least Java6 update 10.
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e)
{}
Our project manager doesn't like JButtons as well and we're using JIDE OSS buttons instead(and lot's of other JIDE components). SwingX also offers an alternative - JXButton. IMO these are the two most valuable external Swing libraries around.
You may want to try JavaFX. For all its problems, I find that if you want to put a decent (preetier than Swing) interface over your Java application, its quite easy to do. Plus good Java integration. You can implement Java interfaces in JavaFX and vice versa.
This article shows how to extend JButton and overide the methods for painting the component.
The easiest is to stay with Swing and use a different look and feel.
What CAN be done easily is shown at http://www.jgoodies.com/freeware/metamorphosis/index.html (Use this this web start linkto see it in action)
Either bundle a L&F with your program, or choose one of the built in. I like Nimbus but it must be explicitly selected in your code.
If you are a little bit into graphics design, you might want to consider creating your own design with Synth, which is part of the standard JRE. If you don't want to create your own, google for free existing themes which you may use.
Alternatives to Synth are either Synthetica (free for personal, non commercial use) or Substance ("free" as in "BSD License").
It would be nice if Java had a similar tool to Interface Builder (the GUI development tool that comes with Xcode) - by far the best UI builder I've ever seen.
I need to compose a fairly simple GUI for a server monitoring process. It will have a few tabs which lead to a log tailing, counts of resources, and a start and top control. Nothing fancy here. Which Java framework, AWT or Swing, makes more sense for something this simple.
Swing is the way to go. It's a cleaner programming interface, and looks better.
Use Swing or SWT, since AWT has no tabs built in.
Starting with Java 6 Update 10, Swing got an entirely new look and feel, the 'Nimbus Look and Feel'. It looks great and is really fast because it uses vector graphics.
Swing is your best choice if you're stuck choosing between Swing and AWT.
If you have the flexibility, I would at least consider SWT. It's faster, matches the platform look and feel, and seems to have fewer porting hurdles and regression problems from release to release. There is a small hurdle in setting up your first project (getting the right jars and such), but other than that, it's no more difficult to work in.
AWT was the first Java GUI framework, it had a lot of flaws and was abandoned in favor of Swing. The main reason it is still in the JDK is for backwards compatibility and because some classes are re-used by Swing.
The future however (even for the desktop) could be JavaFX.
if you are planning to move your gui onto multiple platforms, then go with AWT. Otherwise, Swing gives you a much broader set of components to work with.
If you are looking for a better looking GUI, you can have a look at substance look and feel package in this address: https://substance.dev.java.net/see.html
Obviously the Java API reference, but what else is there that you all use?
I've been doing web development my entire career. Lately I've been messing around a lot with Groovy and I've decided to do a small application in Griffon just to experiment more with Groovy and also break some ground in desktop development. The only thing is I'm totally green when it comes to desktop apps.
So, world, where's a good place to start?
The Swing Tutorial is very good. Apart from that, the Swing API is obviously the reference, however it's also a treasure trove of fairly good source code! Add the API source to your IDE and you can jump directly to the implementation to all the Swing classes. This is a great way to explore the functionality, see how various Swing components work and learn a good Swing "style". Furthermore, it's great to be able to step through the API classes if things don't seem to work and you have no idea why! Adding the API source to the IDE has the additional benefit that you get all the JavaDocs along with it, although all modern IDEs can also pull them from the net -- you do not want to program desktop Java without the documentation available from within the IDE!
NetBeans and other IDEs do make the creation of IDEs very easy, but be aware that there is a lot more to Swing than just containers and layout managers. In fact, containers and layout managers are among the easier things, and I'd recommend learning to use them by hand, too. There is nothing at all wrong with using a GUI builder, but in some cases it's overkill, and then it's nicer to just quickly whip up a GUI from source. In other cases you need to be able to create a GUI dynamically and then GUI builders are no use at all! For creating very complex layouts from source, I recommend FormLayout, which has its own set of quirks, but which does scale (in terms of programming effort) to very big frames and layouts.
If you've only done Groovy so far, you'll be surprised how well documented Swing and the rest of the Java API is and how well everything is integrated. It might also take some getting used to a different style of programming, using the debugger more often and println-debugging less, etc. There might also be some "boiler-plate" code that will be very annoying. ;) Enjoy.
The Sun Java tutorials are pretty good. I cannot vouch specifically for the Swing one as it has been ages since I've done any Swing development and I have not read it myself.
Creating a GUI with JFC/Swing
When it comes to developing java desktop applications, I would highly recommend using the IDE environment Netbeans. Especially when it comes to the development of Swing based applications.
I recommend you to play around with netbeans. It will allow you to build complete GUIs using only your mouse. Once you get familiar with Swing components, start using the Java API. Thats how I started.
The O'Reilly Swing Book is a pretty good reference, it has a good overview of general Swing concepts and covers each of the major classes. I used it recently when I had to refresh my memory on Swing.