It's not a secret anymore!
The moose likes Swing / AWT / SWT and the fly likes setBackground().. and Cusor() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "setBackground().. and Cusor()" Watch "setBackground().. and Cusor()" New topic

setBackground().. and Cusor()

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
ok can you change the color of the CROSSHAIR_CUSOR?

and in this code, the setBackground method isnt working...

here is the JFrame()...



You down with OOP? Yeah you know me!
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

About the background color.
The parent is responsible for repainting the background but as you are overriding paintComponent, the backgound won't be repainted. You've got to call super.paintComponent(g).

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: setBackground().. and Cusor()
It's not a secret anymore!