Adding external JAR to Maven project in NetBeans

From the NetBeans forum: Open the Projects tab. Right-click on Dependencies. Select Add dependency. Set groupId to: group.id (can be anything) Set artifactId to: artifact.id (can be anything) Set version to: 1.0 (can be anything) Click Add to continue. Dependency is added to pom.xml and appears under the Libraries node of Maven project. Continue: Expand … Read more

Nested/Inner class in external file

You can make the inner class package private which means that it will only be accessible from other classes in exactly the same package. This is also done quite frequently for hidden classes inside the standard JDK packages like java.lang or java.util. in pkg/MyClass.java public class MyClass { … } in pkg/MyHiddenClass.java class MyHiddenClass { … Read more

Can I load external stylesheets on request?

Yup: if you create a <link> tag linking to a stylesheet and add it to the <head> tag, the browser will load that stylesheet. E.g. $(‘head’).append(‘<link rel=”stylesheet” type=”text/css” href=”https://stackoverflow.com/questions/2126238/lightbox_stylesheet.css”>’); However, as per @peteorpeter’s comments, this doesn’t work in IE 8 or under — there, you need to either: append the <link> before setting its href; … Read more

Using $compile on external template (templateURL) in Angular directive

You can use the $templateRequest service to get the template. This is a convenience service that also caches the template in $templateCache, so that only a single request to template.html is made. As an illustration (and without going into the issue of recursive directives), this is used like so: link: function(scope, element){ $templateRequest(“template.html”).then(function(html){ var template … Read more

How do you dynamically compile and load external java classes? [duplicate]

Take a look at JavaCompiler The following is based on the example given in the JavaDocs This will save a File in the testcompile directory (based on the package name requirements) and the compile the File to a Java class… package inlinecompiler; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; import java.net.URL; import java.net.URLClassLoader; import … Read more