Java Video Tutorial 47

Java Video Tutorial 47

FavoriteLoadingAdd to favorites

Get the code:

Java468x60

In this part of my Java Video Tutorial, I cover how to draw 2D graphics in Java. This tutorial will serve as an introduction before I make a paint application with Java.

I cover drawing lines, curves, ellipses, rectangles and numerous other shapes. Then we look at strokes, fills and gradients.

source

By |2019-04-28T18:31:03+00:00April 28th, 2019|Java Video Tutorials|24 Comments

24 Comments

  1. David Sinca April 28, 2019 at 6:31 pm - Reply

    OpenGL is better, lol.

  2. Lil Shed April 28, 2019 at 6:31 pm - Reply

    Do you need to watch all previous tuts to be able to use these ones (graphics and game development) effectively

  3. Jianxiang Dong April 28, 2019 at 6:31 pm - Reply

    How to draw a pixel? If I want to draw my own designed shape.

  4. Cosmo April 28, 2019 at 6:31 pm - Reply

    You sound like Hank Hill

  5. Adarsh Punj April 28, 2019 at 6:31 pm - Reply

    Can anybody tell me why this is working even without calling the paint() method? [6:57]

  6. Spanky April 28, 2019 at 6:31 pm - Reply

    9:05 opps I forget to cover a normal rectangle before I covered a round rectangle. lol I was going to say wft..

  7. The Family April 28, 2019 at 6:31 pm - Reply

    I get the error:

    Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    at ball.Ball.main(Ball.java:13)
    my project name obviously is ball and line thirteen of my code is:
    public static void main(String[] args){
    i am using eclipse java oxygen ide

  8. Эдуард Мартыненко April 28, 2019 at 6:31 pm - Reply

    How do you draw a triangle?

  9. MrVasylyca20 April 28, 2019 at 6:31 pm - Reply

    why i can't see the graphics,it show me an empy frame! :(( ….i called the draw method,no errors and also no graphics on frame :((

  10. Mømø Râhmâñ April 28, 2019 at 6:31 pm - Reply

    how to add graphics into a jbutton?
    suppose when I click a button (round) then it's draw a round shape. but I can't link graphics under a button. please help me

  11. Stephen David April 28, 2019 at 6:31 pm - Reply

    Hi Derek! Can you give me a suggestion what to use making a simple map like this for a game?
    http://pasteboard.co/uK6YorYz.png
    Thanks a lot in advance!

  12. katty April 28, 2019 at 6:31 pm - Reply

    I really appreciate how you sound so expressive in your tuts. Most tuts I see are so monotone, I doze off while trying to learn.

  13. Ahmed Hossam April 28, 2019 at 6:31 pm - Reply

    best evening on your thighs!!!!

  14. Andy Chrzanowski April 28, 2019 at 6:31 pm - Reply

    When im trying to compile my code (Im using sublime text) I keep getting the error Graphics cannot be converted to Graphics2D
    Graphics2D graph2 = (Graphics2D)g;

  15. chandan kumar April 28, 2019 at 6:31 pm - Reply

    I am getting these errors PLEASE HELP

    Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Antialiased rendering mode is not compatible with Text-specific antialiasing enable key
    at sun.java2d.SunGraphics2D.setRenderingHint(Unknown Source)
    at f$DrawStuff.paint(f.java:38)
    at javax.swing.JComponent.paintChildren(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JComponent.paintChildren(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)

    And many more of same type

  16. Nick Chernuha April 28, 2019 at 6:31 pm - Reply

    well, i've subscribed! thanks a lot!

  17. brainiac marco April 28, 2019 at 6:31 pm - Reply

    Great Job Derek!

    I'm learning a lot thank so much!

  18. A Centill April 28, 2019 at 6:31 pm - Reply

    Talking about graphics,will you do a tutorial about graph algorithms any time soon?

  19. MisManageMen April 28, 2019 at 6:31 pm - Reply

    Hello Derek, Please please make java ai tutorials. thanks!

  20. Sayan Das April 28, 2019 at 6:31 pm - Reply

    And can u suggest a good book for reading the theory??

  21. Sayan Das April 28, 2019 at 6:31 pm - Reply

    Will this code work for BlueJ interface??

  22. Hocine Mansouri April 28, 2019 at 6:31 pm - Reply

    what i can do to retrieve points coordinates after rotation??

  23. Ahmed Al-baghdadi April 28, 2019 at 6:31 pm - Reply

    You Awesome!

  24. TheWombatGuru April 28, 2019 at 6:31 pm - Reply

    You're doing a lot about Java Swing in this tutorial series, are you planning on making a JavaFX tutorial series? I'm currently watching TheNewBoston's series, he explains it clearly, but a bit slow, you always seem to tell a lot of information in a very short amount of time and I like it.

Leave A Comment

*