Maximizing a JFrame by default when it comes up

I’ve been playing around with JFreeCharts for a while.  The API’s perfect; the only problem is with the amount of data with labels that I wanted to show… it didn’t just fit in the dictionary of aesthetics. Best way to delude my users was to show the stuff maximized. I wanted to show a JFrame maximized by default. Here is what I did:




Here I am assuming that you wrote a class by extending from JFrame itself. If this is not the case, you need to use the instantiated object to call the ‘getExtendedState’ method. Also use JFrame to call ‘MAXIMIZED_BOTH’:


JFrame fr = …



Have fun 😉


One Response to “Maximizing a JFrame by default when it comes up”

  1. wooow….!!! good solution, thanks 🙂

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: