Results for Interface

ItemSelectable interface in Java

January 16, 2019
ItemSelectable interface in Java
ItemSelectable interface in Java

ItemSelectable interface in Java:


ItemSelectable is an abstract interface that represents one or more items to the user and allow users to select zero or more from them.

The structure of ItemSelectable interface is given as:


public abstract interface java.awt.ItemSelectable {
//Methods
public abstract void addItemListener(ItemListener itl);
//adds ItemListener objects to be notified when an item is selected.
public abstract Object[] getSelectedObjects();
//Returns an array of selected objects or null.
public abstract void removeItemListener(ItemListener itl);
//removes ItemListener objects to be notified when an item is selected.
}
 
ItemSelectable interface in Java ItemSelectable interface in Java Reviewed by Animesh Chatterjee on January 16, 2019 Rating: 5

Adjustable interface in Java

January 16, 2019
Adjustable interface in Java
Adjustable interface in Java

Adjustable interface in Java:

Adjustable interface are applicable to the application which maintain an user adjustable numeric value by implementing several methods defined here.
The user specific value should have a maximum  and a minimum value. These value can be incremented at a time or a block at a time. A simple example of Adjustable interface is the ScrollBar of an application.
An Adjustable object generates an AdjustmentEvent that is adjusted and it maintains a list of adjustmentListener objects which may be notified when such an event occurs. Like Scollbar up and down and displays the values.

The interface Adjustable is defined as:


public abstract interface java.awt.Adjustable {
// Constants
public static final int HORIZONTAL;
public static final int VERTICAL;
//Methods
public abstract void addAdjustmentListener(AdjustmentListener l);
public abstract int getBlockIncrement();
public abstract int getMaximum();
public abstract int getMinimum();
public abstract int getOrientation();
public abstract int getUnitIncrement();
public abstract int getValue();
public abstract int getVisibleAmount();
public abstract void removeAdjustmentListener(AdjustmentListener l);
public abstract void setBlockIncrement(int b);
public abstract void setMaximum(int max);
public abstract void setMinimum(int min);
public abstract void setUnitIncrement(int u);
public abstract void setValue(int v);
public abstract void setVisibleAmount(int v);
}
 
Adjustable interface in Java Adjustable interface in Java Reviewed by Animesh Chatterjee on January 16, 2019 Rating: 5

ImageProducer interface in Java

January 14, 2019
ImageProducer interface in Java
ImageProducer interface in Java

ImageProducer Class in Java:

ImageProducer interface defines all the methods that a class must define while producing an image. This class enables us to communicate with ImageConsumer classes. Any ImageConsumer class express its interest and register itself by calling addComponent() method.

The structure of ImageProducer interface in Java is given as:


