hello everyone
i have created a text editor using java swings,
my problem is that sometimes all features are working perfectly and sometimes they are not....
i wrote the entire program in one file and the no. of lines in it are 1770,is this a problem for that kind of behaviour???

help me out please

The number of lines doesn't matter except that it increases the complexity. So basically you have bugs in your code. You'll need to do some testing to figure out which sequence of events causes errors. Write down any sequences of events that you find that cause errors. Then trace through the code and figure out what your variables are, etc, and what the state of your GUI is.

for example changing font is one of the functions,
in one execution selcted text is changed to the selected font
sometimes it is not similarly sometimes all functions are working perfectly..

An another way is that, if you thing any part may contain bugs, just get out that part to another source file and test it or just do a partial test.

if it sometimes crashes it is NOT working perfectly.
In fact I've rarely seen anything that works PERFECTLY, and certainly not something created by anyone claiming their work was perfect just before stating it's not.