My Swing Application's GUI is built using Window Builder Pro
GUI editor. Layouts used are MigLayout
and AbsoluteLayout
. Application is developed using Windows
Machine, So UI is well aligned and neat in Windows
, but when I run the same application in Mac OS X
, Application's Frame
couldn't accommodate the components inside its bounds
. I mean, size of Components
inside the frame changes across platforms. When I give extra space(Increased frame bounds), it looks nice in Mac
but weird in Windows
. Is there any way to have Frame
or Panel
to grow with respect to its contents or Components
.
Asked
Active
Viewed 131 times
2
2 Answers
4
Don't use the absolute layout. Layout managers are used precisely to avoid the kind of problems that you're facing.

JB Nizet
- 678,734
- 91
- 1,224
- 1,255
-
+1, Exactly, seems like you just stole my answer, hehe just kidding :-) Regards – nIcE cOw Jan 31 '12 at 08:29
-
How about `MigLayout`? I have used it everywhere. Are they similar to `Absolute Layout`? – Ahamed Jan 31 '12 at 09:11
-
If it suits your needs, go with it. It's a well-known layout manager. – JB Nizet Jan 31 '12 at 09:15
1
Assuming you used AbsoluteLayout
because none of the existing layout managers suited your needs,
Have a look at Creating a Custom Layout Manager and use one instead of AbsoluteLayout.(Before that make sure none of the present layout managers suit your need)

COD3BOY
- 11,964
- 1
- 38
- 56
-
- I dont' like the color of my car; - Here's a brief guide on how to build your own car paint factory so you can create the color you want! – Denis Tulskiy Jan 31 '12 at 08:36
-
@DenisTulskiy I specified, Do this only in case you dont want to use ANY OF THE EXISTING COLOUR for your car :) Do you have any other option?? – COD3BOY Jan 31 '12 at 08:40