Java 2D animation 🎞️

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 164

  • @BroCodez
    @BroCodez  4 года назад +104

    //------------------------------------------------
    public class Main{
    public static void main(String[] args) {

    new MyFrame();

    }
    }
    //------------------------------------------------
    import java.awt.*;
    import javax.swing.*;
    public class MyFrame extends JFrame{

    MyPanel panel;

    MyFrame(){

    panel = new MyPanel();

    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.add(panel);
    this.pack();
    this.setLocationRelativeTo(null);
    this.setVisible(true);
    }
    }
    //------------------------------------------------
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MyPanel extends JPanel implements ActionListener{
    final int PANEL_WIDTH = 500;
    final int PANEL_HEIGHT = 500;
    Image enemy;
    //Image backgroundImage;
    Timer timer;
    int xVelocity = 1;
    int yVelocity = 1;
    int x = 0;
    int y = 0;

    MyPanel(){
    this.setPreferredSize(new Dimension(PANEL_WIDTH,PANEL_HEIGHT));
    this.setBackground(Color.black);
    enemy = new ImageIcon("enemy.png").getImage();
    //backgroundImage = new ImageIcon("space.png").getImage();
    timer = new Timer(10, this);
    timer.start();
    }
    public void paint(Graphics g) {

    super.paint(g); // paint background

    Graphics2D g2D = (Graphics2D) g;

    //g2D.drawImage(backgroundImage, 0, 0, null);
    g2D.drawImage(enemy, x, y, null);
    }

    @Override
    public void actionPerformed(ActionEvent e) {

    if(x>=PANEL_WIDTH-enemy.getWidth(null) || x=PANEL_HEIGHT-enemy.getHeight(null) || y

    • @dgh25
      @dgh25 3 года назад +1

      thx

    • @shubhammusale692
      @shubhammusale692 2 года назад +1

      Awesome

    • @17rajmandal14
      @17rajmandal14 Год назад

      Nice

    • @stakemograine266
      @stakemograine266 Год назад

      I think it is worth paying attention to the fact that the method
      public void paint(Graphics g) in MyPanel class should be declared as:
      @Override
      public void paint(Graphics g)

    • @joyceasante8292
      @joyceasante8292 Год назад

      Practicing...
      public class Main
      {
      public static void main (String[]args)
      {
      new MyFrame ();
      }
      }
      ******************
      import java.awt.*;
      import javax.swing.*;
      public class MyFrame extends JFrame
      {
      MyPanel panel;
      MyFrame ()
      {
      panel = new MyPanel ();
      this.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
      this.add (panel);
      this.pack ();
      this.setLocationRelativeTo (null);
      this.setVisible (true);
      }
      }
      ******************
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;
      public class MyPanel extends JPanel implements ActionListener
      {
      final int PANEL_WIDTH = 250;
      final int PANEL_HEIGHT = 250;
      Image avatar;
      Image backgroundImage;
      Timer timer;
      int xVelocity = 2;
      int yVelocity = 1;
      int x = 0;
      int y = 0;
      MyPanel ()
      {
      this.setPreferredSize (new Dimension (PANEL_WIDTH, PANEL_HEIGHT));
      this.setBackground (Color.black);
      avatar = new ImageIcon ("avatar.png").getImage ();
      backgroundImage = new ImageIcon("sea.png").getImage();
      timer = new Timer (20, this);
      timer.start ();
      }
      public void paint (Graphics g)
      {
      super.paint (g);
      Graphics2D g2D = (Graphics2D) g;
      g2D.drawImage(backgroundImage,0,0,null);
      g2D.drawImage (avatar, x, y, null);
      }
      @Override public void actionPerformed (ActionEvent e)
      {
      if (x >= PANEL_WIDTH - avatar.getWidth (null) || x > 0)
      {
      xVelocity = xVelocity * -1;
      }
      x = x + xVelocity;
      if (y >= PANEL_HEIGHT - avatar.getHeight (null) || y > 0)
      {
      yVelocity = yVelocity * -1;
      }
      y = y + yVelocity;
      repaint ();
      }
      }

  • @niratomata
    @niratomata 3 года назад +12

    the satisfying moment when the alien perfectly hits the corner of the screen

  • @mypythonplace
    @mypythonplace 2 года назад +6

    Simple the best programming videos! 100% Certain! Thank you Bro Code!, I have learned more with YOU with a few videos than with many programming books combined! You always Straight to the point, total knowledge, and nice manners for teaching!

  • @pavelkvasnicka6856
    @pavelkvasnicka6856 Год назад +2

    This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro

  • @carriejiang1570
    @carriejiang1570 2 года назад +1

    Excited to watch!!!!!!!!!!

  • @ljront3126
    @ljront3126 5 месяцев назад +1

    I like your explanations. You are simplifying one main method of designing in Java, which helps to many beginners by programing. One High point for you bro👍

  • @naikels6922
    @naikels6922 9 месяцев назад +1

    you got me when you said "I hate awkward silences" XD

  • @micahdavis1369
    @micahdavis1369 Год назад +1

    I just needed to learn how to animate a line moving in a circle but this helped!

  • @seabass6106
    @seabass6106 4 года назад +5

    LOUD & CLEAR! THANKS BRO

    • @BroCodez
      @BroCodez  4 года назад +1

      thanks for watching Oberdorfer

  • @pleasedontwatchthese9593
    @pleasedontwatchthese9593 Год назад

    Thank you for this. This video got to the point fast and the script is small and just what I need.

  • @GoaNights
    @GoaNights Год назад +1

    The constructor Timer(10, this) is undefined
    The method start() is undefined for the type Timer

    • @DorinCurnic
      @DorinCurnic 10 месяцев назад +1

      verify if you add correct import 'java.awt.event.*;' and 'implements ActionListener'

  • @derkach7907
    @derkach7907 3 года назад +1

    Nice

  • @minhgiang7945
    @minhgiang7945 2 года назад

    Thank you for your tutorial

  • @discreet_boson
    @discreet_boson 4 года назад +1

    This is awesome

  • @astonmargolis-dias7089
    @astonmargolis-dias7089 9 месяцев назад

    lmaaooo siiiick haha 🔥🔥

  • @najmulislam9658
    @najmulislam9658 3 года назад

    You are My Hero bro....

  • @JAGM77MX
    @JAGM77MX 2 года назад

    Outstanding!

  • @jwflammer
    @jwflammer 3 года назад

    really cool

  • @holohien9115
    @holohien9115 3 года назад

    I am very happy for the video, it allowed me to understand enough things. Thanks again!

  • @accumulator4825
    @accumulator4825 2 года назад

    Thanks dude, really needed this!

  • @alexandrevinicius2960
    @alexandrevinicius2960 5 месяцев назад

    that's so sick!

  • @anonimanonim1223
    @anonimanonim1223 2 года назад

    Great

  • @cate01a
    @cate01a 4 года назад +8

    very helpful as always!
    could I ask you cover rotating images/icons in future videos? tried various methods for the past hour, and I don't know how to implement any of the methods I came across

    • @BroCodez
      @BroCodez  4 года назад +6

      that's not a bad idea

    • @tvt-Ar
      @tvt-Ar 2 года назад +1

      @@BroCodez how to remove white background from image just like in your case enemy image doesn't have any background

  • @enoselinsa9771
    @enoselinsa9771 2 года назад

    This is exactly what i need!!!

  • @shaynazoedeguzman7418
    @shaynazoedeguzman7418 2 года назад

    Awesome. Marvelous. Splended. Thank you very much bro code!

  • @giogio3208
    @giogio3208 2 года назад

    SWAG DUDE!!!!

  • @Pymmusic
    @Pymmusic Год назад

    Thank you very much for this tutorial. I need it for one little program that i hope to write in the next days. I will write the URL of this video if i will be successful in my project.
    You have the great gift to explain very difficult things in a very simple way.
    Thanks you again; Mr. Bro Code!!!
    Paolo Maria Guardiani

  • @SorryDaSlayer
    @SorryDaSlayer 3 года назад

    Dude after 12 fucking long hours.. Thank you so much!!

  • @wangobaloch2553
    @wangobaloch2553 3 года назад +2

    Thanks! Doing a great job
    Can you provide the link where u download the images

  • @leviplays7466
    @leviplays7466 8 месяцев назад

    you're the bro

  • @nawfalnjm5699
    @nawfalnjm5699 3 года назад +1

    thank you . this is very helpful and easy to understand.

  • @eliasferdji7711
    @eliasferdji7711 Год назад

    Génial la vidéo !

  • @Elbornt
    @Elbornt 3 года назад

    Thanks really coll content!🔥🔥🔥

  • @ZeNItSu-w9t
    @ZeNItSu-w9t 4 месяца назад +1

    How do we get the icons for the project? I've been searching far and wide and I can't seem to find one that works for the code 😭 🙏

  • @noisyguest5249
    @noisyguest5249 4 года назад +7

    My notification is broken, the notification came 23secs ago and bro code's comment was 17hr ago wth

    • @rewrose2838
      @rewrose2838 4 года назад +2

      He probably unlisted/made the video private when uploading 17 hours ago and only now made it public

    • @BroCodez
      @BroCodez  4 года назад +3

      I scheduled the video for release at a certain time

  • @attalaw36
    @attalaw36 3 года назад

    thank you very helpful ...

  • @matt_acosta
    @matt_acosta Год назад

    Thank you!

  • @oguzhantopaloglu9442
    @oguzhantopaloglu9442 4 года назад

    wow this was very useful

  • @Amin-qw3ol
    @Amin-qw3ol 3 года назад

    Thanks Bro

  • @schee4887
    @schee4887 11 месяцев назад

    How do you get all of your images to be perfectly for the panel, did you manually change it for the panel or do something special?

  • @broderickjohnson7167
    @broderickjohnson7167 3 года назад

    This will be very useful!!

  • @JamesBondRJ707
    @JamesBondRJ707 2 года назад

    👍👍👍

  • @karippaitech8963
    @karippaitech8963 Год назад +1

    How to increase background image size

  • @ibrahimylmaz8378
    @ibrahimylmaz8378 2 года назад

    thanks bro

  • @wtf_xitiz
    @wtf_xitiz 3 года назад

    Learnt new things... ( I was doing it so wrongly) 😂

  • @mheeprising8840
    @mheeprising8840 8 месяцев назад

    Thank you !!!

  • @Rohan-Prabhala
    @Rohan-Prabhala Год назад

    Hey bro, love your tutorials, and love your channel! You're so good, everybody of all ages can learn from you! I just have on question (not related to your video, nor teaching skills).
    I Want to make a trail that follows the enemy and makes a path of it, but how would I do that? I'm tried making a line, but I'm having trouble making it follow behind the character, and I'm having trouble making the previous lines stay, as the background (I think) keeps painting over it!
    Also, is there a way to clone the enemy, like multiple new instances of it, maybe to make a game like space invaders with it?

  • @ayae.muhammed7305
    @ayae.muhammed7305 4 года назад +2

    I loveeee it

    • @BroCodez
      @BroCodez  4 года назад

      thanks for watching Aya

  • @kemann3815
    @kemann3815 3 года назад

    Thanks a lot!

  • @Elbornt
    @Elbornt 3 года назад

    Hello from Russia🇷🇺!

  • @DanielRodrigues-bx6lr
    @DanielRodrigues-bx6lr 3 года назад +6

    Is there any way to keep the animation panel in the background? For example, I want to have clickable labels (via mouse listeners) and buttons over the animation. I tried that, but the animation panel ends up completely covering everything else.

    • @Blackilykat
      @Blackilykat 2 года назад +2

      you should probably use two different layeredPanes one for the animation and one for the buttons and labels. Here's the video about layered panes: ruclips.net/video/CmK1nObLxiw/видео.html

  • @cyanuranus6456
    @cyanuranus6456 Год назад

    I Want You To Turn This into a Software and Publish it for Windows, Microsoft and MacOS

  • @aqibishaq885
    @aqibishaq885 4 года назад

    wao superrr

  • @paraparasolian6484
    @paraparasolian6484 3 года назад

    Nice! I tried this with xVelocity = 10 and yVelocity = 21; Excellent!!

  • @jpiongchuanho3422
    @jpiongchuanho3422 4 года назад +5

    I'm facing a problem ,when i write
    timer = new Timer(1000,null);
    timer.start();
    The constructor Timer(int,null)is undefined
    The method start()is undefined for the type timer

    • @BroCodez
      @BroCodez  4 года назад +4

      replace timer = new Timer(1000,null);
      with
      timer = new Timer(1000,this);

    • @jpiongchuanho3422
      @jpiongchuanho3422 4 года назад +14

      @@BroCodez I found the source of the problem,import wrong.
      import java.util.Timer;
      change to import javax.swing.Timer;
      Thank you for your patience reply

    • @adrianrodriguez80
      @adrianrodriguez80 2 года назад

      @@jpiongchuanho3422 thanks! :D

  • @louiemunoz
    @louiemunoz 2 года назад

    thanks

  • @jfruit6310
    @jfruit6310 4 года назад +3

    interesting that there are more than one Timer class from Java one from swing and i found another from util. i just know because code doesn't work when i import wrong package lol.

    • @foreversleepy4379
      @foreversleepy4379 4 года назад +1

      The Swing timer is used to perform actions on the Event Dispatch Thread after a certain delay. It's to prevent issues that multithreading can cause in regards to GUI components. The designers of Swing decided that all changes to GUI components must happen within one thread, which prevents a lot of headaches compared to changing the state of GUI components from multiple threads.
      If you are writing an app that's based on a schedule and it doesn't use GUI Swing components, then it's better to use the util Timer class for general scheduling.

    • @nawfalnjm5699
      @nawfalnjm5699 3 года назад

      thank you my friend , i had this problem but now i fixed it

  • @hugo-garcia
    @hugo-garcia 2 года назад +1

    I modified the code and made the famous DVD logo moving around

  • @powerfullone7915
    @powerfullone7915 4 года назад

    Loved it bro

    • @BroCodez
      @BroCodez  4 года назад

      thanks for watching!

  • @MrLoser-ks2xn
    @MrLoser-ks2xn 2 года назад

    Thanks

  • @MrLoser-ks2xn
    @MrLoser-ks2xn Год назад

  • @romawar1869
    @romawar1869 3 года назад

    Thank you

  • @sanskarsongara2592
    @sanskarsongara2592 3 года назад +1

    Thanks, Everything works Perfect. Just wanted to know why the hell it lags af

  • @mahimasingh4791
    @mahimasingh4791 2 года назад

    Yo bro your playlist need some changes timer vid needs to be before in the 2D animation... I don't get the velocity thing and timer thing here

  • @Almapeterson-f7e
    @Almapeterson-f7e 11 месяцев назад

    These are really good videos but I can't get mine to draw any images.

  • @maxwong1768
    @maxwong1768 2 года назад +1

    I have tried to make the movement logic by my ownself . Undoubtedly , your way is much more clever and efficient .
    Code
    boolean goLeft = false , goRight = true , goUp = false , goDown = true ;
    if ((x+100) + xVelocity > panelWidth) // 100 is the image width .
    {
    goRight = false ;
    goLeft = true ;
    }
    else if (x - xVelocity < 0)
    {
    goLeft = false ;
    goRight = true ;
    }

    if (goRight)
    {
    x += xVelocity ;
    }
    else if (goLeft)
    {
    x -= xVelocity ;
    }

    if ((y+100) + yVelocity > panelHeight) // 100 is the image height .
    {
    goDown = false ;
    goUp = true ;
    }
    else if (y - yVelocity < 0)
    {
    goUp = false ;
    goDown = true ;
    }
    if (goUp)
    {
    y -= yVelocity ;
    }
    else if (goDown)
    {
    y += yVelocity ;
    }

  • @gautamsajith5544
    @gautamsajith5544 Год назад

    Can we implement this using labels?

  • @Questionmark000-h9s
    @Questionmark000-h9s Год назад

    woow he used eclipse

  • @tryme5275
    @tryme5275 Год назад +1

    Hi bro I'm having issues with when im creating a timer I also implemented the actionlistener and import the timer
    Timer timer;
    timer = new Timer(1000, this);
    It says it is undefined

  • @teowong1
    @teowong1 2 года назад

    how to pass the argument into the "constructor of timer" ?

  • @helriskor
    @helriskor 3 года назад +1

    My images wink constantly. I think it is about the 10 seconds timer and it paints constantly. I see the painting winking I think but it works correct on your computer. How can I solve this?

    • @Blackilykat
      @Blackilykat 2 года назад

      I had the same issue, you might have switched position and size arguments when you drew the image

  • @CrispenLeblanc
    @CrispenLeblanc 10 месяцев назад

    I have a background image that is 1024x1024 but the JPanel is 500x500. The background will not display at all if I do not change the background image size to match the JPanel. Is there a way to resize the background image with code?

  • @mahmoodkanj9078
    @mahmoodkanj9078 3 года назад

    shet man

  • @SeniorScriptKitty
    @SeniorScriptKitty 8 месяцев назад

    maybe I screwed up the build path or something but its just not working I have gotten crazy errors even though its duplicate code no clue

  • @exothermic1942
    @exothermic1942 2 года назад +1

    This doesn't work when I copy-pasted it into eclipse. I changed the "enemy = new ImageIcon("enemy.png).getImage();" to "enemy = new ImageIcon("grass.png").getImage();", but the image doesn't show up at all. Any suggestions?

    • @khsdfkls
      @khsdfkls 2 года назад

      make sure the image has the same name as the image you have in your project folder

    • @Blackilykat
      @Blackilykat 2 года назад

      add src/ in front of the image name. I don't know why but some stuff that shouldn't work works for him.

    • @Levi-Luke
      @Levi-Luke 2 года назад

      Well, put the image, on the same location as whr your project file📁. For example my class files and project files within my D-drive. D:(drive name) \java(folder name) \practice(another foldername) \anime(java project name) \enemy(image)

    • @namthanh7959
      @namthanh7959 Год назад

      @@Blackilykat you saved my day

  • @pobrika2631
    @pobrika2631 2 года назад

    Please apply for teacher position at my school.

  • @andreeairina4750
    @andreeairina4750 3 года назад

    👍🏻

  • @haitranngoc3381
    @haitranngoc3381 3 года назад

    This is a great video, but I have a question, if I want to draw more than 1 object, but they are drawn independently on the same frame, what should I do?

    • @derkach7907
      @derkach7907 3 года назад

      Just put the object code right after the other object, thats it. (you might wanna change some variables, and I don't know how to fix collision but feel free to try it)

    • @Blackilykat
      @Blackilykat 2 года назад

      as long as they are both before the repaint() method they will get updated in the same frame

  • @chienlai6036
    @chienlai6036 2 года назад

    How can i remove the white background of the image

  • @RyandracusChapman
    @RyandracusChapman 2 года назад

    My image starts buffering and is stuck at the max x-position in my code, it's still an image, but it's unrelated to this exact code. It starts buffering at x = 900 and fiddles around that. Is there a reason why it won't start moving back towards the left?

  • @ashwinsights3952
    @ashwinsights3952 2 года назад +1

    BRO CODE !!!!! PLS REPLY i want to get width and height from ym java graphics but i dont know how to get width and height from a java graphics so pls tell me how to do that

    • @Blackilykat
      @Blackilykat 2 года назад +1

      Since the draw method is a void type, you can't directly get them. That's the reason he used separate variables to move the position in this video. You pretty much have to do the same, create separate variables and set those as the height and width.

    • @Blackilykat
      @Blackilykat 2 года назад

      @@ashwinsights3952 sorry for the late reply. Did you want to get it from a frame, panel or label?

  • @imperilbuster404
    @imperilbuster404 3 года назад +1

    A few questions, I'm trying to get a small circle or image to travel on the edges of a diamond-shaped drawing(like a baseball home run). I was wondering how you would write it where it would reach a corner/coordinates and then have it turn to run to another corner, and then stop at the homebase? Another question is that I'm thinking of implementing a system where the user could input the speed the circle would travel in, should I have it where it change the velocity or the timer? And lastly, how would I implement a pause mechanic, such as when I pause the program and resume it?
    Your videos are really helpful btw.

    • @Blackilykat
      @Blackilykat 2 года назад

      use a switch method. Put a case for every base's coordinates and for the start, and once each is reached change the velocity to make it go the right way

  • @ANONYMOUS-yv6ik
    @ANONYMOUS-yv6ik 2 года назад

    Please talk about 3d 🙏🙏🙏

    • @Blackilykat
      @Blackilykat 2 года назад

      Either get a separate engine or do maths to calculate it using the fillPolygon function in the video earlier. I don't think there's a class just for 3d, but you might wanna google that

  • @onlytheflames
    @onlytheflames 2 года назад

    how do you make the animationt to stop?

  • @ARYANSINGH-ee5gx
    @ARYANSINGH-ee5gx 2 года назад +1

    how that image coming on your screen

    • @Blackilykat
      @Blackilykat 2 года назад +2

      make sure to add src/ in front of the image name

  • @thienvuphan6840
    @thienvuphan6840 3 года назад

    i did following that you did but my image don`t show out

  • @pauljolou3617
    @pauljolou3617 2 года назад

    Is there any way that you can able to click the enemy?

  • @louissmitty5064
    @louissmitty5064 2 года назад

    Is there a way to repaint individual objects?

    • @Blackilykat
      @Blackilykat 2 года назад

      You could put the objects in different JPanels and individually update those

  • @fitfirst1858
    @fitfirst1858 4 года назад

    thank you!!

    • @BroCodez
      @BroCodez  4 года назад

      thank you for watching fafa

  • @damiengraulvehus8836
    @damiengraulvehus8836 3 года назад

    The paint method rewritting doesn't work for me, the image doesn't appear ... i wrote everything for sure (i read my code a 10 times),
    what can be the problem ?

    • @Blackilykat
      @Blackilykat 2 года назад

      always share the code itself when making a question about it

    • @ducky1870
      @ducky1870 Год назад

      this is really late but what I found is that you need to change the overriden Paint method to paintComponent. Then change super.paint() to super.paintComponent()

  • @chingoputoh7969
    @chingoputoh7969 2 года назад

    Thanks so much man I was hopelessly stuck with my school project

  • @johnnymccauley5923
    @johnnymccauley5923 4 года назад +1

    I've copied and pasted this code, I'm using inteli J though. This first stage with displaying the images does not appear to be working?

    • @BroCodez
      @BroCodez  4 года назад

      Hmmm, I would first check the folder that your image is in. Second I would check to make sure that I have the line of code to draw the image g2D.drawImage(enemy, x, y, null);

    • @johnnymccauley5923
      @johnnymccauley5923 4 года назад

      @@BroCodez wow! Thanks for the reply. Yea inteli J doesn’t show the whole ‘default package’ but my images are within the same folder as my classes. I’ve also set the image observer to null.

    • @oussamagoumghar1596
      @oussamagoumghar1596 4 года назад

      @@johnnymccauley5923 i have the same problem can you help me

    • @johnnymccauley5923
      @johnnymccauley5923 4 года назад +1

      @@oussamagoumghar1596 heys! I haven’t revisited it since but I did do another UI tutorial with labels. Move the images outside the package.

    • @oussamagoumghar1596
      @oussamagoumghar1596 4 года назад

      Thanks Johnny

  • @thorbenschott2481
    @thorbenschott2481 2 года назад

    one more comment for the algorithm

  • @jorgetavares4136
    @jorgetavares4136 3 года назад

    Hi guys.
    I am following the instructions but my Panel doesn't not show up

    • @Blackilykat
      @Blackilykat 2 года назад

      did you make a JFrame and added the JPanel inside?

  • @eugenezuev7349
    @eugenezuev7349 5 месяцев назад

  • @andreleao.prodemge
    @andreleao.prodemge 2 года назад

    Hello how are you? Can anyone help me on how I can use Graphics2D other than using JFrame, JPanel or Applets? So, my project is web, I need the drawing to be rendered in a DIV, HTML element. Can someone help me? I've looked on many websites and videos, but they all just talk about JFrame, JPanel, Applets...

  • @martinpeterpaulparma8228
    @martinpeterpaulparma8228 2 года назад

    I cant run it whyyy? How can you all run it

  • @elvastaudinger4991
    @elvastaudinger4991 3 года назад

    Timer doesn't work including star(). java.awt.Timer was imported. i just cannot pass parameter Timer().
    why?
    thank you.

    • @ameersuhail4981
      @ameersuhail4981 3 года назад +1

      That's because, the Timer import on javax.swing.Timer; that used in this program

    • @Blackilykat
      @Blackilykat 2 года назад

      Cause it doesn't use java.awt.Timer, but javax.swing.Timer. I suggest importing javax.swing.*, java.awt.* and java.awt.event.* to avoid these issues

  • @evandervallejera2820
    @evandervallejera2820 2 года назад

    hi

  • @Tusci1
    @Tusci1 2 года назад

    better way to illustrate is shown