Hello,
I’m currently trying to implement an image into the installation tab of my urcap (UR version 5.0.3),
whereby i followed this tutorial (using the label component variant):
But instead of the image showing, i get this error on startup:
This is the code i used (it is based on the mydeamon example):
label definition: (LogoImage)
This is the openview() code:
@Override
public void openView() {
enableDaemonButton.setText("Start Program");
disableDaemonButton.setText("Stop Program");
popupTitleField.setText(getPopupTitle());
//UI updates from non-GUI threads must use EventQueue.invokeLater (or SwingUtilities.invokeLater)
uiTimer = new Timer(true);
uiTimer.schedule(new TimerTask() {
@Override
public void run() {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
updateUI();
}
});
}
}, 0, 1000);
try{
LogoImage.setImage(ImageIO.read(getClass().getResource("/com/ur/urcap/examples/mydaemon/impl/logo_transparent.png")));
}
catch (IOException e) {
e.printStackTrace();
}
}
Html definition:
The image shows up in the correct folder in the built urcap:
But still this results in a nullpointer where it can’t locate the image.
Am i still missing something?
thanks in advance!