i have written a code which displays an image in a tabbed pane. My code lookes like this
class tracker extends JPanel
{
String imageFile = "areal view.JPG";
public tracker()
{
super();
}
public tracker(String image)
{
super();
this.imageFile = image;
}
public tracker(LayoutManager layout)
{
super(layout);
}
public void paintComponent(Graphics g)
{
/*create image icon to get image*/
ImageIcon imageicon = new ImageIcon(getClass().getResource(imageFile));
Image image = imageicon.getImage();
/*Draw image on the panel*/
super.paintComponent(g);
if (image != null)
g.drawImage(image, 100, 50, 700, 600, this);
//g.drawImage(image, 100, 50, getWidth(), getHeight(), this);
}
}
Well then i need to place a marker on certain position of the image .. How to place a marker on it.. ?
I tried Googling it, but came to know that it only works with Android and in web applications. Is it true??
I don't believe with it, as Java does all!!!!!...
Once i came-forth with the BufferedImage
concept but it doesn't work so..
Any kind of help regarding placing a marker within the image is welcome....