CreatePanel - Assignment Name StudentID Lecture Description...

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

// Assignment #: 6 // Name: Shahad Hummusani // StudentID: 1208136783 // Lecture: m-w 12 // Description: It needs to be filled import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; public class CreatePanel extends JPanel { private Vector bookList; private ReviewPanel rPanel; //Constructor initializes components and organize them using certain layouts public CreatePanel(Vector bookList, ReviewPanel rPanel) { this.bookList = bookList; this.rPanel = rPanel; //organize components here JButton button1 = new JButton("Create a book"); this.setLayout(new GridLayout()); JPanel p1 = new JPanel(); JPanel p2 = new JPanel(); p1.setLayout(new BorderLayout()); p2.setLayout(new BorderLayout()); this.add(p1); this.add(p2); p1.setBackground(Color.gray); JTextArea area1 = new JTextArea("No book"); p2.add(area1, BorderLayout.EAST); area1.setVisible(true); JLabel l1 = new JLabel("Book Title",JLabel.CENTER); p1.add(l1,BorderLayout.NORTH); JLabel l2 = new JLabel("Publisher",JLabel.CENTER); p1.add(l2,BorderLayout.SOUTH); JPanel p3 = new JPanel();

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture