Hi I am a bit new to Java and also to programming and in order to get beter at both the language and programming I decided to build a Monopoly Game.
I should also mention that this is my first project ever as a programmer so my way of doing things may be very well the worst way.
I am using the Swing library and each Rectangle is drawn using graphics
I am building the layout using rectangles and I was wondering if there is a way to add diferent Images to each rectangle?
Thank you
Create your panel with suitable layout, for ease I’d suggest you to use JPanels with borders rather than drawing rectangles.and follow these,
Yayy! Now your image is a swing component ! add it to a frame or panel or anything like you usually do! Probably need a repainting too , like
Do this for as many pics you want 🙂 happy coding…cheers 🙂