I have added a background image to a Frame but when i add buttons they just hides behind the image,i am using NullLayout
for the Frame.Please help me how can i get my button upfront the background image?
Asked
Active
Viewed 202 times
0

Andrew Thompson
- 168,117
- 40
- 217
- 433

OldSchool
- 2,123
- 4
- 23
- 45
-
http://stackoverflow.com/questions/4229638/z-order-on-java-swing-components See if that helps. – Hugo Sousa Jul 05 '14 at 13:34
-
1Java GUIs might have to work on a number of platforms, on different screen resolutions & using different PLAFs. As such they are not conducive to exact placement of components. To organize the components for a robust GUI, instead [use layout managers](http://docs.oracle.com/javase/tutorial/uiswing/layout/index.html), or [combinations of them](http://stackoverflow.com/a/5630271/418556), along with layout padding & borders for [white space](http://stackoverflow.com/q/17874717/418556). – Andrew Thompson Jul 05 '14 at 13:35
-
1`I have added a background image to a Frame` how? Are you doing custom painting? Did you add a label with an icon? We are not mind readers. You should always post a proper [SSCCE](http://sscce.org/) with your question that demonstrates the problem so we don't have to guess what you are doing. So update your question with a proper SSCCE and has already been stated, don't user a null layout. If you want the button to display you add the button to a panel that does use a layout manager. – camickr Jul 05 '14 at 14:06