Falae Galera... dei uma vasculhada e não encontrei nada...
O lance eh o seguinte...
Criei um JDesktopPanel com Jmenu, Ao clicar num JmenuItem ele abre os internalFrames.
Dentre dos internalframes carrego 3 label com image...
Os Labels aparecem... mas as imagens não...
Alguem pode me dar uma luz?
Segue o código:
public class Service extends JInternalFrame {
static int openFrameCount = 0;
static final int xOffset = 30, yOffset = 30;
private JLabel lblHTTP, lblSSH, lblFTP; // Labels para os serviços monitorados
private Status status = new Status(); //instancia a classe Status
private ImageIcon imgHTTP, imgSSH, imgFTP; //instancia as imagens
private String checkStatus = new String(); //cria variavel para conferir Status
private String green = new String("imgs/green.gif");
private String red = new String("imgs/red.gif");
private String yellow = new String("imgs/yellow.gif");
public Service() {
super("Monitoramento " + (++openFrameCount),
true, //resizable
true, //closable
true, //maximizable
true);//iconifiable
setLayout (new GridLayout(3,1));
//...Create the GUI and put it in the window...
checkStatus = status.getStatus();
//Add the labels.
if ( checkStatus == "off" ) {
imgHTTP = new ImageIcon(red);
imgSSH = new ImageIcon(red);
imgFTP = new ImageIcon(red);
}
else if ( checkStatus == "on" ){
imgHTTP = new ImageIcon(green);
imgSSH = new ImageIcon(green);
imgFTP = new ImageIcon(green);
}
else{
imgHTTP = new ImageIcon(yellow);
imgSSH = new ImageIcon(yellow);
imgFTP = new ImageIcon(yellow);
}
lblHTTP = new JLabel();
lblHTTP.setText("HTTP");
lblHTTP.setIcon(imgHTTP);
lblSSH = new JLabel();
lblSSH.setText("SSH");
lblSSH.setIcon(imgSSH);
lblFTP = new JLabel();
lblFTP.setText("FTP");
lblFTP.setIcon(imgFTP);
add (lblHTTP);
add (lblSSH);
add (lblFTP);
//...Then set the window size or call pack...
setSize(300,300);
//Set the window's location.
setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
}
}