What is the preferred size of a component?

Answer Posted / ranganathkini

When frames or containers are designed using layout
managers, each layout manager imposes certain rules on how
the components within the container must be placed and
sized. Components cannot impose their required size on the
layout manager hence they use the "preferred size" attribute
to suggest to the layout manager of what wud be the ideal
size/location to display them.

The layout manager looks at the preferred size requested by
the components while laying them out in the container. If
the preferred size can be given to the component without
violating the layout manager's rules then the layout manager
uses the preferred size for that component.

Is This Answer Correct ?    37 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What methods are used to get and set the text label displayed by a button object?

554


What does exp mean in math?

535


Explain the selection sort algorithm and state its time complexity?

612


Difference between default and protected access specifiers?

504


What is a “stateless” protocol ?

559






What is the default size of set in java?

502


what is deadlock? : Java thread

527


What is array and arraylist in java?

533


What is a method declaration?

517


Can we nested try statements in java?

630


How can we pass argument to a function by reference instead of pass by value?

588


What are the two ways to create a thread?

536


What is integer valueof?

645


Why are the objects immutable in java?

547


What is a programming object?

556