setBounds method not working

While working on Swings and AWT, i used the setBounds(int x,int y,int width,int height) method of control as per API documentation.
However soon i realized that this method is not working as per expected.
After few try i found that setBounds() method only works if the Layout of container of control is null.

The layout of the container can be set null like below code:

frame.getContentPane().setLayout(null);

Posted

in

by

Tags:


Related Posts

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading