Yep, plants often get leggy when they are struggling to reach sufficient lighting. In addition to the window you might add a lamp to supplement the lighting. I just use an old desk lamp especially in the winter months when the "real" sunlight is not very strong.
Here is my $2 thrift store desk lamp. Even with extra light my seedlings became leggy. Moving the light closer to the plants helped.