Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.*;
- import java.awt.event.*;
- /**
- * Write a description of class Window here.
- * Sebagai tampilan atau interface aplikasi
- * @author Thomas Felix
- * @version 19 Oktober 2020
- */
- public class Window extends JFrame
- {
- public static void main (String[] args)
- {
- new Window(15);
- }
- public Window(int durasi)
- {
- EventQueue.invokeLater(new Runnable()
- {
- @Override
- public void run()
- {
- try
- {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- }
- catch (ClassNotFoundException ex) {}
- catch (InstantiationException ex) {}
- catch (IllegalAccessException ex) {}
- catch (UnsupportedLookAndFeelException ex) {}
- JFrame frame = new JFrame("Lampu Lalu Lintas");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setLayout(new BorderLayout(5, 5));
- frame.add(new Tampilan(durasi));
- frame.pack();
- frame.setLocationRelativeTo(null);
- frame.setVisible(true);
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment