Here is my rectangle shape code:

```
 if(rect){
    gphcs.setColor(Color.BLUE);
    if(orangeshp)
        gphcs.setColor(Color.ORANGE);
    if(greenshp)
        gphcs.setColor(Color.GREEN);
    gphcs.fillRect(20,35,100,30);
}

```

I want to to add a resizing slider in order to change size of the rectangle.

Here is a sample pic of the slider I want to add:

![enter image description here](https://i.stack.imgur.com/tT6bv.png)

I just need any simple code to create this slider.

Thanks for your time..