Button on a touchscreen

Sorry I couldn’t respond sooner,
I use windows 8.1 and processing 3.3.7 on a 2 in 1 laptop.
here is my code for the buttons:
void appBar() {
if (bar==true) {
noStroke();
//stroke(r, g, b);
//strokeWeight(10);
fill(150);
rect(0, 0, width, 100);
textAlign(CENTER, BOTTOM);
fill(0);
textSize(60);
text(“Aidan Land Ink”, width/2, 100);
fill(255, 0, 0);
rect(0, 0, 100, 100);
fill(0, 255, 0);
rect(100, 0, 100, 100);
fill(0, 0, 255);
rect(200, 0, 100, 100);
fill(0);
rect(300, 0, 100, 100);
if (mouseX<400&&mouseY<100&&mousePressed) {
r=red(get(mouseX, mouseY));
g=green(get(mouseX, mouseY));
b=blue(get(mouseX, mouseY));
}
if (e==false) {
fill(r, g, b);
} else {
fill(255);
}
if (s==true) {
ellipse(450, 50, 100, 100);
} else {
ellipse(450, 50, 50, 50);
}
if (mouseY<100&&mouseX>400&&mouseX<500&&mousePressed) {
s=!s;
delay(100);
}

fill(255);
ellipse(550, 50, 100, 100);
if (mouseY<100&&mouseX>500&&mouseX<600&&mousePressed) {
  e=!e;
  delay(100);
}
if (mouseX>600&&mouseX<displayWidth-100&&mouseY<100&&red(get(mouseX, mouseY))==0&&mousePressed) {
  launch(path[0]);
  save("data\\saved.png");
  exit();
}

}else{
noStroke();
fill(255);
rect(0,0,width,100);
}
}

I then call the appbar() command in my draw loop.
I did look at the links in your reply and the TouchEvent looked like something that would work, but I couldn’t figure out how to use them in processing.(I’m no expert either)
I hope some of this helps.