Solved

Java Programming question

Posted on 1997-09-09
1
227 Views
Last Modified: 2010-07-27
Hi
    I am developing a Java Application. I have set Frame to
a size. I want to disable the window maximize button of the
window. How do i do it. I used this.setResizeble(false)
command which did'nt solve my problem.

Please let me know the solution.

regards
yang chen
0
Comment
Question by:yangchan
1 Comment
 
LVL 3

Accepted Solution

by:
gwalters earned 0 total points
ID: 1226717
Yes, setResizable(false) only prevents dragging the border, not maximizing the frame (a bug, I suppose).  One rather ugly, but workable, solution is to extend Frame with the following addition:

public void layout()
{
  resize(frameWidth,frameHeight);
  super.layout();
}

where frameWidth and frameHeight are the desired width and height of the Frame.  The layout() method gets called when the user maximizes the window, and then you set its size back to what you wanted.  The only problem with this solution is that it allows the Frame to be maximized, and then sets it back to normal.  Until setResizeable() works correctly, this is unavoidable.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
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 tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

757 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

20 Experts available now in Live!

Get 1:1 Help Now