# Mouse over in Control p5 scrollablelist

**URL:** <https://discourse.processing.org/t/mouse-over-in-control-p5-scrollablelist/8950>\
**Category:** Libraries\
**Created:** [March 4, 2019, 11:21pm UTC](https://discourse.processing.org/t/mouse-over-in-control-p5-scrollablelist/8950 "2019-03-04T23:21:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![larry](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@larry](https://discourse.processing.org/u/larry)\
**Post date:** [March 4, 2019, 11:21pm UTC](https://discourse.processing.org/t/mouse-over-in-control-p5-scrollablelist/8950/1 "2019-03-04T23:21:45Z")

</div>

Hi, I’m trying to access label names using mouseover in a scrollable list, I have found the following but can’t get it to work - can anyone show me a working example of this?

Thanks

```auto
public class MyScrollableList extends ScrollableList {
  // the constructor is required, since there is no constructor in 
  // ScrollableList that allows for implicit calling 
  MyScrollableList (ControlP5 controlp5, String name) {
    super(controlp5, name);
  }
 
  // returns -1 if nothing is selected
  int getHover() {
    return itemHover;
  }
}
 
// ...
 
MyScrollableList myScrollableList = null
myScrollableList = new MyScrollableList (cp5, "myScrollableList");
myScrollableList.setPosition(10, 10)
                .setSize(280, 300)
                .setItemHeight(15);
 
// ...
 
int hoveredItem = myScrollableList .getHover();
if (hoveredItem >= 0) {
  Map<String , Object> item = myScrollableList getItem(hoveredItem);
  println(item.get("name").toString());
}

```
