Use a JPanel embedded in a JFrame to draw a set of British Traffic Lights, as follows:
![[britishtrafficlights.png|100]]
# Extension
Implement a British Traffic Light simulator. Add a JButton to the JFrame. Pressing the JButton should illuminate the lights in the following repeating sequence:
```mermaid
stateDiagram-v2
Red
RedAmber: Red Amber
Red --> RedAmber
RedAmber --> Green
Green --> Amber
Amber --> Red
```
Here is some code to get you started
```java
public class Main {
public static void main(String[] args) throws InterruptedException {
int count = -1;
String[] lights = { "red", "red amber", "green", "amber" };
while (true) {
if (++count > 3)
count = 0;
System.out.println(lights[count]);
Thread.sleep(1000);
}
}
}
```