/**
* Class untuk menampilkan WindowFrame aplikasi
*/
import java.awt.*;
import javax.swing.*;
public class AppFrame extends JFrame{
public static void main(String[] args) {
new AppFrame(60);
}
public AppFrame (int duration){
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException ex) {
} catch (InstantiationException ex) {
} catch (IllegalAccessException ex) {
} catch (UnsupportedLookAndFeelException ex) {
}
JFrame frame = new JFrame("Traffic Light");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new BorderLayout(1,1));
frame.add(new TrafficLightPane(duration));
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
}
}