Register / Login
Win a copy of
Murach's Python Programming
this week in the
this forum made possible by our volunteer staff, including ...
Roel De Nijs
Stephan van Hulst
Swing / AWT / SWT
Change canvas background colour at button click
posted 4 years ago
I am developing
, which have canvas in it.
I want to change background color of canvas at one button click.
i have changed it using
c.offscreen.setColor(back); c.offscreen.fillRect(0, 0, c.getWidth(), c.getHeight()); c.repaint();
but the content of canvas which i have drawn is lost.
How to changed canvas background color of canvas.
Thanks in Advance.
It is sorta covered in the
JavaRanch Style Guide
Boost this thread!
Midlet Colours? (On forms etc..)
How does canvas, an exteded JPanel obj have methods getSize(), createImage(size.width, size.height)?
JButton is not displaying the background color
change back text of button with help of Thread.sleep()
change text area background color at run time.