Solved

Java Frame

Posted on 1997-04-01
3
423 Views
Last Modified: 2012-06-22
How can I don't let a user of my java application resize a frame. For example I initially resize it to 300x200. But I don't want to let the user to use the maximize button for the frame to resize it.

IMPORTANT: PLEASE ANSWER:
(1)How can I detect when the user click on the maximize button?

0
Comment
Question by:mun
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
majkl earned 50 total points
ID: 1219353
if ( event happened on button)
 {
   resize(X, Y);
 // or in JDK 1.1
   setSize(X,Y);
//where are X and Y variables to hold preferred size to resize


0
 

Author Comment

by:mun
ID: 1219354
Edited text of question
0
 
LVL 2

Expert Comment

by:majkl
ID: 1219355
public boolean handleEvent(Event event) {


  if (event.id == Event.WINDOW_MAXIMIZE)
{
 .....
 stuff here to react
 ......
}

This should work. THere is only one problem. If user maximizes frame then there is no such event like WINDOW_MAXIMIZE
I have checked what generates event, when I maximize frame, but there is no such special event. Probably calls resize.
:(
 

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now