Interviewer And Interviewee Guide

Operational SWT JFace Interview Questions & Answers:

1. Explain the steps used to deploy SWT/JFace-based application with Java Web Start?

Some of the operating system specific libraries are to be loaded for SWT applications before they can execute. The combination of SWT application with Java Web Start provides powerful tools to deploy the client side applications.

To test a Java Web Start application the following are the prerequisites:

Microsoft Windows XP or Red Hat Linux V8
Java 2 SDK, Standard Edition V1.4 or later
Apache Ant V1.5.3 or later
Apache Jakarta Tomcat V4.1.24 or later

The steps for deploying:

1. Install the application in the required directory
2. Signing the code and security:
SWT is tightly integrated with the operating system's native windowing environment. SWT uses a system libraries to manage the platform independent API and the supporting operating system. All the required JAR files deployed with Java Web Start must be digitally signed. Self-signed test certificate is needed to be created, as the specific application is not going to deploy for wide user base.
2a). Creation of self-signed certificate:
Execute the command in the directory where the application is to be deployed:
keytool -genkey -keystore keystore -alias myself
A prompt message will be displayed stating to enter the password,name, locality etc. During the ANT build process, the actual signing the JAR files will be completed.
2b). To verify that the keystore was properly created, type the following command:
keytool -list-keystore keystore
3. Build the file using the ANT
3a). To clean the environment, type: ant clean
3b). To execute the build process type: ant
4. Give a trial to execute the application using the command: ant run
5. To deploy the application to Apache Tomcat web server:
5a). Place the application's .war file into webapps directory under Tomcat.
5b). Execute the script to start Apache Tomcat
5c). Open the web browser and type http://localhost:8080/index.html. Now click on Launch application.
6. Click on Start in the displayed dialog box to start the application.

2. Explain the 3 MVC framework JFace Text?

The JFace text provides a framework for the creation and manipulation of text documents. IDocument is the major abstraction for the text model. The content management, position management using portion categories, document partition management, and change notification is provided by this text model.

The changes / notifications are identified by mandatorily implementing the IDocumentListener and registering with the document. The position and partition updating actions are implemented by using IDocumentPositionUpdater and IDocumentPartitioner.

3. Explain the 3 MVC framework JFace viewer?

The JFace viewer framework is an independent module for JFace which needs some knowledge of SWT. The abstract base classes for viewers comprise the framework. The base class is the Viewer which is an extension of a structured viewer. The Viewer acts as a widget container. It is the responsibility for the content provider to respond to the various modifications to the model by informing the viewer, what to change (using add () and remove () methods).

Each viewer registers with the label provider for identifying / notifying the changes that would affect the viewers display.

4. Explain the Java Web Start technology?

Java Web Start (JavaWS) technology is a framework which is used to allow the user to run java platform specific application software directly from the internet. The Java Web Start applications do not run in a browser. Web start application provides a series of classes which provides various services to the applications. These classes are available in the package called javax.jnlp

Web start comes as a part of Java Runtime Environment without having separately installed. It comprises the portability of applets and maintainability of servlets and JSP technologies. Java Web Start allows the java client applications to be launched, updated, and deployed from a standard web server.

The Java Application Manager feature allows the end-users to organize the java applications and also provides different options such as specifying the use of multiple Java Runtime Environments, setting proxy servers for HTTP.

5. Define Autoboxing with an example?

The automatic conversion of primitive int type into a wrapper class object is called autoboxing. It does not require to type cast the int value. The modification of primitive wrapper objects is done directly. The following example illustrates autoboxing:

int number;
Integer intObject;
number = 1;
intObject = 2;
number = intObject;
intObject = number;

6. What are the advantages offered by SWT/JFace?

Advantages of SWT:

Provides backend by providing native look with backend widgets by supporting Swing programming model.
SWT could run Swing native objects which enables SWT to run on any Swing support platform.
SWT based application loads faster compared to Swing applications
The memory usage is smaller in SWT as it uses the shared libraries. The shared library loads only once for all SWT applications.
Provides the exact platform look and feel. Even with the skinned desktop, it looks and feel is also skinned.
Provides different styles for different types of menus

7. Explain Editors?

Using JFace Text framework, sophisticated editors such as XML editors and text editors can be developed. Any application needs editors to author the designated code. For example XML file needs tags to be written a flat text file. A program needs editor to author the code. By using different development template these editors can be plugged in and developed

8. What is Viewers?

Viewers are used to display objects using different SWT widgets. Types of viewers are as follows:

The ListViewer uses the SWT List widget to display the object. A simple list of elements can be created by using ListViewer.
The CheckboxTableViewer uses the SWT widget to display the objects of checkboxes.
The CheckboxTreeViewer uses the SWT table control with checkboxes on each node.
The CheckboxTreeViewer uses the SWT Tree control with checkboxes on each node.
The TableTreeViewer uses the SWT Table Tree control.
TableViewer, uses the SWT TableViewer control.
TreeViewer, uses the SWT TreeViewer control.

9. What is Action Mechanism?

Actions are tasks for various users operations such as clicks on menus, toolbars, status lines etc. In order to support these actions the action mechanism is implemented. There are listeners and managers for each of these actions.

10. What is Wizard?

A wizard can be used to create new java classes, projects, files and folders. Wizards provide step by step process to create these elements. A well defined wizard is targeted to simplify user tasks and increase productivity. Wizard is meant to take out the hassle of creating repetitive and tedious tasks.

Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.