URL imgURLgarage = null; try { // // insert URL that requires password // I cannot post it, because the forum requires to have more than 5 messages :-) // imgURLgarage = new URL( <insert string to password protected URL> ); } catch (MalformedURLException e) { e.printStackTrace(); } Icon iconGarage = new ImageIcon(imgURLgarage); lblGarageIMG.setIcon(iconGarage);
Note: A component may rely on some runtime behavior that is not possible at design time (such as accessing an application database or some other file). Runtime specific behavior should be isolated (and stubbed out as necessary) by wrappering the runtime specific code with a call to Beans.isDesignTime() which will answer true when the component is loaded within WindowBuilder Pro and false at runtime.]]>