The Artima Developer Community
Sponsored Link

Java Answers Forum
maximizing java.awt.Frame

1 reply on 1 page. Most recent reply: Mar 17, 2002 9:39 AM by Kishori Sharan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
sarvesh

Posts: 8
Nickname: shasija
Registered: Mar, 2002

maximizing java.awt.Frame Posted: Mar 16, 2002 11:43 PM
Reply to this message Reply
Advertisement
plz. any one tell me how to maximize the java.awt.Frame through coding.


Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: maximizing java.awt.Frame Posted: Mar 17, 2002 9:39 AM
Reply to this message Reply
If you are using JDK v1.4 then you have a method called
setExtendedState for java.awt.Frame and you can use it as follows to maximize your frame.
yourframe f = new .... ;
f.setExtendedState ( java.awt.Frame.MAXIMIZED_BOTH ) ;

However, prior to JDK 1.4 you don't have a method to set the frame in maximized state directly. However, it is easy to accomplish.
1. Move the frame to (0,0) position.
2. set the width and height of the frame same as width and height of the screen.

// Following is the code which you need to maximize your frame prior to JDK1.4
f.move(0,0);
f.resize(java.awt.Toolkit.getDefaultToolkit().getScreenSize ());

Thanks
Kishori

Flat View: This topic has 1 reply on 1 page
Topic: What is the use of the Canvas class? Previous Topic   Next Topic Topic: Problem associating with window focusing ...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use