I am new to JAVA. How can I load a picture in an applet, click on a button on that image and then a second pic loads up??
Help appreciated
John
Printable View
I am new to JAVA. How can I load a picture in an applet, click on a button on that image and then a second pic loads up??
Help appreciated
John
I believe the Applet class has a function called "getImage" or something.
But what do you mean by a "button on that image"?
Lets say for example the image contains a OK button. On want the user to click on the x and y position of the button image on the image...
Do you know the position and size of the button? If so, you only need a MouseListener on the applet and see if any mouse clicks occur within the button area. If they do, do something.
Lets say we have a IMAGE of a message box and we want the user to click on the OK button (only an image, not an actual button)... how do we determine the x and y of the button on the image?
You can't unless you do a color scan which might not be reliable.
Better if you just know where it is.