This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

.setBackground JPanel problem  RSS feed

 
Benjamin Kastelic
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everbody!

This my Frame class for tetris and i can't seem to set the background color for any of the JPanels, the color is shown only on the borders of the JPanels.




Benjamin
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the only panel I can see is this one
JPanel content = new JPanel();

and changing the background for that worked fine for me.

if these are customized panels
private static IgralnaPlata plata = new IgralnaPlata();
private static PredogledPlata predogled = new PredogledPlata();

you're the only one with the code of the customization,
so you'd be on your own with those to find out the problem.

Note: when posting code, create another program that only has code
relevant to the problem e.g. are the labels or the menuBar or actionListener
part of the problem? If not, don't include them. Then post the stripped-down
version of your program, making sure we can copy/paste/compile/run and see
the problem as you see it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!