CreatePanel - Assignment Name StudentID Lecture Description...

This preview shows page 1 - 2 out of 3 pages.

// Assignment #: 6 // Name: McCabe Tonna // StudentID: 12002144441 // Lecture: MWF 10:45 // Description: The Assignment 6 class creates a Tabbed Pane with // two tabs, one for Pet creation and one for // Pet selection, and adds it as its Applet content // and also sets its size. / import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; i public class CreatePanel extends JPanel { private Vector<String> petList; private JButton button1; private SelectPanel sPanel; private JLabel label1, label2; private JTextField field1; private JTextArea field2; public CreatePanel(Vector<String> petList, SelectPanel sPanel) { this.petList = petList; this.sPanel = sPanel; label2= new JLabel(""); label1= new JLabel("enter a pet type"); field1 = new JTextField(""); field2 = new JTextArea("No pet"); button1 = new JButton("Create a Pet"); add(button1); //Enter a Pet Type and Text Area JPanel panel2 = new JPanel(); panel2.setLayout(new GridLayout(1,2)); panel2.add(label1); panel2.add(field1); //Create pet Button JPanel panel3 = new JPanel(); panel3.setLayout(new FlowLayout()); panel3.add(button1); //Whole Layout

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture