UI Change in Swing application across platforms

133 views Asked by At

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.

2

There are 2 answers

3
JB Nizet On BEST ANSWER

Don't use the absolute layout. Layout managers are used precisely to avoid the kind of problems that you're facing.

2
COD3BOY On

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)