0

I'm trying to put a button on top of an image, but it's not working.

GridLayout frame = new GridLayout();
setLayout (frame);

panelOne.add(background);
btn.setLocation (200, 200);
panelOne.add(btn);
add(panelOne);
Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
  • Essentially, my image is a background, and I want to put a JButton on top of it. – developer067 Dec 22 '17 at 03:01
  • 1
    First and foremost -- learn how the layout managers work, because you're very confused about GridLayout and how it works. Next, if you are still confused on how to fix your problem, then next, learn how to create and post a decent [mcve]. – Hovercraft Full Of Eels Dec 22 '17 at 03:02
  • 1
    [Further reading](https://www.google.com/search?q=site%3Astackoverflow.com+java+swing+put+button+on+top+of+image) – Hovercraft Full Of Eels Dec 22 '17 at 03:05

0 Answers0