Accessing a resource within a .jar

Posted by Emanuele Gesuato Mon, 06 Feb 2006 01:08:00 GMT

Sometimes it is useful to distribute an application in a jar file through Java Web Start or any other way. So, you could have to read some resource (images or properties file) from inside a jar. How can you do it ? It’s very simple, here’s an example to retrieve an image:

ImageIcon image = (new ImageIcon(getClass().getResource("yourpackage/mypackage/image.gif")));

In general, you can retrieve an InputStream in the following way:

InputStream is = this.getClass().getClassLoader()    .getResourceAsStream("yourpackage/mypackage/myfile.xml");

It will run inside or outside the jar. Enjoy !

Posted in  | Tags ,  | 80 comments | no trackbacks

NetBeans 5.0

Posted by Dario Santamaria Sat, 04 Feb 2006 19:21:00 GMT

The stable version of my favourite Java IDE - NetBeans 5.0 - is out!

Download it now

Posted in  | Tags ,  | 3 comments | no trackbacks

Installing Java Studio Creator 2 on Debian

Posted by Dario Santamaria Fri, 27 Jan 2006 01:34:00 GMT

On Linux, the required distribution for Java Studio Creator 2 (now Free for all SDN members) is Fedora. I’m a Debian user and I succeeded to install it, however.
The first time my installation completes too soon, without correctly installing Java Application Server. I read the FAQs and I found a page saying:
Check if the following RPM packages exist on your system:

  • either libstdc++ or compat-libstdc++
  • either libstdc++-devel or compat-libstdc++-devel

If these are missing, first install them. Then restart the Java Studio Creator installer.

The correct Debian (Etch) packages (apt-get ‘em!) are

  • libstdc++2.10-glibc2.2 and
  • libstdc++2.10-dev

I don’t know if both are required or only the first one, but now the whole installation of Java Studio Creator 2 is complete.

Thanks to David Coldrick’s Weblog (installation on Ubuntu of JSCreator 1).

Posted in  | Tags , ,

JUGMeeting #24 - "JavaPolis a raggi X"

Posted by Paolo Dona' Sun, 22 Jan 2006 05:33:00 GMT

Quando: Sabato 21 Gennaio 2006 dalle 09:00 alle 12:30

Dove: aula De – piano terra al DEI, via Gradenigo 6/B (ingresso studenti) Padova

Programma:
09:00 Accoglienza
09:15 “Resoconto su JavaPolis” a cura degli “inviati” del JUGPadova
09:40 “Introduzione a eXo Platform” a cura di Benjamin Mestrallet
10:10 “JavaPolis: XOM e novita’ di JSF 1.2” a cura di Andrea Nasato
10:50 Pausa caffe’ – Java Break
11:05 “JavaPolis: novita’ di Spring 2.0 e Maven 2.0” a cura di Paolo Dona’
11:50 “Eventi e Proposte” a cura di tutto il JUGPadova
12:30 Fine meeting 24
13:00 Pizza con chi vuole fermarsi con noi ;-)


Ingresso sempre libero!

Il PDF della locandina lo trovate a questo indirizzo

Vi aspettiamo!!!

Posted in

JUGPD@LinuxPro

Posted by Paolo Dona' Mon, 16 Jan 2006 22:40:00 GMT

Sul numero di Gennaio di Linux PRO c’è una breve recensione della scorsa edizione di JavaPolis redatta a 10 mani da membri del Jug Padova! Correte in edicolaaaaaaa!!!

Posted in  | Tags  | 3 comments

Xom

Posted by Andrea Nasato Sun, 15 Jan 2006 22:22:00 GMT

Today I want to introduce you into XOM, which is one of the two arguments I’m going to talk about in our next meeting (the second is JSF 1.2). What is XOM? Someone could think it’s yet another XML library. In part that’s true.

Read more...

Posted in  | Tags ,  | no comments

Serialize a bean using jdbc

Posted by Enrico Giurin Wed, 11 Jan 2006 00:19:00 GMT

Sometimes, in my work as programmer, I need to serialize an object (bean) into a table, in a BLOB field, as well as retrieves bean from a ResultSet. I have realized a simple example that, using JDBC, allows to obtain this.

Read more...

Posted in  | Tags , ,  | 7 comments

Una nuova rivista di programmazione

Posted by Lucio Benfante Mon, 09 Jan 2006 18:18:00 GMT

Nei prossimi mesi uscirà in edicola una nuova rivista dedicata alla programmazione Java. Michele Sciabarrà, che ne sarà il direttore, ha accettato di rispondere a qualche domanda via posta elettronica su questo progetto editoriale.

Read more...

Posted in  | Tags , ,  | 11 comments

JUGMeeting #23 - Assemblea Annuale dei soci

Posted by Paolo Dona' Sat, 03 Dec 2005 06:09:00 GMT

Quando: Sabato 3 Dicembre 2005 dalle 09:00 alle 12:30

Dove: Attenzione! Aula differente dal solito… aula Ce – primo piano del DEI, via Gradenigo 6/B (ingresso studenti) Padova

Programma:
09:00 Accoglienza
09:15 Hecl,scriptingperJava(eJ2ME!)” a cura di DavidN.Welton
10:15 Java Break – Pausa caffe’
10:30 Assemblea annuale del JUG Padova (in seconda convocazione) a cura del Consiglio Direttivo del JUGPadova
12:30 Fine meeting 23
13:00 Pizza con chi vuole fermarsi con noi ;-)


Ingresso sempre libero!

Il PDF della locandina lo trovate a questo indirizzo

Vi aspettiamo!!!

Posted in

Older posts: 1 ... 9 10 11 12