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

Java Programming Tutorial - 63 - JButton Final Program

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
66,941
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 2, 2009

Finally we get top run and see our JButtons!

  • likes, 3 dislikes

Link to this comment:

Share to:

Top Comments

  • IF YOUR GETTING "Exception in thread "main" java.lang.NullPointerException at javax.swing.ImageIcon.init(Unk­­nown Source) at Gui.init(Gui.java:31) at apples.main(apples.java:7)" ERROR Move Your Picture To Bin And Not Src!!!

    THUMBS UP SO OTHER PEOPLE KNOW!

  • Microsoft would never buy this..... it does not contain any bugs, that's not their style...

see all

All Comments (170)

Sign In or Sign Up now to post a comment!
  • CLASSCEPTION!

  • @WhiteyMcCrackers Dont worry, image was the wrong size >.<

  • @WhiteyMcCrackers I've tried placing the images in the bin folder, but it still does not work...

    What else could i try? The code is perfect :/

  • @WhiteyMcCrackers thx man

  • @MrYouMath Now you can create an instance of your class hero called Cloud

    hero Cloud = new hero(100,20);

    You can also create another hero. eg.Tifa

    hero Tifa = new hero(80,30);

    I hope you see what its good for:). The constructor just creates an instanc(new hero(). If you like it can create an instance with initialising variables (new hero(100,20);). Its very important that the constructor is public and its name has to be the name of the class.

  • @franchyze922 A constructor is something like a initialiser. if you create an instance of an object, then you mostly want to initialise your variables(members). E.g. you have a class called hero,with the variables hp and mp, for your game. And you want to create a hero instance called Cloud with hp = 100 and mp = 20. To not always assign these values you create a constructor e.g.:

    public hero(int health, int magicpoints){ hp = health; mp = magicpoints;

    }

  • can somebody please explain a constructor!??

  • a class inside a class?!?! CLASSCEPTION!!!

  • @mihek Bethesda would buy it too...

  • @mihek Do you have a mac then? :P

Loading...

Alert icon
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