1 import javax
.imageio
.ImageIO
;
5 import java
.io
.IOException
;
7 public class PersonLeftPanel
extends JPanel
{
8 private JLabel leftLabel
= new JLabel();
9 private Image personImage
;
12 leftLabel
.setText("Current person");
15 this.personImage
= ImageIO
.read(new File("data/personImage.png"));
16 } catch (IOException e
) {
17 System
.out
.println(e
.getStackTrace());
21 public void paintComponent(Graphics g
) {
22 super.paintComponent(g
);
25 Graphics2D g2d
= (Graphics2D
) g
;
27 int imageHeight
= 180;
28 g2d
.drawImage(this.personImage
.getScaledInstance(imageWidth
/ 2, imageHeight
/ 2, Image
.SCALE_SMOOTH
), imageWidth
/ 4, imageHeight
/ 4, this);
31 public void drawEyes(Color color
) {
32 Graphics g
= this.getGraphics();
34 g
.fillOval(50, 50, 6, 3);
35 g
.fillOval(62, 50, 6, 3);