estou entrando agora na interface gráfica e queria saber como colocar uma imagem de fundo em um Label. jha até peguei um bom exemplo de como fazer. A dúvida é:
public void paintComponent(Graphics g) {
ImageIcon img = new ImageIcon(“image.jpeg”);
esse image.jpeg é o endereço da imagem, ou apenas o nome do arquivo?
se ficar entre “”(aspas) não será considerado uma String comum?
onde ou devo deixar o arquivo de imagem no computador para acessar ele?
[quote]Constructor Summary
ImageIcon()
Creates an uninitialized image icon.
ImageIcon(byte[] imageData)
Creates an ImageIcon from an array of bytes which were read from an image file containing a supported image format, such as GIF or JPEG.
ImageIcon(byte[] imageData, String description)
Creates an ImageIcon from an array of bytes which were read from an image file containing a supported image format, such as GIF or JPEG.
ImageIcon(Image image)
Creates an ImageIcon from an image object.
ImageIcon(Image image, String description)
Creates an ImageIcon from the image. ImageIcon(String filename)
Creates an ImageIcon from the specified file.
ImageIcon(String filename, String description)
Creates an ImageIcon from the specified file.
ImageIcon(URL location)
Creates an ImageIcon from the specified URL.
ImageIcon(URL location, String description)
Creates an ImageIcon from the specified URL.[/quote]