Skip to content
February 8, 2009 / Narayan

Frame Height in Applet

Actually the the height we defined for JFrame may differ as what we assume . In windows JFrame uses its height including it’s title bar and the bottom border of window frame.It can be illustrated below :
Let’s we code the JFrame size.

In syntax: JFrame_var_name.setSize(Width_px, Height_px);
foreg.  xxx.setSize(100, 100);

In this code we can see that we defined a JFrame size to 100px width and 100px height. But actually some programmer feels problem on the height of the windows size , even we had declare the size of the JFrame to 100. The JFrame height includes the title bar and it’s bottom liner height.
title1
bottom

The above picture explains that the window title bar occupies 23px of JFrame and the bottom border occupies 4px of JFrame window.According to our code that we have declared about 100px of height of JFrame. Actually the 73px of the declared height is only for the displaying the code.Others are occupied by the title bar and bottom bar about 23px and 4px

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: