SImageIcon icon = new SImageIcon(new ImageIcon((byte[])attribute.get())); detailPanel.add(new SLabel(icon),detailviewTemplateLabels[i]+"_"+ value);
SLabel iconL = new SLabel(); try { File tmp = File.createTempFile("photo","tmp",null); FileOutputStream fos = new FileOutputStream(tmp); fos.write((byte[])attribute.get()); fos.close(); iconL.setIcon(new FileImageIcon(tmp)); } catch(java.io.FileNotFoundException e) { e.printStackTrace(); iconL.setText("photo kann nicht angezeigt werden"); } catch(java.io.IOException e) { e.printStackTrace(); iconL.setText("photo kann nicht angezeigt werden"); }     detailPanel.add(iconL,detailviewTemplateLabels[i]+"_"+ value);
    protected void showDetails(Attributes attributes) {	System.err.println("show detailFrame");	//detailPanel.removeAll();	for (int i=0; i < detailviewAttributes.length; i++) {            String value = "value";	    try {               		Attribute attribute = attributes.get(detailviewAttributes[i]);                SLabel detailLabel = new SLabel(detailviewLabels[i]);                detailLabel.setForeground(Color.blue);               		detailPanel.add(detailLabel,detailviewTemplateLabels[i]);                if (attribute!=null) {                    if (attribute.get().getClass().getName().equals("[B")) {                        if (attribute.getID().equals("jpegPhoto")) {                            SImageIcon icon = new SImageIcon(new ImageIcon((byte[])attribute.get()));                            detailPanel.add(new SLabel(icon),detailviewTemplateLabels[i]+"_"+ value);                        }                        else if (attribute.getID().equals("userPassword")) {                            detailPanel.add(new                                SLabel("-"),detailviewTemplateLabels[i]+"_"+ value);                        }                    }                    else {                        StringBuffer buffer = new StringBuffer();                        for (int i2=0; i2 < attribute.size(); i2++) {                            if (i2 > 0)                                buffer.append(", ");                            buffer.append(attribute.get(i2).toString());                        }                        detailPanel.add(new                            SLabel(buffer.toString()),detailviewTemplateLabels[i] + "_" + value);                    }                }	    }	    catch (NullPointerException e) {                e.printStackTrace();		detailPanel.add(new SLabel("-"),detailviewTemplateLabels[i] + "_" + value);	    }	    catch (NamingException e) {		detailPanel.add(new SLabel(e.getMessage()),value);	    }	}	detailFrame.setIconified(false);	detailFrame.setClosed(false);	searchFrame.setMaximized(false);    }