Results 1 to 2 of 2

Thread: Resize event?

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Resize event?

    Is there a listener that can detect when a Frame/JFrame is resized?

    I know that WindowListener can tell when a frame is minimized/restored, but I would like to know when say the dimensions of the frame go from 100,100 to 150,150. I tried overriding the setSize and setBounds methods to detect it, but that only works for explicit calls to the method, not if the user resizes the frame manually.

    Anyone have any ideas?

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    I guess i will give this a shot crptc. You could either add a ComponentListener to the JFrame or you could just add a Component adapter. I would probably go with the adapter since you are just interested in listening for one event.
    Code:
    Event Listener Methods:
    
    componentHidden(ComponentEvent evt)
    componentMoved(ComponentEvent evt)
    componentResized(ComponentEvent evt)
    componentShown(ComponentEvent evt)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width