Bean Visibility in Java

digitization, transformation, binary
Spread the love

Bean Visibility in Java
Bean Visibility in Java

Table of Contents

Bean Visibility in Java:

The interface Visibility needs to be implemented by an advanced bean irrespective of a GUI. This interface defines methods that allow the bean to specify if it requires a GUI and it also allows the environment to notify the bean about the availability of a GUI.
So there might be two cases:
  • If a Bean need GUI:

the method needsGui() returns true. If a bean is executing without a GUI,avoidingGui() should return true

  • If a Bean does not need GUI:

the method needsGui() returns false. So if no GUI is available the bean is notified with dontUseGui() and if a GUI is available the bean is notified with okToUseGui() The Structure of Visibility interface is given as:

public abstract interface java.beans.Visibility {
public abstract boolean avoidingGui();
public abstract void dontUseGui();
public abstract boolean needsGui();
public abstract void okToUseGui();

Spread the love
READ  Class ObjectStreamClass in Java
I am the founder and owner of the blog -, always love to share knowledge on test automation,tools,techniques and tips.I am a passionate coder of Java and VBScript.I also publish articles on Travel ideas and great honeymoon destinations.Apart from these, I am a gear-head,love to drive across India. I have shared lots of articles here on How to travel several parts of India.Customization of cars aka car modification is my another hobby.Get in touch with me on


Please enter your comment!
Please enter your name here