How to provide auto size re-ajustment in java design i.e when vb.net form are expanded then it automatically expand the button and textfield appropiatly like nothing changed... while in java every thing messes up... Any Suggestions.

Recommended Answers

All 4 Replies

Are you using a layout manager? Layout managers ensure that your forms can re-size as required, eg when moving from one OS to nother with completely different font sizes. They come in various flavours, from very simple to you-can-control-everything-in-great-detail. See
http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html

I am doing that already..... But all of these are on fixed size not ratio based. In netbeans i have seen things in jpanel inside a jframe auto expand to fit the size of the jframe container. But when i try to code things nothing worked in eclipse. I usually use border layout with flow layout but things inside flow layout doesnt expand automatically with the ratio of jframe changes...

Yes, FlowLayout is not one to use for your requirement - it doesn't resize it just adds space before/after. Use a GridLayout, or go the whole hog and use a GridBagLayout for total control

Well let me give it a try... Thanx for your suggestion.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.