public abstract interface java.awt.image.ImageProducer{
//methods
public abstract void addConsumer(ImageConsumer ic);
public abstract void removeConsumer(ImageConsumer ic);
public abstract void requestTopDownLeftRightResend(ImageConsumer ic);
public abstract void startProduction(ImageConsumer ic);
public abstract boolean isConsumer(ImageConsumer ic);
 

ImageProducer interface in Java ImageProducer interface in Java Reviewed by Animesh Chatterjee on January 14, 2019 Rating: 5

Interface TextComponentPeer in Java

January 10, 2019
Interface TextComponentPeer in Java
TextComponentPeer in Java

Interface TextComponentPeer in Java:

The TextComponentPeer interface specifies the methods that all implementation of Abstract Window Toolkit text component must define.

The structure of the TextComponentPeer interface is given as:


public interface java.awt.peer.TextComponentPeer extends
                 java.awt.peer.ComponentPeer{
//method
public abstract int getSelectionEnd();
//returns the end position of the selected text.
public abstract int getSelectionStart()
//returns the start position of the selected text.
public abstract String getText();
//returns the text of this text component.
public abstract void select(int startIndex,int endIndex);
//selects the text in the text component from the startIndex (inclusive) and 
//endIndex(exclusive).
public abstract void setEditable(Boolean editable);
//sets the text component to be user editable if the boolean argument is true.
//if the flag is false ,sets the text component non editable so that the users 
//can not change its content.
public abstract void setText(String txt);
//sets the txt to the text component.
}
 


Interface TextComponentPeer in Java Interface TextComponentPeer in Java Reviewed by Animesh Chatterjee on January 10, 2019 Rating: 5

Interface TextAreaPeer in java

January 10, 2019
TextAreaPeer in java
TextAreaPeer in java

Interface TextAreaPeer in java:

The TextAreaPeer interface specifies the methods that all implementation of Abstract Window Toolkit TextArea must define.
The structure of the TextAreaPeer interface is given as:

public interface java.awt.peer.TextAreaPeer extends
                 java.awt.peer.TextComponentPeer{
//method
public abstract void insertText(String txt,int position);
//inserts the specified text at the specified position.
public abstract Dimension minimumSize(int rows,int cols);
//returns the minimum dimension needed for the text area.
public abstract Dimension preferredSize(int rows,int cols);
//returns the preferred dimension needed for the text area.
public abstract void replaceText(String txt,inst start,int end);
//replaces the text from the start(inclusive) index to the end
//(exclusive) index with the new text specified.
}
 

Interface TextAreaPeer in java Interface TextAreaPeer in java Reviewed by Animesh Chatterjee on January 10, 2019 Rating: 5

Interface ScrollBarPeer in Java

January 10, 2019
ScrollBarPeer in Java
ScrollBarPeer in Java

ScrollBarPeer in Java:

The ScrollBarPeer interface specifies the methods that all implementation of Abstract Window Toolkit Scroll bar must define.

The structure of the ScrollBarPeer interface is given as:



public interface java.awt.peer.ScrollBarPeer extends
                 java.awt.peer.ComponentPeer{
//method
public abstract void setLineIncrement(int l);
//sets the line increment of the scroll bar.The line increment
//is the value that is added to or subtracted from the value
//of the scroll bar when the user hits the line down or line up
// the gadget.
public abstract void setPageIncrement(int l);
//sets the page increment of the scroll bar.The page increment is the 
//value that is added to or subtracted from the value of 
//the scrollbar when the user hits the page down or page up the gadget.
public abstract void setValue(int value);
//sets the value of the scrollbar to the specified value.
public abstract void setValue(int value,int visible,int min,int max);
//sets several parameters of the scroll bar simultaneously.
}
 

Interface ScrollBarPeer in Java Interface ScrollBarPeer in Java Reviewed by Animesh Chatterjee on January 10, 2019 Rating: 5

Interface PanelPeer in Java

January 10, 2019
Interface PanelPeer in Java
Interface PanelPeer in Java

Interface PanelPeer in Java:

The PanelPeer interface specifies the methods that all implementation of Abstract Window Toolkit Panel must define.

The structure of interface PanelPeer is given as:


public interface java.awt.peer.PanelPeer extends
                 java.awt.peer.ContainerPeer{
}
 
Interface PanelPeer in Java Interface PanelPeer in Java Reviewed by Animesh Chatterjee on January 10, 2019 Rating: 5

Interface MenuPeer in java

January 10, 2019
Interface MenuPeer in java
Interface MenuPeer in java

Interface MenuPeer in java:

The MenuPeer interface specifies the specifies the methods that all implementation of Abstract Window Toolkit menu item must define.

The structure of MenuPeer interface is given as:


public interface java.awt.peer.MenuPeer extends
                 java.awt.peer.ManuItemPeer{

//methods
public abstract void addItem(MenuItem item);
//adds the specified menu item to this menu.
public abstract void addSeparator();
//adds a separator line to this menu.
public abstract void delItem(int index);
//deletes the item at the specified index from the menu.
}
 
Interface MenuPeer in java Interface MenuPeer in java Reviewed by Animesh Chatterjee on January 10, 2019 Rating: 5

Interface MenuItemPeer in Java

January 10, 2019
MenuItemPeer in Java
MenuItemPeer in Java

MenuItemPeer in Java:

The MenuItemPeer interface specifies the methods that all implementation of Abstract Window Toolkit menu item must define.

The structure of interface MenuItemPeer is given as:


public interface java.awt.peer.MenuItemPeer extends 
                 java.awt.peer.ManuComponentPeer{
//methods:
public abstract void disable();
//disables this menu item.It can no longer be selected by users.
public abstract void enable();
//enables this menu ite,.It can be selected by users.
public abstract void setLabel(String label);
//changes the menu item's label to be the specified String.
}
 

Interface MenuItemPeer in Java Interface MenuItemPeer in Java Reviewed by Animesh Chatterjee on January 10, 2019 Rating: 5

Interface MenuComponentPeer in Java

January 10, 2019
MenuComponentPeer in Java
MenuComponentPeer in Java

MenuComponentPeer in Java:

The MenuComponentPeer interface specifies the methods that all implementation of Abstract Window Toolkit menu components must define.

The structure of MenuComponentPeer is given as:


public interface java.awt.peer.MenuComponentPeer{
//method
public abstract void dispose();
//dispose of the menu component peer and any other resource used by it.
}
 
Interface MenuComponentPeer in Java Interface MenuComponentPeer in Java Reviewed by Animesh Chatterjee on January 10, 2019 Rating: 5

Interface MenuBarPeer in Java

January 10, 2019
Interface MenuBarPeer in Java
Interface MenuBarPeer in Java

Interface MenuBarPeer in Java:

The MenuBarPeer interface specifies the methods that all implementation of Abstract Window Toolkit menubar must define.

The interface structure of MenuBarPeer is given by:

public interface java.awt.peer.MenuBarPeer extends java.awt.peer.ManuComponentPeer{
//methods
public abstract void addHelpManu(Menu m);
//sets the help menu on the menu bar to be the specified menu
public abstract void addMenu(Menu m);
//adds the specified menu to the menu bar.
public abstract void delMenu(int index);
//remove the menu located at the specified index from the menu bar.
}
 
Interface MenuBarPeer in Java Interface MenuBarPeer in Java Reviewed by Animesh Chatterjee on January 10, 2019 Rating: 5

ActionListener in Java

January 07, 2019
ActionListener in Java
ActionListener in Java

ActionListener in Java:

ActionListener interface defines the method that an object must implement to listen for action events on AWT components.When as ActionEvent occurs ,an AWT component notifies it's registered ActionListener objects by invoking the actionPerformed() methods.

The structure of ActionListener interface is given as:


public abstract interface java.awt.event.ActionListener extends java.util.EventListener{
//method
public abstract void actionPerformed(ActionEvent e);
}
 
ActionListener in Java ActionListener in Java Reviewed by Animesh Chatterjee on January 07, 2019 Rating: 5

ComponentAdapter in Java

January 07, 2019
ComponentAdapter in Java
ComponentAdapter in Java

ComponentAdapter in Java:

ComponentAdapter class is an implementation of ComponentListener interface containing empty bodies of each methods of the ComponentListener interface. If we do not wish to write every methods of ComponentListener interface in our class,ComponentAdapter class helps in that aspect.

The structure of interface ComponentAdapter is given as:


public abstract class java.awt.event.ComponentAdapter  extends java.lang.Object
implements java.awt.event.ContainerListener
implements java.util.EventListener{
//constructor
public ComponentAdapter();
//methods
public void componentHidden(ComponentEvent e);
public void componentMoved(ComponentEvent e);
public void componentResized(ComponentEvent e);
public void componentShown(ComponentEvent e);
}
 
ComponentAdapter in Java ComponentAdapter in Java Reviewed by Animesh Chatterjee on January 07, 2019 Rating: 5

ContainerAdapter in Java

January 07, 2019
ContainerAdapter in Java
ContainerAdapter in Java

ContainerAdapter in Java:

ContainerAdapter class is an implementation of ContainerListener interface containing empty bodies of each methods of the ContainerListener interface. If we do not wish to write every methods of ContainerListener interface in our class,ContainerAdapter class helps in that aspect.

The structure of interface ContainerAdapter is given as:

public abstract class java.awt.event.ContainerAdapter extends java.lang.Object
                                                      implements java.awt.event.ContainerListener {
//constructor
public ContainerAdapter();
//methods
public void componentAdded(ContainerEvent e);
public void componentRemoved(ContainerEvent e);
}
 
ContainerAdapter in Java ContainerAdapter in Java Reviewed by Animesh Chatterjee on January 07, 2019 Rating: 5

All About Map Interface in Collection in Java

December 20, 2018

All About Map Interface in Collection in Java

The Map interface maps unique key elements to their corresponding values.Map interface allows us to view the elements of a collection as set of keys,collection of values and the mapping of key value pair.If we remove a key from the Map, the corresponding value also will be removed.

The method defined in Map interface is given as:


clear();//removes all the mapping from a map.
containsKey(Object key);// returns true if the specified value matches with one or more 
//keys in the Map interface.
containsValue(Object value);// returns true if the specified value matches with one or more 
//values in the Map interface.
entrySet();//returns the key value pair contained in the Map
equals(Object obj);//returns true if the specified object maps with an object of a Map interface.
get(Object key);//returns the value which is mapped to the specified key.
isEmpty();//returns true if a Map contains no key value mapping.
keySet();//returns the keys in a Map.
put(Object key,Object value);Maps the specified key with the value.
putAll();//copies all the specified key value pairs from a specified Map to the Map with which we are 
//currently working
remove(Object key);Removes the specified key from the Map, automatically the value will be removed.
size();//returns the number of key value mapping available in a Map.
 
All About Map Interface in Collection in Java All About Map Interface in Collection in Java Reviewed by Animesh Chatterjee on December 20, 2018 Rating: 5

All About the SortedSet Interface in Collection In java

December 19, 2018

The SortedSet interface is used to sort elements of a collection in ascending order.The SortedSet interface extends Set interface which in turn extends Collection Interface.The SortedSet interface does not allow duplicate elements in a Set.

The below methods are extra apart from Set Interface:

comparator();// Returns the comparator object.If the elements in the SortedSort are in ascending order
//then it returns null.
first();//Returns the first element of the SortedSet.
headSet(Object toElement);//Returns the number of elements less than that of the elements specified
//using toElement object.The elements are returned from the SortedSet.
last();//returns the last element from the SortedSet.
subSet(Object fromElement,Object toElement);//returns the elements between the range specified.
tailSet(Object fromElement);//returns the elements from a SortedSet that are greater than or equal 
//to fromElement.
 
All About the SortedSet Interface in Collection In java All About the SortedSet Interface in Collection In java Reviewed by Animesh Chatterjee on December 19, 2018 Rating: 5

All About INTERFACE ListPeer in AWT in Java

November 16, 2018

The scrolling ListPeer Interface specifies the methods that all implementations of Abstract Window Toolkit must define while working with lists.
The structure of interface ListPeer is given as:

public interface java.awt.peer.ListPeer extends java.awt.peer.ComponentPeer{
//Methods
public abstract void addItem(String item,int index);
public abstract void clear();
public abstract void delItems(int start,int end);
public abstract void delselect(int index);
public abstract void makeVisible(int index);
public abstract void select(int index);
public abstract void setMultipleselections(boolean v);
public abstract int[] getSelectedIndexes();
public abstract Dimension minimumSize(int v);
public abstract Dimension preferredSize(int v);
}
 

All About INTERFACE ListPeer in AWT in Java All About INTERFACE ListPeer in AWT in Java Reviewed by Animesh Chatterjee on November 16, 2018 Rating: 5

All About INTERFACE LabelPeer in AWT in Java

November 02, 2018
The LabelPeer Interface specifies the methods that all implementations of Abstract Window Toolkit must define while working with label.
The structure of interface LabelPeer is given as:

public interface java.awt.peer.LabelPeer extends java.awt.peer.ComponentPeer{
//Methods
public abstract void setAlignment(int alignment);
//sets the alignment for this label to the specified alignment.
public abstract void setText(String label);
//sets the text for this label to the specified text.
}
 
All About INTERFACE LabelPeer in AWT in Java All About INTERFACE LabelPeer in AWT in Java Reviewed by Animesh Chatterjee on November 02, 2018 Rating: 5

All About INTERFACE FramePeer in AWT in Java

November 02, 2018
The FramePeer Interface specifies the methods that all implementations of Abstract Window Toolkit must define while working with frame.
The structure of interface FramePeer is given as:

public interface java.awt.peer.FramePeer extends java.awt.peer.WindowPeer{
//Methods
public abstract void setCursor(int cursorType);
public abstract void setIconImage(Image img);
public abstract void setMenuBar(ManuBar mb);
public abstract void setResizeable(boolean resizeable);
public abstract void setTitle(String title);
}
 
All About INTERFACE FramePeer in AWT in Java All About INTERFACE FramePeer in AWT in Java Reviewed by Animesh Chatterjee on November 02, 2018 Rating: 5

All About INTERFACE FileDialogPeer in AWT in Java

November 02, 2018
The FileDialogPeer Interface specifies the methods that all implementations of Abstract Window Toolkit must define while working with Dialog window.
The structure of interface DialogPeer is given as:

public interface java.awt.peer.FileDialogPeer extends java.awt.peer.DialogPeer{
//Methods
public abstract void setDirectory(String dir);
//sets the directory of the file dialog window to be the specified directory.
public abstract void setFileNameFilter(FileNameFilter filter);
//sets the filename filter for this file dialog windows to the specified filter.
}
 
All About INTERFACE FileDialogPeer in AWT in Java All About INTERFACE FileDialogPeer in AWT in Java Reviewed by Animesh Chatterjee on November 02, 2018 Rating: 5
Powered by Blogger.