this is my project
using array

this the format of the applet window

example if you input abbreviation
then click search the result is the State
here is my code
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class finals extends Applet implements ActionListener
{
Label lblState = new Label ("STATE FINDER");
Label lblSelect = new Label ("Select Keyword");
CheckboxGroup cbgSize = new CheckboxGroup();
Checkbox optAbbreviation = new Checkbox("Abbreviation",cbgSize, false);
Checkbox optName = new Checkbox("State name",cbgSize, true);
Button btnSearch = new Button ("SEARCH");
Label lblResult = new Label ("Result");
TextField txtAbbreviation = new TextField (5);
TextField txtName = new TextField (5);
TextField txtResult = new TextField (5);
public void init()
{
setBackground(Color.green);
add(lblState);
add(optAbbreviation);
add(optName);
add(lblSelect);
add(btnSearch); btnSearch.addActionListener(this);
add(txtResult); txtResult.requestFocus();
add(lblResult);
add(txtName);
add(txtAbbreviation);
}
public void actionPerformed(ActionEvent a)
{
}
}
thanks
This post has been edited by cris_carriaga: 07 October 2010 - 04:03 AM

New Topic/Question
Reply




MultiQuote






|