# Problem with ControlP5, Scrollablelist and align method

**URL:** <https://discourse.processing.org/t/problem-with-controlp5-scrollablelist-and-align-method/1808>\
**Category:** Coding Questions\
**Created:** [July 16, 2018, 8:31am UTC](https://discourse.processing.org/t/problem-with-controlp5-scrollablelist-and-align-method/1808 "2018-07-16T08:31:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [July 16, 2018, 8:31am UTC](https://discourse.processing.org/t/problem-with-controlp5-scrollablelist-and-align-method/1808/1 "2018-07-16T08:31:51Z")

</div>

Hi everyone,

I have trouble aligning text in a scrollable list in the ControlP5 library.

Here is an example :

```auto
import controlP5.*;
import java.util.*;

ControlP5 cp5;

void setup() {
  size(400, 400);
  cp5 = new ControlP5(this);
  List l = Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h");

  cp5.addScrollableList("dropdown")
     .setPosition(100, 100)
     .setSize(200, 100)
     .setBarHeight(20)
     .setItemHeight(20)
     .addItems(l);
     
  cp5.getController("dropdown").getCaptionLabel().setColor(color(255,0,0));
  cp5.getController("dropdown").getCaptionLabel().alignX(ControlP5.RIGHT);
}

void draw() {
  background(240);
}

```

If you run it, you can see that the color of the text is red (so “setColor” works) but the alignement stays left…

Am I doing something wrong or is it just not supported by the library ?

Thanks in advance for your time,

Have a nice day =)

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [July 17, 2018, 2:46pm UTC](https://discourse.processing.org/t/problem-with-controlp5-scrollablelist-and-align-method/1808/2 "2018-07-17T14:46:27Z")

</div>

It works with matrix but doesn’t with scrollableList for some reason.

```auto
  cp5 = new ControlP5(this);
  cp5.addMatrix("mm")
     .setPosition(50, 50)
     .setGrid(9, 9)
     .getCaptionLabel()
     .setColor(#FF00FF)
     .alignX(RIGHT);
  
  cp5.addScrollableList("dd")
     .setPosition(50, 200)
     .addItems(Arrays.asList("a", "b", "c"))
     .getCaptionLabel()
     .setColor(#FF00FF)
     .alignX(RIGHT);

```
