Well I actually have two questions.
First:
This is simple and I am missing a simple answer. First is how can I
change the background colour on a JButton? For example to colour is
currently gray but I want to change it to gree.
Second:
I am trying to figure out a way to add a JButton to a JPanel at a set
interval. Say every 10 seconds. How would I go about doing that?
Regards,
Jeff
> First is how can I
> change the background colour on a JButton?
JComponent.setOpaque(true)

Signature
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
> First:
>
> This is simple and I am missing a simple answer. First is how can I
> change the background colour on a JButton? For example to colour is
> currently gray but I want to change it to gree.
setBackground
setContentAreaFilled
> Second:
>
> I am trying to figure out a way to add a JButton to a JPanel at a set
> interval. Say every 10 seconds. How would I go about doing that?
javax.swing.Timer
Christian
Carl Smotricz - 28 Jul 2004 17:36 GMT
Oops... I answered Jeff's crosspost about the second question in another
group with a fairly complete example (hey, I just felt like it!) but
didn't think to use javax.swing.Timer . Could have saved a few lines of
code.
Thanks for reminding me of it!
-Carl-
>>First:
>>
[quoted text clipped - 13 lines]
>
> Christian