difficulty level slider bar

Hello I need to implement a slider bar to my game to be able to change its difficulty level. Right now my game is about a creature appearing and disapearing in a panel every second randomly. If I'm able to click on the creature when it appear I gain a point. I need to slider so the user can change the speed of the creature appearing and disapearing.

This is what i have.

publicclass Creatureimplements ActionListener{

private GamePanel gamePanel;

privateint x = 250;

privateint y = 250;

private ImageIcon image =new ImageIcon("creature.gif");

privateboolean visible =true;

private Random random =new Random();

private Timer timer;//= new Timer(1000, this);

//private int numberOfTimeCreatureIsCaught = 0;

public Creature(GamePanel gamePanel){

this.gamePanel = gamePanel;

timer =new Timer(1000,this);

timer.start();

}

publicvoid draw(Graphics g){

if(visible){

image.paintIcon(gamePanel, g, x, y);

}

}

publicvoid actionPerformed(ActionEvent e){

int delay = random.nextInt(1000) + 1;

timer.setDelay(delay);

if(visible)

{

visible =false;

}

else{

visible =true;

x = random.nextInt(500 - 80);

y = random.nextInt(500 - 67);

}

gamePanel.repaint();

}

publicboolean isClicked(int a,int b)

{

if(a > x + 80)returnfalse;

if(a < x)returnfalse;

if(b > y + 67)returnfalse;

if(b < y)returnfalse;

returntrue;

}

}

Thank you

[3678 byte] By [Frankrama] at [2007-11-27 7:38:25]
# 1

Learn about concepts like "data model" and "controller".

Write your program in a way that it *always* knows what it should look like (model), this model is updated every second-or-so, and the GUI is then notified to update itself.

Which doesn't have anything to do with your slider problem, I know. But you haven't really told us what your problem actually is.

CeciNEstPasUnProgrammeura at 2007-7-12 19:18:59 > top of Java-index,Java Essentials,New To Java...
# 2
I'mMessage was edited by: Frankram
Frankrama at 2007-7-12 19:18:59 > top of Java-index,Java Essentials,New To Java...
# 3
> I'm> > Message was edited by: > Frankramyour what?
deAppela at 2007-7-12 19:18:59 > top of Java-index,Java Essentials,New To Java...
# 4
I really bad stutterer?
corlettka at 2007-7-12 19:18:59 > top of Java-index,Java Essentials,New To Java...