• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing bgcolor of JOptionPane

 
Jain Neeraj
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody has any idea How can i change the background color of a JOptionPane?
Thanks
 
Sayed Ibrahim Hashimi
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't the setBackground(Color) method work?
If youre talking about one of the dialogs that is displayed by one of the methods:
showXXXDialog(..) that's a different question.
 
Jain Neeraj
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes definitely i'm looking for that, any suggestions, sorry if asked sth differently earlier...
Thanks for the quick reply
 
Sayed Ibrahim Hashimi
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, here is a code snippet:

In your case you want to call
pane.setBackground(Color)
I got this from the Docs for the JOptionPane class so if you want to look at the rest of it you can find it there.
Hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic