?
Solved

List to textfield

Posted on 2011-10-05
12
Medium Priority
?
303 Views
Last Modified: 2012-05-12
Same type of question

ThreedTrans = (List) currentProject.getThreedTranslatorOptionIds();

cur3dTrans.setText(??);
0
Comment
Question by:jkteater
  • 5
  • 4
  • 3
12 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 36919282
You can't expect everyone to be following your every move here ;) More info please (or at least a link). Even i can't remember and i probably answered it ;)
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36919292
Do you meant to have all em,lemets in there?

String s = "";
for(int j=0; j<ThreedTrans.size();j++){

s += (String) ThreedTrans.get(j) + ",";
}

cur3dTrans.setText(s); 

Open in new window

0
 

Author Comment

by:jkteater
ID: 36919306
Shoot I thought you guys where following my every thought pattern and question :)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Expert Comment

by:CEHJ
ID: 36919327
If it's a java.util.List subclass:
cur3dTrans.setText(ThreedTrans.toString());

Open in new window

0
 

Author Comment

by:jkteater
ID: 36919337
ThreedTrans = (List) currentProject.getThreedTranslatorOptionIds();

the above is getting a List of values.  In my dialog I have a panel with the following

3d Translator:   [text field (cur3dTrans)]  [button]

I need to display the values of the list in my textfield.  You may say don't use a textfield, but I need for the users to be able to cut from the field
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 36919399
>>If it's a java.util.List subclass:

Is it?
0
 

Author Comment

by:jkteater
ID: 36919402
Why is it when it displays it puts brackets around the values

[DWG, IGES]
instead of

DWG, IGES
0
 

Author Comment

by:jkteater
ID: 36919407
it is actually a ArrayList so I do have java.util.ArrayList
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36919412
Taht's how list.toString() works - with baracklets
Either use something like my code above - or strip away fiorst
and last charcater from toString()
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36919418

It does not matter - toString() for Lits or ArrayList works the same
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 200 total points
ID: 36919430
If you're lazy (i am)
cur3dTrans.setText(ThreedTrans.toString().replaceAll("^\\[|\\]$", ""));

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 36919506
:)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

850 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