Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.54 KB | None | 0 0
  1. package com.deanchester.minos.tests;
  2.  
  3. import com.deanchester.minos.controller.Controller;
  4. import com.deanchester.minos.model.Contestant;
  5. import com.deanchester.minos.model.Times;
  6. import com.deanchester.minos.gui.ContestantsTable;
  7. import com.deanchester.minos.gui.ContestantAddPanel;
  8.  
  9. import javax.swing.*;
  10. import java.util.ArrayList;
  11. import java.awt.*;
  12.  
  13. /**
  14.  * Created by IntelliJ IDEA.
  15.  * Author: Dean Chester <a href="mailto://dean@maquib.com">Dean@maquib.com</a>
  16.  * Date: Jun 30, 2011
  17.  * Time: 11:21:19 PM
  18.  */
  19. public class TestTable extends JFrame{
  20.     private static ArrayList<Contestant> contestants;
  21.  
  22.     public static void main(String[] args){
  23.         Controller c = new Controller();
  24.         c.addContestant("Dean","Chester","Mazey");
  25.  
  26.         contestants = c.getContestants();
  27.  
  28.         for(Contestant cont : contestants){
  29.             System.out.println(cont);
  30.         }
  31.  
  32.         c.addHeatTime(12.2);
  33.  
  34.         ArrayList<Times> times = c.getHeatTimes();
  35.  
  36.         for (Times t:times){
  37.             System.out.println(t);
  38.         }
  39.         new TestTable();
  40.     }
  41.  
  42.     public TestTable() throws HeadlessException {
  43.         ContestantsTable cTable = new ContestantsTable(contestants);
  44.         JScrollPane jsp = new JScrollPane(cTable);
  45.  
  46.         ContestantAddPanel caPanel = new ContestantAddPanel();
  47.  
  48.         JPanel mainPanel = new JPanel(new GridLayout(1,2));
  49.         mainPanel.add(jsp);
  50.         mainPanel.add(caPanel);
  51.  
  52.         this.setContentPane(mainPanel);
  53.         this.pack();
  54.         this.setVisible(true);
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement