Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

block the maximization of a window?  RSS feed

 
Lars Tode
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
How can I block the maximization of a window?
I've create a window with:
--snip--
super("");
setBounds(1,1, 200,300);
--snip--
I don't want that the user can change the size of this window.
Does anyone has a idea, how I can do this?
thx
bb
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay... ummm... first, bloodybastard... you need to re-register with a user name that follows the guidelines in the Official JavaRanch UserName Guide. Your user name has to be in the form "First Name" + space + "Last Name", and your user name cannot be obviously fake.

To answer your question, try


-Nate
 
Lars Tode
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
how you can see, I have change my nickname in my realname
Sorry, that I haven't answerd on your reply before, I normaly get a email when someone answerd my threads (in other forum).
But lets go back.
Thank you very much, for help! Do this work on swing, too? Is it possible to say "the height is only resizable"?
thanks
LT
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it works in Swing.

No, you can't specify restrictions on resize this way in a Frame or JFrame... but you can restrict it using a ComponentListener something like -


-Nate
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!