Pages

Implementing the QuaQua LookAndFeel in Java

      I like to show you how to implement the QuaQua Look And Feel in Java. I heard someone says that Java isn't that good when it comes to look and feel and Java is only good for algorithms, back ends and all other good stuffs. I found that statement partially true. Why? Because Java is really good for algorithms. But I must say that Java is as good as other programming language when talking about LAF. There are lots of workaround of customizing the LAF of your Java Desktop Application.

You can create an application what uses Windows LAF, Metal and other available LAF for Java. You can also create a desktop application that uses other LAF like the QuaQua Look and Feel described here.

Examples of the implementation of the QuaQua Look and Feel in Java.

quaqua look and feel in java

quaqua look and feel in java

quaqua look and feel in java


Wow! That is very nice and very professional looking for a Java application.
So, how to do that?

Download the  QuaQua package from the QuaQua Look And Feel website.
Add add quaquar.jar and swing-layout.jar to the classpath of your project.

 SwingUtilities.invokeLater(
new Runnable() {

public void run() {
try {
UIManager.setLookAndFeel("ch.randelshofer.quaqua.QuaquaLookAndFeel");
} catch (Exception e) {
}
MainFrame MF = new MainFrame();
MF.setSize(647, 410);
MF.setLocationRelativeTo(null);
MF.setVisible(true);
MF.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
MF.getRootPane().setFont(UIManager.getFont("SystemFont"));
MF.getRootPane().putClientProperty("Quaqua.RootPane.isVertical", Boolean.FALSE);
MF.getRootPane().putClientProperty("Quaqua.RootPane.isPalette", Boolean.FALSE);
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);

Just use the code above to implement QuaQua Look And Feel in Java.

Credits:
Joel Benaldo
Jakemar Bantugan

No comments:

Post a Comment