Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Java Programming question

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

861 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