Consider the following application files:

/JavaCS1/src/guiprojectcity2/DisplayWindow.java
import java.awt.*;
import javax.swing.*;
public class DisplayWindow extends JFrame{

private Container c;

public DisplayWindow(){
super("Display");
c = this.getContentPane();
}

public void addPanel(JPanel p){
c.add(p);
}

public void showFrame(){
this.pack();
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

/JavaCS1/src/guiprojectcity2/CityTester.java

public class CityTester {
public static void main(String[] args){
DisplayWindow display = new DisplayWindow();
CityPanel p = new CityPanel();
display.addPanel(p);
display.showFrame();
}
}

For this assignment you are to create a graphical program that, with user interaction, visually simulates the path of the sun over a city skyline.

Your job for this assignment is to duplicate this behavior with your own graphical application, complete with "time" labels beneath each sun position. Your application should include two classes, a CityTester driver class, given above, and a CityPanel class, which you must write in its entirety and submit below. The class you submit must be named CityPanel, and your submission should include not only the class text, but also all of the necessary import statements to make the class function properly.

Finally, the "skyline" we show in the running version,above, displays just two buildings, and is pathetic. The skyline in your version should be more ambitious, and should include at least four buildings, maybe a planetarium, perhaps a crane, whatever.

Your task, then, is to write the CityPanel class.
Enter the code for your CityPanel class in the box below.

Similar Questions
  1. import java.awt.EventQueue;import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingConstants; import
    1. answers icon 1 answer
  2. I am trying to run the following program and am getting this error:java.util.InputMismatchException import java.io.*; import
    1. answers icon 0 answers
  3. import java.util.ArrayList;import java.util.Scanner; public class Student { private int id; private String name; private int
    1. answers icon 1 answer
  4. For java programming, what is the difference between read() and next()?For example: Let's say I import the java Scanner class.
    1. answers icon 1 answer
more similar questions