FXTrackpublic class FXTrack extends Applet Simple Applet to track a Fedex shipment without having to wait
for all of FedEx's bloated images to download. |
Fields Summary |
---|
GregorianCalendar | gc | DecimalFormat | nf | String | shipDate | Choice | destChooserThe choice item for destination country | ActionListener | handler | protected Button | goButton | protected TextField | numField |
Methods Summary |
---|
public void | init()
setBackground(Color.pink);
setLayout(new GridLayout(3,2));
add(new Label("Dest. Country:", Label.RIGHT));
add(destChooser = new Choice());
destChooser.add("ca");
destChooser.select(0);
destChooser.add("sv");
destChooser.add("uk");
destChooser.add("us");
add(new Label("Waybill #", Label.RIGHT));
add(numField = new TextField(12));
numField.addActionListener(handler);
add(new Label()); // filler, for grid
add(goButton = new Button("Go for it!"));
goButton.addActionListener(handler);
gc.roll(Calendar.DAY_OF_MONTH, false); // yesterday
shipDate = // mmddyy format
nf.format(gc.get(Calendar.MONTH)+1) + /* zero-based */
nf.format(gc.get(Calendar.DAY_OF_MONTH)) +
nf.format(gc.get(Calendar.YEAR)%100);
|
|