Mega Code Archive

 
Categories / Java / Development Class
 

A Properties file stored in a JAR can be loaded this way

import java.net.URL; import java.util.Properties; import javax.swing.JApplet; public class Main extends JApplet {   public static void main(String[] a) throws Exception {     Properties p = new Properties();     URL url = ClassLoader.getSystemResource("/com/rntsoft/config/system.props");     if (url != null)       p.load(url.openStream());   } }