[2nd-item]
Instructions
:Using replit as compiler, kindly modify and execute the program. Don't forget to provide screenshot of the program and its output.
Holidaypanel.java
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import http://java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
import javax.swing.JPanel;
import javax.swing.Timer;
public class Holidaypanel extends JPanel{
private final int PANEL_WIDTH = 600;
private final int PANEL_HEIGHT = 350;
private Snowman snowman;
private Stars s1;
private Trees trees;
private House h;
public Holidaypanel() {
setBackground(Color.cyan);
//set size of window
setPreferredSize(new Dimension(PANEL_WIDTH, PANEL_HEIGHT));
trees = new Trees(280, PANEL_WIDTH);
snowman = new Snowman(150, 160);
s1 = new Stars(0, 130, 18, PANEL_WIDTH);
h = new House(480, 25);
}
public void paintComponent(Graphics page) {
super.paintComponent(page);
s1.draw(page);
snowman.draw(page);
trees.draw(page);
s1.setFixed(true);
h.draw(page);
}
}