Re: Java Application Problem



Kiani wrote:
Dear All,

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);
>>>>>> repaint();
}
});
}

If adding that line in doesn't work, then try removing the LayoutManager.
.