Java Programming Tutorial - 67 - JRadioButton 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.
45,239
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 3, 2009

We finish out program to test radio buttons in java.

  • likes, 0 dislikes

Link to this comment:

Share to:

Top Comments

  • Make a tic tac toe game

  • dude these tutorials are much appreciated

    keep em comin :)

see all

All Comments (75)

Sign In or Sign Up now to post a comment!
  • I knew you needed to know some math to learn how to program well, but no one told me I needed to know how to spell!

  • Great tutorials Bucky! I've been following since the first one to brush up my java skills.

    Since itemStateChanged is called twice; once for select and once for deselect, I added this to make sure that the font is set only on select:

    if(event.getStateChange()==Ite­mEvent.SELECTED)

    tf.setFont(font);

  • @ 5:35: I rewatched the video bucky. And you did it again :D.

  • I got Exception(no error) when compile the program:

    Exception in thread "main" java.lang.NullPointerException at java.awt.Container.addImpl(Con­tainer.java:1086) at java.awt.Container.add(Contain­er.java:998) at javax.swing.JFrame.addImpl(JFr­ame.java:562)

  • I got Exception(no error) when compile the program:

  • views got low low low low low lol lol ol ;<

  • @izaak791 Wow... First video I see with over 200 likes and 0 dislikes! :D

    He deserves it ^^

  • did anybody notice there was no dislike to this video?!! yeeeeah!

  • @12me91 An easier way to think of it is because in the previous tutorials we used if/else statements, in which the fonts were declared within the itemStateChanged method. However, this time the fonts were declared in the GUI constructor, with the radio buttons. Due to this, in order to make the buttons work they need to be made to pass their own independent font variable into the HandlerClass constructor, which can't be done when an object has already been declared.

    Hope this helps.

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