O'Reilly logo

Core Java® Volume II—Advanced Features, Ninth Edition by Gary Cornell, Cay S. Horstmann

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6.6.5. Vetoing Property Settings

Now that you have seen all these veto exceptions, you might wonder how your frames can issue a veto. The JInternalFrame class uses a general JavaBeans mechanism for monitoring the setting of properties. We discuss this mechanism in full detail in Chapter 8. For now, we just want to show you how your frames can veto requests for property changes.

Frames don’t usually want to use a veto to protest iconization or loss of focus, but it is very common for frames to check whether it is OK to close them. You can close a frame with the setClosed method of the JInternalFrame class. Since the method is vetoable, it calls all registered vetoable change listeners before proceeding to make the change. That gives each of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required