[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Array and Text Fields

Posted on 2011-10-05
3
Medium Priority
?
254 Views
Last Modified: 2012-05-12
If I am taking in a array

String[] emails = proj.getEmailAddresses();

how can I show the values of the array in my textfield?  Is this possible?

Here is the method I am calling
//////////////////////////////////////////////////////////////////////////
   //                                                                      //
   //                     updateCurrentEmails()                            //
   //                                                                      //
   //////////////////////////////////////////////////////////////////////////
   private void updateCurrentEmails() {
      if (currentProject != null) {
            curEmails.setText(); <==  value of array here?
      } // end if
      else {
         curEmails.setText("NO EMAILS SELECTED");
      }
   } // end updateCurrentProjectLabel()  
0
Comment
Question by:jkteater
  • 3
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 200 total points
ID: 36917868
The simplest would be
curEmails.setText(Arrays.toString(emails));

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 36917877
Since there are several, it would probably be better to use a JList
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 36917908
:)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month19 days, 18 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question