'how to add fixed step knob in GUI using processing? [closed]

I'm developing a GUI for my Arduino Mega 2560 board. I need a fixed step knob with 4 values. I've used control P5 library but the knob range in that is continuous.

Suggest me how to get fixed step knob with code. Whenever i press knob with my mouse near the tick mark on knob it should change to that value BTW I've no idea of java programming just started learning.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source