Solved

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

Posted on 2013-11-13
2
264 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
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
null output 3 36
T-SQL: Preventing Duplicate Records from Being Returned When "Joining" Code Blocks 2 54
Query Syntax 17 43
ejb entity bean example issue 2 18
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…
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 …
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.

820 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