2 visitatori online
Caricare una risorsa da un file jar
/**
*
*
* @author CUTONE LUCIANO e-mail: Questo indirizzo e-mail è protetto dallo spam bot. Abilita Javascript per vederlo.
* @since 2010*
*
*
*
* @author CUTONE LUCIANO e-mail: Questo indirizzo e-mail è protetto dallo spam bot. Abilita Javascript per vederlo.
* @since 2010*
*
*/
/** RITORNA UNA ICONA O NULL SE NON E' CORRETTO IL PATH */
public static ImageIcon createImageIcon(String pPath) {
String mioJar="mioFile.jar";
if (pPath != null) {
try {
return new ImageIcon(new URL("jar:file:/" + System.getProperty("user.dir") + "\\" + mioJar + "!/it/space_service/resource/images/" + pPath));
} catch (MalformedURLException e) {
showSimpleMessage("ERRORE IN UTILITY: " + e.toString());
}
} else {
showSimpleMessage("ERRORE IN UTILITY: ImageIcon createImageIcon(String pPath)");
return null;
}
return null;
}
/**
* QUESTO METODO VISUALIZZA A VIDEO UN SEMPLICE MESSAGGIO
* CON DELLE INFORMAZIONI PASSATE COME PARAMENTRO
*
*/
public static void showSimpleMessage(String pMessage)
{
JOptionPane.showMessageDialog(null, pMessage);
}
Ultimo aggiornamento (Martedì 04 Maggio 2010 14:24)


