All pastes #2104497 Raw Edit

Mine

public text v1 · immutable
#2104497 ·published 2012-01-20 14:09 UTC
rendered paste body
import java.awt.*; 
import java.awt.event.*;
import javax.swing.*; 
import java.io.*; 
import java.util.*;

public class CatMain extends JFrame implements ActionListener
{
  public CatMain(String title) throws IOException                         
  {
 
  File file = new File("schedule.txt");
    
    Scanner scan = new Scanner(file);
    String[] names = new String[310];
    String[] teachers = new String[62];
    int i=0;
    int q=0;
    while (scan.hasNextLine())
    {
      {
        names[i] = scan.nextLine();
      }
      i++;
    }
    for(int j=0; j < names.length;j+=5)
    {      
      teachers[q] = names[j]; 
      q++;
    }
     JFrame frame = new JFrame("Creating a JList Component");
  JPanel panel = new JPanel();
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  JList list = new JList(teachers);
  JScrollPane scroll = new JScrollPane(list);
  scroll.setPreferredSize(new Dimension(150,400));
  panel.add(scroll);
  
  setLayout( new FlowLayout() ); 
  add( panel ); 
  }
 public void actionPerformed( ActionEvent evt)
  {
   
  }
  public static void main ( String[] args ) throws IOException
  {
    CatMain demo = new CatMain( "CatMain" ) ;

    demo.setSize( 800, 600 );     
    demo.setVisible( true );      
  }
}