Solved

Java Frame

Posted on 1997-04-01
3
427 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why my table column Id is not passed to java object? 4 46
jsp insert to database example 2 64
Java List 4 41
Java pass by reference 3 22
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

726 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