Java 2D animation 🎞️

Поділитися
Вставка

КОМЕНТАРІ • 163

  • @BroCodez
    @BroCodez  3 роки тому +99

    //------------------------------------------------
    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 2 роки тому +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 ();
      }
      }

  • @mypythonplace
    @mypythonplace Рік тому +5

    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 Рік тому +1

    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

  • @holohien9115
    @holohien9115 3 роки тому

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

  • @pleasedontwatchthese9593
    @pleasedontwatchthese9593 11 місяців тому

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

  • @niratomata
    @niratomata 3 роки тому +8

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

  • @ljront3126
    @ljront3126 Місяць тому

    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👍

  • @accumulator4825
    @accumulator4825 2 роки тому

    Thanks dude, really needed this!

  • @nawfalnjm5699
    @nawfalnjm5699 3 роки тому +1

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

  • @shaynazoedeguzman7418
    @shaynazoedeguzman7418 2 роки тому

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

  • @micahdavis1369
    @micahdavis1369 8 місяців тому +1

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

  • @discreet_boson
    @discreet_boson 3 роки тому +1

    This is awesome

  • @wangobaloch2553
    @wangobaloch2553 3 роки тому +2

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

  • @Rohan-Prabhala
    @Rohan-Prabhala 11 місяців тому

    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?

  • @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

  • @carriejiang1570
    @carriejiang1570 2 роки тому +1

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

  • @enoselinsa9771
    @enoselinsa9771 Рік тому

    This is exactly what i need!!!

  • @JAGM77MX
    @JAGM77MX Рік тому

    Outstanding!

  • @paraparasolian6484
    @paraparasolian6484 2 роки тому

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

  • @najmulislam9658
    @najmulislam9658 2 роки тому

    You are My Hero bro....

  • @minhgiang7945
    @minhgiang7945 2 роки тому

    Thank you for your tutorial

  • @seabass6106
    @seabass6106 3 роки тому +4

    LOUD & CLEAR! THANKS BRO

    • @BroCodez
      @BroCodez  3 роки тому +1

      thanks for watching Oberdorfer

  • @cate01a
    @cate01a 3 роки тому +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  3 роки тому +6

      that's not a bad idea

    • @tvt-Ar
      @tvt-Ar Рік тому +1

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

  • @broderickjohnson7167
    @broderickjohnson7167 3 роки тому

    This will be very useful!!

  • @alexandrevinicius2960
    @alexandrevinicius2960 Місяць тому

    that's so sick!

  • @oguzhantopaloglu9442
    @oguzhantopaloglu9442 3 роки тому

    wow this was very useful

  • @timurelfiki
    @timurelfiki 2 роки тому

    Thanks really coll content!🔥🔥🔥

  • @eliasferdji7711
    @eliasferdji7711 Рік тому

    Génial la vidéo !

  • @giogio3208
    @giogio3208 2 роки тому

    SWAG DUDE!!!!

  • @attalaw36
    @attalaw36 3 роки тому

    thank you very helpful ...

  • @naikels6922
    @naikels6922 5 місяців тому

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

  • @kemann3815
    @kemann3815 2 роки тому

    Thanks a lot!

  • @astonmargolis-dias7089
    @astonmargolis-dias7089 5 місяців тому

    lmaaooo siiiick haha 🔥🔥

  • @matt_acosta
    @matt_acosta Рік тому

    Thank you!

  • @jwflammer
    @jwflammer 2 роки тому

    really cool

  • @schee4887
    @schee4887 7 місяців тому

    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?

  • @user-et3sj6xt4p
    @user-et3sj6xt4p 8 місяців тому +1

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

    • @DorinCurnic
      @DorinCurnic 6 місяців тому

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

  • @mheeprising8840
    @mheeprising8840 4 місяці тому

    Thank you !!!

  • @SorryDaSlayer
    @SorryDaSlayer 2 роки тому

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

  • @Amin-qw3ol
    @Amin-qw3ol 3 роки тому

    Thanks Bro

  • @powerfullone7915
    @powerfullone7915 3 роки тому

    Loved it bro

    • @BroCodez
      @BroCodez  3 роки тому

      thanks for watching!

  • @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: ua-cam.com/video/CmK1nObLxiw/v-deo.html

  • @ayae.muhammed7305
    @ayae.muhammed7305 3 роки тому +2

    I loveeee it

    • @BroCodez
      @BroCodez  3 роки тому

      thanks for watching Aya

  • @aqibishaq885
    @aqibishaq885 3 роки тому

    wao superrr

  • @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?

  • @ibrahimylmaz8378
    @ibrahimylmaz8378 2 роки тому

    thanks bro

  • @derkach7907
    @derkach7907 2 роки тому +1

    Nice

  • @leviplays7466
    @leviplays7466 4 місяці тому

    you're the bro

  • @anonimanonim1223
    @anonimanonim1223 2 роки тому

    Great

  • @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

  • @user-kw6lh4zd2r
    @user-kw6lh4zd2r 17 днів тому +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 😭 🙏

  • @romawar1869
    @romawar1869 2 роки тому

    Thank you

  • @teowong1
    @teowong1 2 роки тому

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

  • @fitfirst1858
    @fitfirst1858 3 роки тому

    thank you!!

    • @BroCodez
      @BroCodez  3 роки тому

      thank you for watching fafa

  • @gautamsajith5544
    @gautamsajith5544 Рік тому

    Can we implement this using labels?

  • @pauljolou3617
    @pauljolou3617 2 роки тому

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

  • @wtf_xitiz
    @wtf_xitiz 2 роки тому

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

  • @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

  • @louiemunoz
    @louiemunoz 2 роки тому

    thanks

  • @MrLoser-ks2xn
    @MrLoser-ks2xn 2 роки тому

    Thanks

  • @user-og5gn9hd8i
    @user-og5gn9hd8i 7 місяців тому

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

  • @noisyguest5249
    @noisyguest5249 3 роки тому +7

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

    • @rewrose2838
      @rewrose2838 3 роки тому +2

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

    • @BroCodez
      @BroCodez  3 роки тому +3

      I scheduled the video for release at a certain time

  • @tryme5275
    @tryme5275 8 місяців тому +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

  • @sanskarsongara2592
    @sanskarsongara2592 3 роки тому +1

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

  • @augustinejoseph4302
    @augustinejoseph4302 Рік тому

    👍👍👍

  • @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 2 роки тому

      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

  • @jfruit6310
    @jfruit6310 3 роки тому +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 3 роки тому +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

  • @onlytheflames
    @onlytheflames 2 роки тому

    how do you make the animationt to stop?

  • @cyanuranus6456
    @cyanuranus6456 Рік тому

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

  • @thienvuphan6840
    @thienvuphan6840 3 роки тому

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

  • @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

  • @chingoputoh7969
    @chingoputoh7969 2 роки тому

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

  • @user-sm7rh4lu6p
    @user-sm7rh4lu6p 6 місяців тому

    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?

  • @andreeairina4750
    @andreeairina4750 3 роки тому

    👍🏻

  • @chienlai6036
    @chienlai6036 2 роки тому

    How can i remove the white background of the image

  • @SeniorScriptKitty
    @SeniorScriptKitty 4 місяці тому

    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

  • @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

  • @jpiongchuanho3422
    @jpiongchuanho3422 3 роки тому +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  3 роки тому +4

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

    • @jpiongchuanho3422
      @jpiongchuanho3422 3 роки тому +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

  • @mahmoodkanj9078
    @mahmoodkanj9078 3 роки тому

    shet man

  • @andreleao.prodemge
    @andreleao.prodemge Рік тому

    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...

  • @pobrika2631
    @pobrika2631 Рік тому

    Please apply for teacher position at my school.

  • @timurelfiki
    @timurelfiki 2 роки тому

    Hello from Russia🇷🇺!

  • @hugo-garcia
    @hugo-garcia Рік тому +1

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

  • @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

  • @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?

    • @MJ_abc
      @MJ_abc 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 8 місяців тому

      @@Blackilykat you saved my day

  • @maxwong1768
    @maxwong1768 Рік тому +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 ;
    }

  • @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

  • @martinpeterpaulparma8228
    @martinpeterpaulparma8228 2 роки тому

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

  • @karippaitech8963
    @karippaitech8963 Рік тому +1

    How to increase background image size

  • @damiengraulvehus8836
    @damiengraulvehus8836 2 роки тому

    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()

  • @WhiteWallAh_
    @WhiteWallAh_ 9 місяців тому

    woow he used eclipse

  • @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?

  • @MrLoser-ks2xn
    @MrLoser-ks2xn Рік тому

  • @jorgetavares4136
    @jorgetavares4136 2 роки тому

    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?

  • @johnnymccauley5923
    @johnnymccauley5923 3 роки тому +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  3 роки тому

      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 3 роки тому

      @@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 3 роки тому

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

    • @johnnymccauley5923
      @johnnymccauley5923 3 роки тому +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 3 роки тому

      Thanks Johnny

  • @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

  • @thorbenschott2481
    @thorbenschott2481 2 роки тому

    one more comment for the algorithm

  • @evandervallejera2820
    @evandervallejera2820 Рік тому

    hi

  • @mosabxgamer3335
    @mosabxgamer3335 2 роки тому +1

    //xD//

  • @Tusci1
    @Tusci1 Рік тому

    better way to illustrate is shown