Results 1 to 4 of 4
  1. #1
    miguelms19 is offline Member
    Join Date
    Jan 2010
    Posts
    1
    Rep Power
    0

    Default Help with Radio Buttons

    Hi Guys

    Wondering if any of you would be able to help me.
    I have a ButtonGroup with five radio buttons.
    button1
    button2
    button3
    button4
    button5

    At the bottom I need to include two JButtons with up and down.
    The idea is to move the selected radio buttom up and down using the JButtons at the bottom.

    Any help would be really appreciated.

    Thanks
    miguelms19

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,361
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by miguelms19 View Post
    Hi Guys

    Wondering if any of you would be able to help me.
    I have a ButtonGroup with five radio buttons.
    button1
    button2
    button3
    button4
    button5

    At the bottom I need to include two JButtons with up and down.
    The idea is to move the selected radio buttom up and down using the JButtons at the bottom.

    Any help would be really appreciated.

    Thanks
    miguelms19
    There are other components made for that functionality: e.g. a JSlider or a JSpinner can do the job. In your scenario the user can still click any JRadioButton she wants.

    kind regards,

    Jos

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    There are many ways to acheive this functionality; for instance, why not create an ArrayList of JRadioButtons? If the up arrow has been pushed, iterate through the list finding the selected button and then selecting the previous JRadioButton in the list?

    Have fun.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    Doesn't sound like a very good design decision, but if you really need this functionality my Select Button Group class with its setSelectedIndex(int index) method might be useful to you.
    Select Button Group Java Tips Weblog

    db

Similar Threads

  1. Select one of X radio buttons
    By Adrien in forum AWT / Swing
    Replies: 1
    Last Post: 02-25-2010, 06:30 PM
  2. How can i setString when i use radio buttons?
    By Tahorn in forum AWT / Swing
    Replies: 4
    Last Post: 02-16-2010, 02:03 PM
  3. Displaying Radio Buttons in JSP
    By kishan in forum Advanced Java
    Replies: 4
    Last Post: 10-23-2009, 03:44 PM
  4. How to use Radio Buttons
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-25-2008, 02:26 PM
  5. radio buttons and paint
    By gtraylo in forum Java Applets
    Replies: 1
    Last Post: 04-19-2008, 12:43 PM

Posting Permissions

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