0% found this document useful (0 votes)
49 views1 page

Exercises GWT Widgets

The document provides 5 exercises to practice building extended widgets in development mode. The exercises include making a button that pops up a dialog with HTML text when pressed, converting a tabbed panel example to use stacked panels, creating a date input field that displays the entered year when a button is pressed, making an auto-completing city name text box that allows sending the selection to Google, and building a menu bar with dropdown lists of US states starting with the selected letter.

Uploaded by

Wobbles909
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views1 page

Exercises GWT Widgets

The document provides 5 exercises to practice building extended widgets in development mode. The exercises include making a button that pops up a dialog with HTML text when pressed, converting a tabbed panel example to use stacked panels, creating a date input field that displays the entered year when a button is pressed, making an auto-completing city name text box that allows sending the selection to Google, and building a menu bar with dropdown lists of US states starting with the selected letter.

Uploaded by

Wobbles909
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercises: Extended Widgets

Test all exercises in development mode.

1.

Make a button that, when pressed, pops up a dialog box that contains
<h1>Wow! Button was pressed!</h1>

2.

Copy the code for one of the examples from your last set of exercises that used
tabbed panels. Change it to use stacked panels (aka accordion panels) instead.

3.

Make a date-input field and a button. When the button is pressed, take the date that
the user entered, look up the year, and insert that into the page.

4.

Make a Java array that contains a few city names beginning with A and B. (See
http://www.airportcodes.org/ for a list.) Make an auto-completing text box that lets
the user choose a city name. For bonus credit, send the city name to Google when
the user presses a button.

5.

Make a menu bar where the top-level entries are M, N, and O. When you click
on an entry, you should get a list of the US states starting with that letter. Here are the
states:
M: Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri,
Montana
N: Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York,
North Carolina, North Dakota
O: Ohio, Oklahoma, Oregon
Try the simple case first, where clicking on the letter shows the list of states, and
clicking on a state pops up an alert (Window.alert) simply saying A state was
selected. If you feel inspired, change it to now show which state was selected.

http://www.coreservlets.com

You might also like