I am currently working on a java project, I’m using javaswing in netbeans. I have a housemappicture set as a background on a Jlabel, but I want to put Jbuttons on each room. Is there anyway I can do it? If I put a Jbutton on the Jlabel the label just moved away
Asked
Active
Viewed 18 times
0
-
Moves*, and I’m just a beginner so I’m not very familiar with programming – Begin Jan 13 '20 at 18:41
-
Best not to use a JLabel as a container but rather draw the image in a JPanel and put your buttons on the panel. A JPanel makes for a much better *container* than a JLabel. – Hovercraft Full Of Eels Jan 13 '20 at 18:42
-
And yes, this involves code that is more complex than dragging and dropping a component in the GUI builder. Best to jump in with both feet and learn. – Hovercraft Full Of Eels Jan 13 '20 at 18:49