Solved

Java Programming question

Posted on 1997-09-09
1
236 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 77
Core Java. What output will be and why ? 6 64
groovy example issue 10 89
eclipse formatting 6 71
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
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…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

914 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

12 Experts available now in Live!

Get 1:1 Help Now