The Java Foundation Classes (JFC) are a set of Java class libraries provided as part of Java 2 Platform, Standard Edition (J2SE) to support building graphics user interface (GUI) and graphics functionality for client applications that will run on popular platforms such as Microsoft Windows, Linux, and Mac OSX
Swing Interviews are getting tough these days as the technology grows faster. To get through the Swing interview one needs to update him/herself in a regular manner. Having said that, just before the interview, it is very important to have a quick glance of the reputed Swing questions and answers to make yourself comfortable during the interview process. This is where DoAnswers.com helps you in renewing yourself on Swing and various other technologies interview preparation.
21. How you will display validation fail errors on jsp page?
Following tag displays all the errors:
22. How you will enable front-end validation based on the xml in validation.xml?
The tag to allow front-end validation based on the xml in validation.xml. For example the code: generates the client side java script for the form \"logonForm\" as defined in the validation.xml file. The when added in the jsp file generates the client site validation script.
23. How you will handle exceptions in Struts?
In Struts you can handle the exceptions in two ways: a) Declarative Exception Handling: You can either define global exception handling tags in your struts-config.xml or define the exception handling tags within .. tag. Example: b) Programmatic Exception Handling: Here you can use try{}catch{} block to handle the exception.
24. How you will make available any Message Resources Definitions file to the Struts Framework Environment?
T Message Resources Definitions file are simple .properties files and these files contains the messages that can be used in the struts project. Message Resources Definitions files can be added to the struts-config.xml file through tag. Example: .
25. If your UI seems to freeze periodically, what might be a likely reason?
A callback implementation like ActionListener.actionPerformed or MouseListener.mouseClicked is taking a long time to execute thereby blocking the event dispatch thread from processing other UI events.
26. In which package are most of the AWT events that support the event-delegation model defined?
Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package. The AWTEvent class is defined in the java.awt package.
27. Is struts threadsafe? Give an example?
Struts is not only thread-safe but thread-dependant. The response to a request is handled by a light-weight Action object, rather than an individual servlet. Struts instantiates each Action class once, and allows other requests to be threaded through the original object. This core strategy conserves resources and provides the best possible throughput. A properly-designed application will exploit this further by routing related operations through a single Action.
28. JFrame is a heavy weight component. Since it extends an awt Frame, is it Thread Safe?
JFrame itself is, since it is just a java.awt.Frame in essence, but the root pane/content pane is not, so it effectively follows the same rules for Swing containers and is not considered thread safe.
29. Name the containers which uses Border Layout as their default layout?
Containers which uses Border Layout as their default are: window, Frame and Dialog classes.
30. Name three Component subclasses that support painting
The Canvas, Frame, Panel, and Applet classes support painting