The various dynamics of many complex systems, both natural and artificial, can be well described as random walks on a newly proposed yet powerful object known as a complex network. Here we consider random walks on a special kind of network, a tree. Using the methods of probability-generating functions, we derive a close connection between the widely studied parameters mean first-passage time M and mean shortest path length A on trees. This suggests that for a given tree, the analytic value for M can be easily obtained by calculating the value A when determining the latter is more convenient and vice versa. As a result, the well-known T graph is selected as one of various applications of our methods, and we then obtain an exact solution to its quantity M. On the one hand, the result addressed here is in perfect agreement with previous ones. On the other hand, our method is easier to manipulate than most preexisting ones, for instance, methods from spectral graph theory, since no complicated techniques are involved.