The Panel and Applet classes use the FlowLayout as their default layout.
Click Here to See Answer .....
Subscribe to my RSS feed and get more JAVA Question, and Guideline, Plus a lot more great advice to help your Software Career.
advanced JAVA interview questions, j2ee interview questions, java tutorial, Core Java Job Interview Questions, JAVA, JSP, SERVLETS, EJB, STRUTS, XML, ANT, LOG4J, WEBLOGIC, Interview questions for different java technologies like Core Java, JSP, servlets, EJB, JMS< JNDI, JMS
The Panel and Applet classes use the FlowLayout as their default layout.
The preferred size of a component is the minimum component size that will allow the component to display normally.
Heavy weight components like Abstract Window Toolkit (AWT) depend on the local windowing toolkit. For example, java.awt .Button is a heavy weight component.
What is the difference between a Scrollbar and a ScrollPane?
A Scrollbar is just a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.
The Frame class extends Window to define a main application window that can have a menu bar.
The enableEvents() method is used to enable an event for a particular component. Normally, an event is enabled when a listener is added to an object for a particular event. The enableEvents() method is used by objects that handle events by overriding their event-dispatch methods.
The Canvas, Frame, Panel, and Applet classes support painting.
validate()
The setLayout() method is used to specify a container's layout. For example, setLayout(new FlowLayout()); will be set the layout as FlowLayout.
Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java's layout managers aren't tied to absolute sizing and positioning, they are able to accommodate platform-specific differences among windowing systems.
Or What is a layout manager and what are different types of layout managers available in java Swing? Or How are the elements of different layouts organized? A layout manager is an object that is used to organize components in a container. The different layouts available are FlowLayout, BorderLayout, CardLayout, GridLayout and GridBagLayout. FlowLayout: The elements of a FlowLayout are organized in a top to bottom, left to right fashion. BorderLayout: The elements of a BorderLayout are organized at the borders (North, South, East and West) and the center of a container. CardLayout: The elements of a CardLayout are stacked, on top of the other, like a deck of cards. GridLayout: The elements of a GridLayout are of equal size and are laid out using the square of a grid. GridBagLayout: The elements of a GridBagLayout are organized according to a grid. However, the elements may be different sizes and may occupy more than one row or column of the grid. In addition, the rows and columns may have different sizes.
A Container contains and arranges other components (including other containers) through the use of layout managers, which use specific layout policies to determine where components should go as a function of the size of the container.
The peerless components are called light weight components.
javax.Swing package contains light weight components. All components in Swing, except JApplet, JDialog, JFrame and JWindow are lightweight components.
The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread.
A component can handle its own events by implementing the required event-listener interface and adding itself as its own event listener.
Java Interview Questions site discussing core java IT technical interview questions in detail. These are some of the java job interview questions me and my friends have faced regularly in campus interviews and off campuses. I have consolidated all of them from different people and communities into a vast resource of core java interview questions all in one place. So I am giving you a chance to prepare well by going through each of the java interview faqs organized by java topics, before attending a technical interview on java. AWT components are heavy-weight, whereas Swing components are lightweight. Hence Swing works faster than AWT. Heavy weight components depend on the local windowing toolkit. For example, java.awt.Button is a heavy weight component. Pluggable look and feel possible using java Swing. Also, we can switch from one look and feel to another at runtime in swing which is not possible in AWT. Name the containers which use Border Layout as their default layout? window, Frame and Dialog classes. Name Container classes. Window, Frame, Dialog, FileDialog, Panel, Applet, or ScrollPane
Java Swing Interview Questions
What is the difference between Swing and AWT components?
AWT components are heavy-weight, whereas Swing components are lightweight. Hence Swing works faster than AWT. Heavy weight components depend on the local windowing toolkit. For example, java.awt.Button is a heavy weight component. Pluggable look and feel possible using java Swing. Also, we can switch from one look and feel to another at runtime in swing which is not possible in AWT.