aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Default windows font size effects layout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Default windows font size effects layout" Watch "Default windows font size effects layout" New topic
Author

Default windows font size effects layout

Kelly Wiles
Greenhorn

Joined: Jan 22, 2013
Posts: 2
I have looked on Google but can not find answer or I can't word it correctly to find it.

When I develop a SWT application my computers desktop font size is set to windows 7 default size.
I mainly use Form layout with Grid layout for some windows.

My problem is that when the program is run on a windows system and the user has increased the font size of the desktop my layouts are all messed up.
If I go into windows settings and reset the font back to the default size everything looks fine again.

I have tried using setFont on all the widgets but it does not effect this problem.

What can I do about desktop font size being changed from the default?
Have attached an example image of the problem.

Thanks



[Thumbnail for example.jpg]

Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 1939
    
  28
I've not used SWT and also without seeing the code this is all a bit of a guess but I suspect the problem is because you are specifying the exact dialog size rather than letting the dialog auto calculate the ideal size based on the components preferred sizes. In Swing you would do this using pack(), not sure what the equivalent is for SWT.
Kelly Wiles
Greenhorn

Joined: Jan 22, 2013
Posts: 2
I tried what you suggested and here are the results.

I use a simpler screen than the configuration screen shown but still has the same problem.

The first image login1.png is how it should look.
The second image login2.png is after I removed the setSize call.
And the third image login3.png shows what happens after I add the pack() call.

I use Window Builder Pro and that GUI builder does not add pack() calls to the code generated.

If using pack() is part of the answer then I am doing something else wrong.



[login1.png]


[Thumbnail for login2.png]


[login3.png]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Default windows font size effects layout
 
Similar Threads
Layout managers and JNLP...do they blend?
Need to change font for all controls in an eclipse RCP application
Help needed (.tar.gz file)
Default font is bigger on Mac/Linux than Windows
working with Fonts