Solved

Java Programming question

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
micro services spring boot application error 3 191
more than one jdk and one jre 1 41
maven module vs maven project 3 23
Which non-HTML GUI front end to use with Java? 3 22
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

772 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