6.6.5. Vetoing Property Settings by Gary Cornell, Cay S. Horstmann

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required