/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package studentClient;

/**
 *
 * @author krisko
 */
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;

import common.components.actionListeners.ReturnActionListener;
public class ChooseReviewTestUI {
  public ChooseReviewTestUI(ReturnActionListener returner) {

    final Object rowData[][] = { { "F12 Midterm1", "36", "36/40" }};
    final String columnNames[] = { "Test", "# of Questions", "Score"  };

    final JTable table = new JTable(rowData, columnNames);
    JScrollPane scrollPane = new JScrollPane(table);
    JPanel panel = new JPanel();
    JButton button1 = new JButton("Confirm");
    JButton button2 = new JButton("Back");
    
    JFrame frame = new JFrame("Choose Test");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    panel.add(scrollPane, BorderLayout.NORTH);
    panel.add(button1, BorderLayout.SOUTH);
    panel.add(button2);
    button1.addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    /*
                     * For the prototype, just display a quickie dialog
                     * that will be refined later.
                     */
                  Frame f = new Frame();
                  f.setVisible(true);
                }
            }
        );
    
    
    frame.add(panel, BorderLayout.CENTER);

    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    frame.setSize(900, 500);
    frame.setVisible(true);

  }
}