I have extended jEditorPane as shown below (minus the instantiation code). However, when I set the image and call update on the object, it only draws a small portion of the image (equivalent to where one line of text would go). Can somene tell me what I am doing wrong here?
public class JEditorPaneImg extends JEditorPane {
private BufferedImage bi = null;
public JEditorPaneImg() {
initComponents();
}
@Override
public void paint(Graphics g) {
super.paint(g);
if (bi != null) {
Graphics2D g2 = (Graphics2D) g;
g2.drawImage(bi, 0, 0, this);
}
}
public void setImage(BufferedImage image){
bi = image;
}
}