@Override protected void paintComponent(Graphics grphcs) { super.paintComponent(grphcs); int width = this.getWidth(); int height = this.getHeight(); googleMap.setWidth(width); googleMap.setHeight(height); Image image = googleMap.getImage(); grphcs.drawImage(image, 0, 0, this); Graphics2D g2 = (Graphics2D) grphcs; String toDisplay = "Normal"; if (crit) { g2.setColor(Color.red); toDisplay = "ALARM"; } else if (warn) { g2.setColor(Color.orange); toDisplay = "WARNING"; } else { g2.setColor(Color.green.darker()); toDisplay = "Normal"; } g2.setFont(new Font("Calibri", Font.BOLD, 60)); g2.drawString(toDisplay, 10, 60); }