Textbox height in a small browser window

Posted by Fritz H on Stack Overflow See other posts from Stack Overflow or by Fritz H
Published on 2009-12-29T22:18:39Z Indexed on 2010/05/27 5:11 UTC
Read the original article Hit count: 356

Hi folks,

I have here a peculiar problem. We have a RAP application intended for use on a PDA/phone, but when it is displayed in a small browser window, all the textboxes on the form(s) are too tall (around twice the height they should be).

I've stepped through the code (The form is using GridLayout, number of columns=1, make columns equal=false) and have found that the TextSizeDetermination.getCharHeight() method returns an incorrect font size if the browser window is too small - 13px if the window is large, 26px (exactly double) if the window is too small.

Interestingly enough, it seems that if the window is too small, probeStore.containsProbeResult(font) in that method returns true and uses probeStore.getProbeResult(...).getSize().y for the font size. Otherwise, if the window is larger, it returns false and uses TextSizeEstimation.getCharHeight(...).

Does anyone have a pointer or two for getting around this?

Dialog with a properly-sized window:

alt text

Dialog with a small window:

alt text

© Stack Overflow or respective owner

Related posts about java

Related posts about eclipse