Solved

How to get the selection from a drop down list in Java?

Posted on 2013-11-13
2
266 Views
Last Modified: 2013-11-14
Hi,
I am working on creating a GUI in Java. In this GUI, I have a drop down list. I would like to get the selection from this list into a string.

This is the code snippet that I have in order to create this drop down list:


        
final Combo combo_workspaces = new Combo(shell, SWT.READ_ONLY);
.............
.........
//SOME MORE CODE IN HERE TO PREPARE THE CONTENT OF THIS COMBO.
.......
..............
combo_workspaces.setItems(workspacesArray.toArray(new String[workspacesArray.size()]));
        GridData data_comboWorkspaces = new GridData(GridData.FILL_HORIZONTAL);
        combo_workspaces.setLayoutData(data_comboWorkspaces); 

Open in new window




Can you please help me to get this selected value from the drop down list?
0
Comment
Question by:Tolgar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39647076
combo_workspaces.getText() ?
0
 

Author Comment

by:Tolgar
ID: 39647093
That should work, right! I will try.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Suggested Courses

710 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