Abstract Interface ItemSelectable in Java

0
48
digitization, transformation, binary
Spread the love

Abstract Interface ItemSelectable in Java

An interface that describes an object that has one or more items that can be selected.

The structure of the Abstract Interface ItemSelectable is given by

public abstract interface ItemSelectable {
// Instance Methods
public abstract void addItemListener (ItemListener l);
public abstract Object[] getSelectedObjects();
public abstract void removeItemListener (ItemListener l);
}

The details of the class structure are given as follows:

public abstract void addItemListener (ItemListener l);

public abstract void addItemListener (ItemListener l) method adds a listener for ItemEvent objects.

Parameter
l – The listener to be added.

public abstract Object[] getSelectedObjects();

public abstract Object[] getSelectedObjects() method returns returns an array containing Objects representing the items that are currently selected. If no items are selected, null is returned.

This method returns returns an array containing Objects representing the items that are currently selected. If no items are selected, null is returned.

public abstract void removeItemListener (ItemListener l);

public abstract void removeItemListener (ItemListener l) method removes the specified ItemListener so it will not receive ItemEvent objects.

Parameter
l – The listener to be removed.


Spread the love
READ  Class Byte in Java
I am the founder and owner of the blog - TechTravelHub.com, 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 ani01104@gamil.com

LEAVE A REPLY

Please enter your comment!
Please enter your name here