Results 1 to 7 of 7
Like Tree1Likes
  • 1 Post By Sierra

Thread: Radial buttons and IFs

  1. #1
    vramba is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Radial buttons and IFs

    Hi!

    My problem is next. I have two groups of buttons, let's name them A and B. A group consists of 2 buttons, and B group consists of 4 buttons. What I need is next:

    I need
    if (A1 is selected && B2 is selected)
    write_something_in_my_text_field_after_the_common( not radial)button_is_pressed;

    I did lot of Googleing, every site says different. Furthermore, I'm completely new in this, so I ask you guys, what part of code should I implement and how does the syntax look like.

    Thanks!

  2. #2
    Sierra is offline AN21XX
    Join Date
    Mar 2012
    Location
    Munich
    Posts
    297
    Rep Power
    3

    Default Re: Radial buttons and IFs

    I hate sounding like an idiot, but what is a radial button?
    Fubarable likes this.

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: Radial buttons and IFs

    What class are your buttons? Does that class have any methods you could use for testing the state of the buttons?
    If you don't understand my response, don't ignore it, ask a question.

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

    Default Re: Radial buttons and IFs

    Since you're completely new, read the API for any of the button classes and follow the link to the Swing tutorial from there.

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

  5. #5
    vramba is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Re: Radial buttons and IFs

    Quote Originally Posted by Norm View Post
    What class are your buttons? Does that class have any methods you could use for testing the state of the buttons?
    It's JButton. I need a method which will determine whether button is checked or not.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: Radial buttons and IFs

    JButton. I need a method
    Look in the API doc for all the methods in the class and the inherited methods also.
    Java Platform SE 6
    If you don't understand my response, don't ignore it, ask a question.

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

    Default Re: Radial buttons and IFs

    Quote Originally Posted by vramba View Post
    It's JButton. I need a method which will determine whether button is checked or not.
    Are you sure about this? JButtons don't get "checked" while JCheckBox and JRadioButton (which is what I *think* you mean) do, as does a JToggleButton in a matter of speaking. Not to sound harpy, but please be as precise as possible when describing your problem. Learning to program is difficult, and helping others do this is even harder, hard enough that if you're asking questions you should strive to make it as easy as possible for us to help you and to avoid this type of confusion.

Similar Threads

  1. Detecting buttons
    By jsobel in forum AWT / Swing
    Replies: 2
    Last Post: 04-06-2012, 05:52 PM
  2. Help with Buttons
    By wld4ubabay in forum New To Java
    Replies: 20
    Last Post: 05-17-2010, 08:13 AM
  3. Where To Get Pop Up Buttons
    By hitmen in forum AWT / Swing
    Replies: 7
    Last Post: 03-26-2009, 04:05 AM
  4. SWT Radial Layout Demo
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-11-2008, 04:51 PM
  5. How to use SWT Buttons
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-11-2008, 04:44 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
  •