To set the position and size of a component, which methods
are used?

Answer Posted / ranjith

setBounds

Set the size and location relative to the parent's upper
left corner, in pixels, of the component. The four int
arguments specify x, y, width, and height, in that order.
Use these methods to position and size a component when you
are not using a layout manager.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Name and explain the types of ways which are used to pass arguments in any function in java.

561


Difference between process and thread?

595


What is == in java?

556


How do you join strings in java?

510


What is nullpointerexception?

550






What is the maximum size of hashmap in java?

523


What do you understand by abstract classes?

590


What is nextint java?

539


What are the differences between string, stringbuffer and stringbuilder?

511


Which is faster call by value or call by reference?

493


I want to persist data of objects for later use. What’s the best approach to do so?

498


Can we override constructors?

535


Java is Pass by Value or Pass by Reference?

614


What is the exception hierarchy in java?

477


How do you declare an array in java?

510