Boa noite pessoal, td certo ?
Seguinte estou com um problema no meu projeto, adicionei a ele o projeto towel pra usar o Jimagepanel, depois de apanhar um poquim do netbeans consegui ajusta minha tela com o jimagepanel, mas não estou conseguindo carregar a imagem:
private void initComponents() {
try{
/*
javax.swing.JPanel pnlPrincipal =
*/
pnlPrincipal = new com.towel.swing.img.JImagePanel(loadImage("/imagens/papelParede/principal.png"));
btnSubTipo = new javax.swing.JButton();
btnColecao = new javax.swing.JButton();
btnTipo = new javax.swing.JButton();
btnCarta = new javax.swing.JButton();
btnRaridade = new javax.swing.JButton();
btnCor = new javax.swing.JButton();
btnMana = new javax.swing.JButton();
btnFechar = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Controle de Cartas Magic");
setMaximumSize(new java.awt.Dimension(505, 305));
setMinimumSize(new java.awt.Dimension(505, 305));
setResizable(false);
getContentPane().setLayout(null);
}catch(Exception ex){
JOptionPane.showMessageDialog(null, ex.getMessage());
}
/*codigo continua*/
quando meu codigo chega nesse metodo o problema acontece
private BufferedImage loadImage(String file) throws IOException {
return ImageIO.read(new File(file));
}
fiz exatamente como falava no blog, adicionei a biblioteca do towel e ajustei meu jimagepanel, esta dando erro como se ele não estivesse achando a imegem no diretório q eu coloquei, ele da uma mensagem de “Can’t read input file”, minha estrutura de arquivos esta assim:
|-Classes
|-Enums
|-ModelosTabelas
|-Persistencia
|-TratadorComponentes
|-Views
|-imagens|–papelParede
| |
| |