hy
I am new to this programm.:)
how do I give a button a red color?
and could somebody give me some tips for this:
I have to make 2 buttons that go from left to right at the same time by clicking on one of them.
Tnx already.:)
Printable View
hy
I am new to this programm.:)
how do I give a button a red color?
and could somebody give me some tips for this:
I have to make 2 buttons that go from left to right at the same time by clicking on one of them.
Tnx already.:)
try button.setBackground( Color.RED )
also dont forget to- import static java.awt.Color; --in your header first of the code above wont work
apologies - I am a newbie trying to help, i had a similar problem myself and i couldn't get setBackground(Color.Red) to work because i hadn't anything in the import section that goes at the top, so added "import java.awt.Color;" and it worked, but I may have done the wrong thing and got lucky, I do apologise. I mistakenly put static in the post as i got it mixed up with another import i regularly use import static java.lang.Sytem.out; I should be more careful.....
this for the answers guys,
@Fubarable
well first you pick 2 buttons. Then I have to make them move to the right side for a bit.
they should do this by clicking on them.