Java Video Tutorial 47

preview_player
Показать описание

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.
Рекомендации по теме
Комментарии
Автор

You're welcome :) It is so cool how many great programs you can write with a little knowledge. I make an asteroids game next in the tutorial. I cover many topics that you can then use to make a ton of other games. I'm glad your having fun

derekbanas
Автор

You're very welcome :) Graphics is the base class that allows for drawing on components. Graphics2D extends graphics so you can draw dimensional shapes and images. Here I am casting graphics (g) into a Graphics2D object. I hope that helps.

derekbanas
Автор

I'm glad to help. I'll be covering android very soon in tutorials. Fun stuff!

derekbanas
Автор

Parts 50 through 60 show you how to handle collision detection of polygons of any shape. I make an asteroids type game. I first introduce a math heavy way to handle motion and collision detection. In part 54 I show you an extremely easy non-math way to handle collision detection

derekbanas
Автор

I did that so I could have complete freedom in how I could draw on this component. I try to cover just about every way you can interact with these different classes. In doing so I hope I didn't confuse the topic. As the tutorial continues I use other classes that you may be more used to

derekbanas
Автор

I see. I would not have guessed casting but that makes perfect sense. I am studying Android and these tutorials have been very helpful. Thanks.

alcorn
Автор

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.

katty
Автор

I'm going to make a big tutorial on the JavaScript frameworks and HTML5 as soon as possible. I have so many things I want to do and not enough time

derekbanas
Автор

You're very welcome :) I'm here to help

derekbanas
Автор

It is my only hobby. I enjoy helping people :)

derekbanas
Автор

DrawStuff is my custom JComponent. When it is added to the JFrame, yes the paint function is called. Sorry I didn't explain that better

derekbanas
Автор

Sorry about that. The first 2 videos on this page will explain OOP better with java then I did the first time newthinktank.

derekbanas
Автор

You may be correct. I never thought of that for some silly reason.

derekbanas
Автор

I use the Eclipse IDE because it is free and identical on every OS

derekbanas
Автор

That has been my nickname forever. My daughter even thinks her last name is bananas :)

derekbanas
Автор

What is the error? I provide a link to working code in the description of this video to help as well

derekbanas
Автор

A few episodes back you asked what other tutorials you should do.  I forgot where to vote but let me make some suggestions.
I am really interested in Python, but since it's also object-oriented, IDK if it's the best to learn as it relates to learning Java.
but MySqul, Html, Xml and JavaScript seem to be good related codex to earn.
Thanks!  Your vids are great!  They cut to the chase, show the results of coding before newbs like me start grinding out the code.  It's great to know where I am going before actually venturing into an endeavor like coding.
I like the pace you keep!  It's really helpful to go through quickly and see the examples over and over to really grasp how to format properly.
Ideally, I would like to watch an entire series done BY YOU before learning anything!
Keep up the great work!  You are doing a great service to everyone onyoutube!

cambotandclay
Автор

Great Job Derek!

I'm learning a lot thank so much!

brainiacmarco
Автор

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.

TheWombatGuru
Автор

The constructor is used to initialize every new object that is created. It can't be static. A static method is one that every class shares equally as static variables are also shared by every object that is created. I hope that helps? I review the OOP concepts in this tutorial and the one that follows
I hope it helps

derekbanas