swing - What are width and height parameters for in java.awt.Component.getBaseline(int, int)? -


java api documentation doesn't have lot of information this. shed light on question?

the return value of method offset of font baseline top of component. value depends on size of component - changing width may cause text in component wrapped, , changing height cause text shift if it's aligned bottom of component.

since method used during component layout, can't use actual component size , position calculate baseline, because component being resized , repositioned during layout. therefore, size passed directly method. that's width , height parameters for.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -