Choice Assignment Help

Assignment Help: >> Controls and Events - Choice

Choice:

A Choice class implements a pop-up menu of choices.  Just the current choice is visible in a Choice component. A choice can be modified through popping up the list of choices through clicking on the menu and selecting another item on the choice list.

Constructing a pop-up menu of choices includes the subsequent steps:

Creating choice object by using the single default constructor given.

Adding the items using the add( ) method.

void add(String item)

2189_choice.png

The Choice class also declares methods for inserting and removing item from the pop-up menus

// Illustrating choice

import java.awt.*;

import java.applet.*;

public class ChoiceApplet extends Applet

{

public void init ( )

{

Choice pizzaChoice = new Choice ( );

pizzaChoice.add("Large Pan Pizza");

pizzaChoice.add("Medium Pan Pizza");

pizzaChoice.add("Small Pan Pizza");

}

}

1359_choice1.png

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd