Re: How Do I Write Listeners for Resizing or Maximizing a Window?





kvnsmnsn@xxxxxxxxxxx wrote:
> I'm familiar enough with Java that I can create a <JPanel> object and
> build listeners that execute when the user clicks a mouse in it, or
> drags a mouse across it, or moves a mouse off of it. My question now
> is how do I write listeners that execute when the user resizes the
> window or maximizes the window? I've looked through the classes at
> "java.sun.com/j2se/1.5.0/docs/api/index.html", but haven't found any-
> thing that looks like it would work. Could someone give me some
> pointers on this? Any information would be greatly appreciated.

theComponent.addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent evt) {
// your code here ...
}
});

--
Eric.Sosman@xxxxxxx

.



Relevant Pages