• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

window resizing in JFrame

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I find out when my JFrame has been resized? Is there an event listener I can use for this? I have looked over the documentation but can't seem to find anything that will do this. Thanks.
------------------
- Daniel
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Daniel,
Add component listener to your JFrame as in:
....
addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
// whatever you want to do goes here. e.g.:
System.out.println("Window resized");
}
});
....

This should work. I've just tested it.
Ambrose
 
Daniel Searson
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ambrose! I needed someone to point me in the right direction.... I was looking under WindowListener in the documentation.
------------------
- Daniel
 
reply
    Bookmark Topic Watch Topic
  • New Topic