Website in applet help-actionListener

import java.applet.*;

import java.awt.*;

import java.awt.event.*;

publicclass MainIndexextends Appletimplements MouseListener{

Image header;

Image home;

Image halo;

Image java;

publicvoid init(){

header = getImage(getCodeBase(),"header.png");

home = getImage(getCodeBase(),"on.png");

halo = getImage(getCodeBase(),"off.png");

java = getImage(getCodeBase(),"off.png");

addMouseListener(halo);

}

publicvoid mouseClicked(MouseEvent e){

}

publicvoid paint(Graphics g){

g.drawImage(header, 1, 1,this);

g.drawRect(0, 0, getSize().width - 1, getSize().height - 1);

g.drawRect(0, 101, getSize().width - 1, getSize().height - 1);

g.drawImage(home, 370, 77,this);

g.drawImage(halo, 447, 77,this);

g.drawImage(java, 524, 77,this);

g.drawString("Ben Sprinkle's Website", 4, 75);

String body ="I am Ben Sprinkle and this is where I share my interests with other people.";

g.drawString(body, 4, 115);

showStatus("Ben Sprinkle's Website");

}

publicvoid rePaintHaloTab(Graphics g){

}

publicvoid rePaintJavaTab(Graphics g){

}

publicvoid stop(){

}

}

Is it possible to add action listeners to my image? I need help.

[2645 byte] By [Ben_Sprinklea] at [2007-11-26 17:34:36]
# 1
Bump.
Ben_Sprinklea at 2007-7-9 0:02:36 > top of Java-index,Java Essentials,New To Java...
# 2
No, it is not. What do you want to do?
Lajma at 2007-7-9 0:02:36 > top of Java-index,Java Essentials,New To Java...
# 3
I want to use either a Label, Button, or Image that can have actions on it like click handlers etc.For buttons and labels I wanted to know how to assign a image to it that will replace it. Like an image-button.
Ben_Sprinklea at 2007-7-9 0:02:36 > top of Java-index,Java Essentials,New To Java...
# 4
No one knows?
Ben_Sprinklea at 2007-7-9 0:02:36 > top of Java-index,Java Essentials,New To Java...
# 5
Yes, I know, but I acctually did think that you were joking...Read the API for JButton, JLabel, JApplet and also read up on http://java.sun.com/docs/books/tutorial/uiswing/components/button.htmlJButton for instance have a constructor that takes an Icon as parameter.
Lajma at 2007-7-9 0:02:36 > top of Java-index,Java Essentials,New To Java...
# 6
Thanks but I do not need a picture icon inside the button, I need the picture to BE the button. :)
Ben_Sprinklea at 2007-7-9 0:02:36 > top of Java-index,Java Essentials,New To Java...
# 7
Can you do this in Swing? JApplet, J****?
DrLaszloJamfa at 2007-7-9 0:02:36 > top of Java-index,Java Essentials,New To Java...