Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lab7;
- import java.util.Timer;
- import java.util.TimerTask;
- import javax.microedition.lcdui.Display;
- import javax.microedition.midlet.*;
- public class Midlet extends MIDlet {
- Display ekran;
- PadajacySnieg zamiec = new PadajacySnieg();
- Grawitacja padaSnieg = new Grawitacja();
- Timer timer = new Timer();
- public Midlet() {
- ekran = Display.getDisplay(this);
- }
- protected void destroyApp(boolean unconditional) {}
- protected void startApp() {
- ekran.setCurrent(zamiec);
- timer.schedule(padaSnieg, 10, 10);
- }
- protected void pauseApp() {}
- public void exit() {
- timer.cancel();
- destroyApp(true);
- notifyDestroyed();
- }
- class Grawitacja extends TimerTask {
- public void run() {
- zamiec.scroll();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement