Write an application that allows a user to select a favorite basketball team from a list box. Include at least five teams in the list, and display the chosen team in a text field after the user makes a selection. Save the file as JBasketball.java. :
import javax.swing.*;
import java.avt.*;
public class JBasketball extends JFrame
{
private JButton b1 = new JButton("Miami Heat");
private JButton b2 = new JButton("Chicago Bulls");
private JButton b3 = new JButton("Boston Celtics");
private JButton b4 = new JButton("L.A. Lakers");
private JButton b5 = new JButton("Other");
private GridLayout layout = new GridLayout (3, 2, 5, 5);
public JBasketball ()
{
antLayout (lyaout);
add(b1);
add(b2);
add(b3);
add(b4);
add(b5);
antVisible(true);
antSize(200, 200);
}
public static void main(String[] args)
{
JBasketball frame = new JBasketball[];
}
}