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 9087577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:43:40+00:00 2026-06-16T21:43:40+00:00

I’m trying to show all data that I got in the textarea public static

  • 0

I’m trying to show all data that I got in the textarea

    public static void randNumQueue(){
    Queue<String> myQueue = new LinkedList<>();
    if(average12==30){
        long range = (long)randNum2 - (long)randNum1 + 1;
        long fraction = (long)(range * random.nextDouble());
        number = (int)(fraction + randNum1);
        System.out.println(number);
        Set mySet = new HashSet();
        for (int j = 0; j<number; j++)
        {
            int pick;
            do{
                pick = random.nextInt(number)+1;
            }while(!mySet.add(pick));
            myQueue.add(Integer.toString(pick));
        }
        System.out.println("the queue size: "+myQueue.size());
        sizeQ = myQueue.size();
        Iterator it = myQueue.iterator();
        while(it.hasNext()){
                String iteratorValue = (String)it.next();
                Qnum = Integer.parseInt(iteratorValue);
                System.out.println("queue next value: "+Qnum);
            }
    }
}
@Override
public void actionPerformed(ActionEvent e) {
    if(e.getSource().equals(b1)){
        randomAverage();
        testAmount = testAmount + 1;
        label5.setText(""+testAmount);
        area3.setText(""+sizeQ);
        area1.setText(""+Qnum);
    }

}

area1 is area text which I’m trying to show all data which I got from IteratorValue

from the above function area1 just showed the last value which I got from iteratorValue

anyone know how to show all the value in area1(textarea)?

  • 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-06-16T21:43:41+00:00Added an answer on June 16, 2026 at 9:43 pm

    Use setText when you want to replace the contents of the text area, use JTextArea#append when you want to add text to the end of the text area

    Updated

    It’s a “little” difficult to assess what it is you are trying to do, but something like…

    while(it.hasNext()){
        String iteratorValue = (String)it.next();
        area1.append(iteratorValue + "\n");
        Qnum = Integer.parseInt(iteratorValue);
        System.out.println("queue next value: "+Qnum);
    }
    

    In your action performed method, remove area1.setText(""+Qnum);. This will append each result to the text area. If you want to clear the text, use something like area1.setText(null)

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

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
i got an object with contents of html markup in it, for example: string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I am trying to understand how to use SyndicationItem to display feed which is

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.