Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7560547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:55:54+00:00 2026-05-30T12:55:54+00:00

I am trying to create a java function where it takes 2 parameter. One

  • 0

I am trying to create a java function where it takes 2 parameter. One is comma delimited list of string that represent what will be called for radio button. Second is comma delimited list of string that represents the variable respected to 1st parameter.

For example, If I write f1(“apple,banana”, “a,b”), I wanted to make JRadioButton with apple and banana along with a and b being their variable.

Is this possible?

I tried to use split(“,”) but I did not get too far…

Thanks in advance!

EDIT: I came up with following but still now luck..

static void f5(String question, String rbLabel, String rbVar, String help)
{
    JOptionPane.showInputDialog(question);

    ArrayList<String> rbLabelAL = new ArrayList<String>();
    ArrayList<String> rbVarAL = new ArrayList<String>();

    String[] token;
    String[] token2;
    token = rbLabel.split(",");
    token2 = rbVar.split(",");

    if(token.length == token2.length)
    {
        for(int i=0;i<token.length;i++)
        {
            rbLabelAL.add(token[i]);
            rbVarAL.add(token2[i]);
        }
    }
    JRadioButton(rbLabelAL(0));

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:55:56+00:00Added an answer on May 30, 2026 at 12:55 pm

    Following up on my comment….if you wanted to do something like this, I would suggest creating an arraylist.

    Something like…. ArrayList<String> options = new ArrayList<String>();

    Add in your options….options.add("apple");

    Then pass the arraylist into your method and create the radio buttons as such…JRadioButton(options(i));

    Of course you would have to iterate through the list to create all buttons.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to create a php function that converts a string date to a
I'm trying to write a really small program in Java that takes a string
I'm trying to create a simple Java app that uses JNI to call some
I am trying to create a java script function to keep track of the
I'm trying to create a chaining function for working with strings that are returned
Okay, I'm trying to create a simple app that will draw a shape (I'm
I'm trying to create a function in Groovy that does the following: Accepts 2
In my Java app I am trying to create a very simple form with
I’m trying to create an instance of: java.awt.geom.Point2D.Double in ColdFusion. Point2D.Double is a nested
I am trying to create a Key Listener in java however when I try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.