[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
Java Programming Tutorial – 84 – Drawing Graphics
by
Tags:
Comments
32 responses to “Java Programming Tutorial – 84 – Drawing Graphics”
-
I LOVE JAVA
-
how do you use gpen
-
OH YES, Those Sweat Graphics!
-
any difference between canvas class and jpanel class as far as making a window with some images goes? I've been told jpanel is a component of a jframe (or a window as i understand it in layman terms) and a canvas object is added to that component. So so far i think that you use .add(canvas) on a jframe with the canvs having an overriden paint method. but by simply changing class extension from canvas to JPanel, and paint() method to paintComponent() I see the same result. can anyone explain why? does this video's way make replace an existing default jpanel from the jframe and paintComponent() puts a canvas on there for us? or am I completely off the rails?
-
Hi! Just a confused beginner from video 37! Hope to get to this video some time!
-
can some explain the code below please, why do we have x,y in constructor parameter initialised with axes of the top ones.
int x=10;
int y=10;
public Constructor(int x, int y){
this.x=x;
this.y=y;}
-
If i were 20 i'd have a job by now, but i'm only 13 🙁
-
Does anyone know how the drawComponent automatically gets called?
-
But that peach class do not have a Constructor. So how are all those executed????
-
Why do we need to add a JFrame object in the main class.? We never did that before. Is it because in all earlier GUIs we extend to JFrame but here we extended to JPanel?
-
Thank you so much! Clear, simple intro to Java drawing!
-
Hi, i tried to run the program but i only got a white screen, not rectangles ; there is a problem and its about the p component, it tells me "null" or something like i did not initialize the component called p
-
@thenewboston
I'm a bit confused. This looks a bit like a recursive method:
public void paintComponent(Graphics g) {
super.paintComponent(g);
} -
can you draw a blue rectangle, and then change the color to red when you click it?
-
regarding 2d character movements If my sprite sheet is horizontal would it cause problems?
-
If your program doesn't work maybe you could resolve that writing:
"public class Example extends jFrame" instead of the
"public class Example extends Jpanel" that he shows in the video,if that doesn't work try
"public class Example extends JComponent".If you get an error "The serializable class Example does not declare a static final serialVersionUID field of type long" simply click on that error icon on the Eclipse IDE and click on "Add default serial version ID".
-
"You should know this if you ever took a math class if your life" – Bucky
-
hi, i need to draw standard normal diviation, whats the easiest way to draw that line? o do i actually have to make 100ths of drawLine statements and then sort each dot on the line?
-
you never showed us how to download the java 2D library when i go on the site i am seeing lots of links and still cant access the libraries pls help it;s firetrucking frustrating man????
-
hi bucky i did exactly what u did and no rectangle this fukin thing driving up z wall
-
hi bucky for the fill Rect Function do i have to specify int for the variables??????i
-
i wrote down the program & I've got no errors but when i run it nothing comes out .. help me out !!
-
You just saved me, Bucky. I've been watching your videos since I started programming. It's 3:36am and I'm still awake 'cause I didn't pay attention on our last Java class. THANK YOU VERY MUCH.
-
For anyone that gets the error with super.paintComponent(g); you have to make sure that you're inheriting JPanel and not JFrame.
-
In bucky.java:
f.setLocationRelativeTo(null); // Pop up window in the middle. -
can we write g in the place of this ?? both will do same work or theres some diff.
-
I don't understand the use of the line "super.paintComponent(g);"
My program runs fine without this line.
Also, I tried changing all the "paintCompenent"s to "paint" and the program also runs fine. Why is that? Thanks in advance for any help! <3 -
When I try to run it, it displays peach.Peach class was not found in Peach project and there wasn't a main class found.
-
Thanks! Helped me a lot 😀
-
almost finish!
-
i love you
-
really goog, thanks
Leave a Reply