Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Level extends JWindow {
- private final Timer timer = initTimer();
- private static Timer initTimer()
- {
- Timer timer = new Timer("events generator", true);
- return timer;
- }
- public Level() {
- setLayout(null);
- timer.schedule(new TimerTask()
- {
- @Override
- public void run()
- {
- onRedrawEvent();
- }
- }, 0, 10);
- }
- protected void onRedrawEvent()
- {
- repaint();
- }
Advertisement
Add Comment
Please, Sign In to add comment