I can not leave JButton on top of JLabel

3

I have JPanel , and inside it a JLabel of same size. JLabel has an icon associated with it, working as a wallpaper. When I try to put a JButton on top of the JLabel, NetBeans repositions the 2. Would anyone know to answer me why?

Thank you in advance.

    
asked by anonymous 22.05.2016 / 05:53

1 answer

4

You can add a background directly to JPanel , instead of using a JLabel because even though all swing components inherit from JComponent and therefore can be containers

22.05.2016 / 17:53