I have a problem with a button in my program that enables the user to access a website. When I click on the link, the website opens just fine. However, when I try to go back to my program by clicking on any point of the screen of the program, I get the same website re-opened in my browser. The only way to prevent this is by clicking on the title bar of the program (thereby activating the program window without reopening the website).
Is there any way to avoid this and have the user return from the browser to the program by clicking on any point of the program screen?
Here's what the fragments of my code that handle the link look like:
void mousePressed(){
if (islname == "Jamaica"){
jamalinks.click(mouseX,mouseY);
}
}
This activates the click function in my "jamalinks" object. This function looks like this:
void click(int mx, int my) {
// Check to see if a point is inside the rectangle
if (mx > x-2 && mx < x + w && my > y-11 && my < y + h-11) {