Page 2 of 2 FirstFirst 12
Results 21 to 26 of 26
Like Tree1Likes

Thread: radio button

  1. #21
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,985
    Rep Power
    9

    Default Re: radio button

    I suggest checking out the API for useful functions. Maybe try a few out to see what they do.

    JRadioButton (Java Platform SE 7 )
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  2. #22
    gbonecapone is offline Member
    Join Date
    May 2013
    Posts
    68
    Blog Entries
    1
    Rep Power
    0

    Default Re: radio button

    sorry kevin i didnt see your last post. because im not sure how the button works. kinda learning as i go along.

  3. #23
    gbonecapone is offline Member
    Join Date
    May 2013
    Posts
    68
    Blog Entries
    1
    Rep Power
    0

    Default Re: radio button

    so i ended up using a toggle and when it is selected it set the text of a hidden label to -1 and within my equation i had handsign = .getText() of that label. the label is originally 1 and changes when toggle is pressed and changes back if it is released. not professional way of doing things but its going to have to work. thanks for all you help guys. sorry i couldnt follow your directions and do it the way you suggested. i guess that was beyond my knowledge of java at this point.

  4. #24
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,985
    Rep Power
    9

    Default Re: radio button

    Quote Originally Posted by gbonecapone View Post
    so i ended up using a toggle and when it is selected it set the text of a hidden label to -1 and within my equation i had handsign = .getText() of that label. the label is originally 1 and changes when toggle is pressed and changes back if it is released. not professional way of doing things but its going to have to work. thanks for all you help guys. sorry i couldnt follow your directions and do it the way you suggested. i guess that was beyond my knowledge of java at this point.
    Sounds like it shouldn't be too hard to take that code and convert it to something more like what I'm talking about. Instead of getting the text of the hidden text box, why not create that String based on whether the JRadioButton is selected?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #25
    gbonecapone is offline Member
    Join Date
    May 2013
    Posts
    68
    Blog Entries
    1
    Rep Power
    0

    Default Re: radio button

    thats what i tried but i for some reason couldnt carry that variable out of the actionperformed to save my life. it would change it and print it out to show me but wouldnt transfer to the equation where the rest of the variable were. i probably did something wrong but its not a big deal ill just keep it like this even though its unprofessional.

  6. #26
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,406
    Rep Power
    20

    Default Re: radio button

    See #19. If you don't understand Kevin's suggestion, then ask for clarification. For the logic behind the GUI you have shown in #12, you do not need an ActionListener.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. radio button error
    By dekon in forum New To Java
    Replies: 2
    Last Post: 08-10-2011, 09:06 PM
  2. lwuit radio button
    By gaurav_17may in forum CLDC and MIDP
    Replies: 1
    Last Post: 07-25-2011, 12:10 PM
  3. Radio Button
    By S-NESH in forum New To Java
    Replies: 6
    Last Post: 02-04-2011, 05:03 PM
  4. Radio Button help!
    By javanator in forum New To Java
    Replies: 3
    Last Post: 04-25-2010, 08:01 PM
  5. How to use SWT Radio Button
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-25-2008, 02:25 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •