tubeshowcase●1,668,122 videos♡ My collection 0
← Learn to Code

Learn to Code42:55

Java Graphics Programming Tutorial - How To Draw Shapes, Paths, Curves, and Apply Transformations

choobtorials ↗

From the creator

Welcome to this Introduction to Java Graphics Programming, where we will be learning the basics of creating 2D Graphics in Java. We'll start by learning how to create some basic shapes, and how to combine them to create even more shapes. After that, we'll learn how to create paths and curves, as well as how to apply some basic graphics transformations. Twitter: https://twitter.com/choobtorials JAVA GRAPHICS TUTORIAL 00:00 Introduction 00:42 Creating a class that extends JComponent 02:11 Overriding the paintComponent method 02:28 What is the Graphics object for? 03:21 How to convert / cast the Graphics object into a Graphics2D object 04:23 The java.awt.geom package 04:58 How to create a rectangle using the Rectangle2D.Double class 05:26 How does the JComponent coordinate space work? Where is x=0 and y=0? 06:33 How to choose a color for drawing or filling shapes in Java 06:47 The RGB Channels 07:06 Java Color Constants 07:19 How to fill the shape with the chosen color 07:32 How to view the drawing / graphics 08:10 How to add a solid-colored background to a JFrame 09:41 How to create a circle using the Ellipse2D.Double class 10:04 How to set a new color 10:21 How to create a line using the Line2D.Double class 10:46 How to draw the line using the draw method 10:59 The graphics stacking order 11:39 Antialiasing 12:04 How to create a RenderingHints object to apply antialiasing 12:42 The setRenderingHints method 13:05 Decluttering the paintComponent method 13:33 How to draw a

Published 2021-03-15 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code