try {
this.personImage = ImageIO.read(new File("data/personImage.png"));
} catch (IOException e) {
- System.out.println(e.getStackTrace());
+ e.printStackTrace();
}
}
int imageWidth = 120;
int imageHeight = 180;
g2d.drawImage(this.personImage.getScaledInstance(imageWidth / 2, imageHeight / 2, Image.SCALE_SMOOTH), imageWidth / 4, imageHeight / 4, this);
+ // Eyes
g2d.setColor(personObj.getEye().getColor());
g2d.fillOval(50, 50, 6, 3);
g2d.fillOval(62, 50, 6, 3);
+ // Weigth
+ g2d.setColor(Color.black);
+ g2d.fillOval(44, 76, 30, (personObj.getWeight().getWeight() * 20) / 600);
}
}