Tuesday, 14 February 2012

What is the difference between the Font and FontMetrics classes? | Core Java

Main diff are there :
  •  The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object.

What are the restrictions imposed by a Security Manager on Applets? | Core Java

Applets cannot read or write files on the client machine that's executing it. They cannot load libraries or access native libraries. They cannot make network connections except to the host that it came from. They cannot start any program on the client machine. They cannot read certain system properties. Windows that an applet brings up look different than windows that an application brings up.

What are types of applets? | Core Java

There are two different types of applets. that are defined as :
  • Trusted Applets and
  • Untrusted applets.
  • Trusted Applets : are applets with predefined security
  • Untrusted Applets : are applets without any security.

How are the elements of different layouts organized? | Core Java

The elements of a FlowLayout are organized in a top to bottom, left to right fashion. The elements of a BorderLayout are organized at the borders (North, South, East and West) and the center of a container. The elements of a CardLayout are stacked, on top of the other, like a deck of cards. The elements of a GridLayout are of equal size and are laid out using the square of a grid. The elements of a GridBagLayout are organized according to a grid. However, the elements are of different size and may occupy more than one row or column of the grid. In addition, the rows and columns may have different sizes. It is the most flexible layout.

What is a layout manager and what are different types of layout managers available? | Core Java

A layout manager is bassically an object, Its mainly used to organize components in a container. The different layouts are available here :
  • FlowLayout,
  • BorderLayout,
  • CardLayout,
  • GridLayout ,
  • GridBagLayout,
  • Boxlayout and
  • SpringLayout.

Monday, 13 February 2012

What is the difference between scrollbar and scrollpane? | Core Java

Main diff are there :
> A Scrollbar is a Component, but not a Container whereas Scrollpane is a Container and handles its own events and perform its own scrolling.

What is the difference between choice and list? | Core Java

They are defined as :
> A Choice : Choice is displayed in a compact form that requires us to pull it down to see the list of available choices and only one item may be selected from a choice.
> A List : It may be displayed in such a way that several list items are visible and it supports the selection of one or more list items.