private static ArrayList<Triangle> readList()
    {
        ArrayList<Triangle> torturn = null;
        FileInputStream fin = null;
        ObjectInputStream ois = null;
        try
        {
            fin = new FileInputStream("triangle.ser");
            ois = new ObjectInputStream(fin);
            torturn = (ArrayList<Triangle>) ois.readObject();
            ois.close();

            return torturn;

        }catch(Exception ex){
            ex.printStackTrace();
            return null;
        }
        finally
        {
            if (fin != null)
            {
                try
                {
                    fin.close();
                } catch (IOException e)
                {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                }
            }
            if (ois != null)
            {
                try
                {
                    ois.close();
                } catch (IOException e)
                {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                }
            }
        }
    }