[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Java Programming question

Posted on 1997-09-09
1
Medium Priority
?
272 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
[X]
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
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

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

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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

656 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