Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Emily Diaz   on Jun 11 In Java Category.

  
Question Answered By: Randall Franklin   on Jun 11

This implementation is easy. Use String arrays to build your combobox.

String[] values = new String[3]; // I am not 100% sure with this syntax. Just
check it
values[0] = "15-25"
values[1] = "26-30"

JComboBox age = new JComboBox[values];

Use this combobox  in your program by adding it to your panel.

To retrieve the information entered by the user, get the selected index value.
using a simple switch statement or a if-else u can retrieve the values.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on How would I make a combo box do this? Or get search suggestion and latest updates.


Tagged: