Results 1 to 5 of 5
  1. #1
    Tahorn is offline Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Default How can i setString when i use radio buttons?

    I have realy simple but very stupid problem. I would like to know how to set string?

    I have JTextarea created. Also i have 3 JRadioButtons created. They control what text JTextArea displays.

    I did it using this method:

    public void itemStateChanged(ItemEvent event){
    text.setText(string);
    }


    But my problem showsup then i use another 3 JRadioButtons. I want to set them to change some text in my created JTextArea. I create String varible and add it to JTextArea.

    textarea = new String("First day\t" + stringVariable + "text text text text text... \n"

    And now my aim is that radio buttons will be able to change ----> stringVariable <----

    public void itemStateChanged(ItemEvent event){
    stringVariable.setString(string); // <----- How i can set string here?
    Becouse setString = Error.

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    7

    Default

    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    Tahorn is offline Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Default

    So what. Just answer to the siplme question if you want and can.

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

    Default

    Quote Originally Posted by Tahorn View Post
    So what. Just answer to the siplme question if you want and can.
    Most of us have lives and jobs, and don't like wasting time answering a question that has likely been already answered elsewhere. For this reason most here will refuse to help someone who continues to cross-post without being up front about and without providing links to cross-posted questions. You'll find that in this, we are no different from other programming fora or other volunteer help sites (for example please see JavaRanch's FAQ about this). It's up to you but as for me, I'll wait for you to address this before answering any questions. Much luck.

  5. #5
    Tahorn is offline Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Default

    I didn't get answer there. So i came here. Anyway sorry for troubles.

Similar Threads

  1. Displaying Radio Buttons in JSP
    By kishan in forum Advanced Java
    Replies: 4
    Last Post: 10-23-2009, 04:44 PM
  2. Java Radio Buttons
    By dbashby in forum New To Java
    Replies: 4
    Last Post: 09-21-2009, 01:07 AM
  3. [SOLVED] Radio Buttons
    By dbashby in forum New To Java
    Replies: 2
    Last Post: 04-04-2009, 04:44 PM
  4. How to use Radio Buttons
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-25-2008, 03:26 PM
  5. radio buttons and paint
    By gtraylo in forum Java Applets
    Replies: 1
    Last Post: 04-19-2008, 01: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
  •