Solved

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

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse shortcuts 9 54
Change the background and font colors in Notepad++ 5 80
login jsp example 24 46
Difference between List and Array in Python 5 61
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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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.
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…

785 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