//output-field
output = new JEditorPane();
output.setEditable(false);
output.setLineWrap(true); //automatischer Zeilenumbruch
output.setWrapStyleWord(true); //Bei Zeilenumbruch Wort nicht trennen
JScrollPane scrollerOutput = new JScrollPane();
scrollerOutput.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollerOutput.getViewport().setView(output);
scrollerOutput.setPreferredSize(new Dimension(450,350));
getContentPane().add(scrollerOutput, BorderLayout.CENTER);
//Hintergrund-Bild
img = Toolkit.getDefaultToolkit().createImage(this.getClass().getResource("file//localhost/d/logo_cattix.jpg"));
try{
img = ImageIO.read(img); //HIER EXCEPTION: * siehe unten
}catch(IOException e){
}
//PaintComponent Methode um Hintergrundbild zu zeichnen
public void paintComponent(Graphics g){
this.getGraphics().drawImage(img,this.getWidth()-img.getWidth(this),this.getY(),null);
}
symbol : method read(java.awt.Image)
location: class javax.imageio.ImageIO
img = ImageIO.read(img);
.....uses unchecked or unsafe operations
try{
img = ImageIO.read(new URL("file//localhost/d/logo_chattix.jpg"));
}catch(IOException e){
}
System.out.println(img);
Eventuell auftretende Exceptions einfach zu ignorierenExtractor hat gesagt.:Was mache ich falsch?
try {
img = ImageIO.read(new URL("file//localhost/d/logo_chattix.jpg"));
} catch(IOException e) {
System.err.println(e);
}