Java GUI Framework Interview Preparation Guide
Download PDF

Java GUI Framework  frequently Asked Questions by expert members with experience in Java GUI Framework . These interview questions and answers on Java GUI Framework  will help you strengthen your technical skills, prepare for the interviews and quickly revise the concepts. So get preparation for the Java GUI Framework  job interview

28 Java GUI Framework Questions and Answers:

1 :: Do you know AWT?

Is the very foundation of swing, it performs well but is lacking in advanced components. If you intend to create rich applications, AWT is probably not the way to go. However for smaller gui applications that doesn't require rich user interfaces. This might suit perfectly as it's a tried and proven framework.

2 :: Can you explain Swing?

Based on AWT as previously stated. In its infancy it was regarded as slow and buggy and caused IBM to create SWT for Eclipse. However with Java 5 (or 6?) Swing became the framework of choice for building new applications. Swing has a lot of rich components but are still lacking in some areas. One example being that there isn't a full featured TreeTable component which can do sorting and filtering/searching.

3 :: What do you know about SWT?

Created by IBM for Eclipse, they seemed to think that Swing was not suited for Eclipse at the time. By itself is pretty low-level, and it uses the platform's native widgets through JNI. It is not related to Swing and AWT at all. Their API is however somewhat clunky and not intuitive. They do have some advanced component's like a TreeTable. (but i don't think they support sorting and filtering out of the box). SWT uses some native bindings (through JNI?) and the rant on the internet is that this framework should not be used in today's projects. (why not?)

4 :: What is SwingX?

Based on Swing and it's mission is to create rich components for swing. Still under development. (not very active though.) Have a very nice set of components, like for example TreeTable. But the TreeTable does not support filtering and sorting as far as i know. It does however support searching with highlighting.

5 :: What is JavaFX?

The latest flagship of Java/Oracle. promising to be the facto standard in developing rich desktop or web applications.

6 :: What is Apache Pivot?

It renders UI using Java2D, thus minimizing the impact of (IMO, bloated) legacies of Swing and AWT.

It's main focus seems to be on RIA (Rich internet applications), but it seems it can also be applied to desktop applications. And as a personal comment, Looks very interesting! I Especially like that it's an apache project.

7 :: What is Qt Jambi?

A java wrapper to the native qt library which is written in c/c++. Very powerful, widely used and accepted. Has a lot of GUI components and a easy to use API.

8 :: How to make sure a window is always on top of all other windows using AWT or Swing?

Before Java 1.5 you couldn't:

AWT and Swing didn't provide this feature. All you could do was to use a (modal) [J]Dialog, and make sure the [J]Dialog is provided with the correct parent/owner in the constructor.

Since Java 1.5:

Window.setAlwaysOnTop(), which is inherited by the other top-level containers like JFrame.

9 :: How to (de)iconify a window?

Before Java 1.2 you had to revert to native calls.

Since Java 1.2 you can use [J]Frame.setState().

Since Java 1.4 you can use [J]Frame.setExtendedState(), too. setExtendedState() provides more features than setState().

10 :: How to replace/remove the icon in the title bar (window decoration) of a [J]Frame?

Use setIconImage().

To revert to the platform's default icon use:

frame.setIconImage(null);

On some platforms this might remove the icon. Alternatively you can try a transparent Image if you don't want to have an icon.