0

//Below i am trying to display a map onto my grid layout using the ImageViewer and I keep //getting a error cannot find symbol class ImageViewer. I really need to use this //ImageViewer because i need to use the x and y coordinate. I don't know any image //viewer display that does the same thing I need to also be able to make the image stretch.
//Please help me with ImageViewer

import javax.swing.*;
import java.awt.*;


public class PlotVacDisplay extends JFrame
{
public PlotVacDisplay()
{
Image plotDisplay = new ImageIcon("teritory-map.gif").getImage();

setLayout(new GridLayout(0,0,1,1));
add(new ImageViewer(plotDisplay));
}

public static void main(String[] args)
{
PlotVacDisplay frame = new PlotVacDisplay();
frame.setTitle("Plot Vacation");
frame.setLocationRelativeTo(null);//Center the frame
frame.setSize(400,400);
frame.setVisible(true);
}


}

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by darkagn
0

Is ImageViewer your own class and is it in the same package as PlotVacDisplay? If not you will have to import it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.