Pretty cool that you have the time and energy to make videos to help others!
However, I can’t help but criticize some points you made in your videos:
Tutorial 1
- Why are you creating 2 JFrames? Your Window class already extends JFrame, no need to have a JFrame variable inside it.
- When accessing static variables, you use the class name, not an object’s name, for example: JFrame.EXIT_ON_CLOSE, not j.EXIT_ON_CLOSE.
Tutorial 2
- It is best to extend JComponent, instead of JPanel, since the JPanel isn’t focusable by default.
- Never ever override the paint(Graphics) method of any Swing component, use paintComponent(Graphics).
- You created the Thread object, but you never actually started the thread.
- Same as point 2 for Tutorial 1, use Thread.sleep(3), not t.sleep(3).
Tutorial 3
- Variables like X and Y shouldn’t be public and static just so you can access them from your InputH class. Pass the Board object to the InputH class so it can modify the variables on that object, not globally.
- Since you never started the thread to begin with, your repaint() wasn’t getting called. It is bad to put repaint() inside your paint method.
Tutorial 4
- You were getting that “line” effect because you didn’t clear the screen every frame. Instead of double buffering (by using img1) on an already double buffered JPanel, you should simply call g.clearRect(x,y,w,h).
- Creating a new Image every single frame is a huge waste of memory, create 1 Image object and reuse it. However as noted above, it is best to just clear the screen.
Tutorial 5
- It’s best to not use ImageIcon to load images, use the ImageIO class: ImageIO.read(URL) returns a BufferedImage.
- Just like the X and Y, don’t make the Image variable static! That is also why getClass() wouldn’t work, since you can’t call a non-static method in a static context.
- It’s usually a bad idea to make “res” a source folder, since you get problems with exporting later on. Put “res” under “src” so you can do getResource("/res/Player.png")
Don’t take these points the wrong way. I’m only trying to help here. I wish I had the time to make videos and I admire your enthusiasm.
However, it is painfully obvious that you aren’t very familiar with Java and basic OO principles yourself. I recommend you learn more about game making before teaching others to make games
This post includes links to many JGO posts for creating Java2D games.