Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (woodrow73):

I've learned about the ImageIcon class, and how I can set an image to be a button's background with jb.setIcon(), or add the Image Icon to a JLabel, and put the label in a panel -- however I can't seem to be able to set a background of a JFrame to a picture, then add components ontop of that. Any ideas? The closes I've gotten, is adding a JButton straight to the JFrame, which will by default encompass the entire frame, and with an image in the button's background. Though this way there is only 1 button ontop.

OpenStudy (woodrow73):

For kicks I'll try cutting an image in 2, make each image the background of a JButton, and using flowlayout, have 0 space between the 2 buttons, so it looks like it's 1 background.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!