Method of the Component class

Which method of the Component class is used to set the position and size of a component?

The methods are:

- setMaximumSize(Dimension maximumSize)
Sets the maximum size of this component to a constant value.

- setMinimumSize(Dimension minimumSize)
Sets the minimum size of this component to a constant value.

- setAlignmentX(float alignmentX)
Sets the vertical alignment.

- setAlignmentY(float alignmentY)
Sets the horizontal alignment.
What interface is extended by AWT event listeners?
What interface is extended by AWT event listeners? - The java.util.EventListener interface is extended by all the AWT event listeners...
What is paint method? What should we put in paint method?
What is paint method? - The AWT uses a Callback mechanism for painting which is the same for heavyweight and lightweight components...
What is the purpose of repaint method? When should we use repaint method?
Purpose of repaint method - repaint() requests an erase and redraw (update) after a small time delay...
Post your comment