Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Java Frame

Posted on 1997-04-01
3
Medium Priority
?
433 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 150 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Suggested Courses
Course of the Month21 days, 1 hour left to enroll

810 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