how would i randomly position a button on a certain portion of the frame. I have tried to set two variables x and y which are random but it doesn't work, the button disappears i'm guessing it is positioned off the screen.
Thi sis what i have tried:
int y = ran.nextInt(0 - frame.getHeight());
int x = ran.nextInt(0 - frame.getHeight());
I am also getting an error 'AWT-EventQueue -0'
Thanks