Bean Visibility in Java

0
47
Spread the love
  • 2
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    2
    Shares

Bean Visibility in Java
Bean Visibility in Java

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 {
//Methods
public abstract boolean avoidingGui();
public abstract void dontUseGui();
public abstract boolean needsGui();
public abstract void okToUseGui();
}
 
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 2
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    2
    Shares

LEAVE A REPLY

Please enter your comment!
Please enter your name here