Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Expanding Screen horizontally

 
chandu sekhar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,

I want to expand my screen in horizontal direction ONLY. now when i click maximize button i shud expand in horizontally only not vertical....

can any body help me .....

Regards,
Chandu.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only way this might be possible is to implement WindowListener on your JFrame and then in the windowMaximized(WindowEvent w) method adjust the verticle of your JFrame to not change. The problem with this is you are going to see the JFrame maximize in both directions and then see the height change after that.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just found out the JDK 1.5 has a method, setMaximizedBounds(..) that should allow you to do what you want. If you can use 1.5, you are all set.
 
chandu sekhar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx a lot Gregg Bolinger ...

I got the solution ....

Regards,

Chandu.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic