I am using netbeans to create a GUI. In gui i have used an image by inserting a jpanel in jframe. in jpanel i inserted a label and changed the label icon as my image of width 800*800.
Now the problem is i need to draw graphic objects over this image.
I am using
g.setColor(Color.RED);
g.drawRect(x-7, y+7, 15, 15);
g.fillRect(x-7, y+7, 15, 15);
The problem is , my graphic object is shown only when x,y values are more than 800 ie not lying on image coordinates. But i want to display it over my image.
How can i do it ? i believe this is happening as the graphic object for x,y<=800 is beneath the images and gets supressed