General discussion

Locked

Layout in Java

By VickyDicky ·
What is NULL layout in Java Language?

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Layout in Java

by paragmehta In reply to Layout in Java

Null is not a layout...! Null is the unknown value...

If you are taking about
Component.setLayout(null) , then
It simply indicates that no layout Manager would be used and Alignment provided by us would take effect. Although it sounds lucrative at first, it can be headache for any project of sizable length...
Hope this help...

Collapse -

Layout in Java

by VickyDicky In reply to Layout in Java

I too of ur opinion that there is no layout like Null Layout , but I got this questoin in one test and I searched for this in book, but i didn't find any thing like "Null Layout". So I came to this board.
Sorry to say ur answer is not satisfied me.

Collapse -

Layout in Java

by CWRobin6971 In reply to Layout in Java

In most cases (I have seen various IDE's alter this) the use of 'Null' in the setLayout method causes the default layout manager to be used if no positions are stated for the added controls.

Typically this means that 'flowLayout' will be used unless the code specifies the coordinates for the control(s).

However, I have also seen the use of Null in setLayout cause one control to be placed upon another but I can't remember which development environment I was using at the time. (sorry)

Collapse -

Layout in Java

by VickyDicky In reply to Layout in Java

Poster rated this answer

Collapse -

Layout in Java

by vimalsuresh In reply to Layout in Java

Null Layout is not a layout.But you can set the position for each and every component in the container by using setBounds() method.

Collapse -

Layout in Java

by VickyDicky In reply to Layout in Java

Poster rated this answer

Collapse -

Layout in Java

by Sinan In reply to Layout in Java

Hello

A "null" layout, means that u are not using what is called a "LayoutManager" in u'r panel/component..

What this means, that the responsibility for setting up certain widgets on the screen is u'rs (so u'll need to supply an x,y value, sizes etc..).. Whenever u'll need to drag the mouse and resize the window, the widgets will stay where they were, there is no hidden "intelligence" that for example rearranges the buttons to be prettier etc..

Collapse -

Layout in Java

by VickyDicky In reply to Layout in Java

Poster rated this answer

Collapse -

Layout in Java

by VickyDicky In reply to Layout in Java

This question was closed by the author

Back to Web Development Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums