javax.swing.plaf

Class ListUI

    • Constructor Detail

      • ListUI

        public ListUI()
    • Method Detail

      • locationToIndex

        public abstract int locationToIndex(JList list,
                          Point location)
        Returns the cell index in the specified JList closest to the given location in the list's coordinate system. To determine if the cell actually contains the specified location, compare the point against the cell's bounds, as provided by getCellBounds. This method returns -1 if the list's model is empty.
        Parameters:
        list - the list
        location - the coordinates of the point
        Returns:
        the cell index closest to the given location, or -1
        Throws:
        NullPointerException - if location is null
      • indexToLocation

        public abstract Point indexToLocation(JList list,
                            int index)
        Returns the origin in the given JList, of the specified item, in the list's coordinate system. Returns null if the index isn't valid.
        Parameters:
        list - the list
        index - the cell index
        Returns:
        the origin of the cell, or null
      • getCellBounds

        public abstract Rectangle getCellBounds(JList list,
                              int index1,
                              int index2)
        Returns the bounding rectangle, in the given list's coordinate system, for the range of cells specified by the two indices. The indices can be supplied in any order.

        If the smaller index is outside the list's range of cells, this method returns null. If the smaller index is valid, but the larger index is outside the list's range, the bounds of just the first index is returned. Otherwise, the bounds of the valid range is returned.

        Parameters:
        list - the list
        index1 - the first index in the range
        index2 - the second index in the range
        Returns:
        the bounding rectangle for the range of cells, or null

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/swing/plaf/listui.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, ListUI

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut