Overlay a JButton over JLabel in Java Swing?
问题 Is it possible to overlay a Button over a Label in Swing? For example, if have a JLabel with image and no text, and i want to overlay my button over this JLabel. Label is defined something like: myLabel = new javax.swing.JLabel(new ImageIcon( myPicture )); If not, then any ideas how can i realize this, thank you. EDIT: Actually i read about adding JPanel to a JLabel, when i add a Panel with button layout, it compiles fine but nothing is visible, just the JLabel with image UPDATE: As suggested