Re: Java Application Problem
- From: Joshua Cranmer <Pidgeot18@xxxxxxxxxxxxxxxx>
- Date: Sun, 29 Apr 2007 17:29:54 GMT
Kiani wrote:
Dear All,>>>>>> repaint();
I am trying to write a program called Teaser and it suppose to push the button away when the crusor is ENTERED. The button suppose to move around in the Frame and stay in the frame.
My program works but the button does not move around and it hangs in the left corner of the frame.
Can anyone please help me to solve this problem.
Thanks in advance,
Hamid
public void mouseEntered(MouseEvent e)
{
int x = RND.nextInt(button.getLocation().x + e.getPoint().y);
int y = RND.nextInt(button.getLocation().y + e.getPoint().x);
button.setLocation (x,y);
}
});
}
If adding that line in doesn't work, then try removing the LayoutManager.
.
- References:
- Java Application Problem
- From: Kiani
- Java Application Problem
- Prev by Date: Re: exit() method in System class
- Next by Date: Re: JSlider with multiple knobbie things
- Previous by thread: Java Application Problem
- Index(es):