Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Java Swing Tutorial: MAKE SHAPES, GUI help: drawing graphics

Loading...

Sign in or sign up now!
34,379
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jul 28, 2009

This tutorial will show you how to create shapes in Java without a visual editor. I will use 2 classes because i prefer to keep my drawing class separate from the other classes. This way the drawing class, does just that, draw.

  • likes, 6 dislikes

Link to this comment:

Share to:

Video Responses

This video is a response to Java 11: Swing GUI Intro
see all

All Comments (40)

Sign In or Sign Up now to post a comment!
  • @thewhiteone102

    I know your comment was from 5 months ago, but hopefully I can help someone else.

    The "shapes.java" and the "draw.java" have to be in the same package for that to work.

  • hey! I ve seen many of your java gui tutorials. They have helped me. I ve been looking all over the internet to find how can i make a JButton be clicked only once and with no luck. The setEnabled method doesnt work for me.. Is there anything else?

  • you make me think i am in aeroplane...jesus,i can give you my microphone...

  • Great!!!!!! repaint() is what I've been looking for all over the internet. I hate my CS teacher. She could have taught us this easy method instead of all the jumbo mambos. Theory oriented people sucks!!! Thank you again. Plz keep up the good work.

  • when ever i try to run this a frame just shows up and its blank

  • Thanks, this really helped me out with a Checkers Game Project I'm creating.

  • @tuhinbhatt1 Simply go to the actionListener of the button and load up the new class there. You can create a new object from the other class file that will load the constructor of the new class, which will then load all the methods on the other class. You can also create a new frame in the actionListener, simply by JFrame frame = new JFrame("frame"); and you can also close the current frame by thisFrame.dispose();

  • @ultravanz have you found the answer(How to make a button another class file

  • how do you make a button open another class for you?

  • Great vid.. good job

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more