0

I made a text editor with very basic funtionalities. I wrote it all in one class because I really wasn't sure what to put into other classes. Right now the code is pretty messy and I want to rewrite it. I was wondering if anyone could give me some input on the different classes you would use if you were going write a text editor.

2
Contributors
2
Replies
3
Views
12 Years
Discussion Span
Last Post by server_crash
0

hi everyone,
Actually one class is ok for a simple text editor but if you are going to put it into different classes remember that only one class can be public if all the class are in the same file. For example if you want to do a simple textarea clipboard class do this

class clip 
{
JTextArea TextArea1 = new JTextArea("", 10,10);

public clip(JTextArea TextArea)
{
     TextArea1 = TextArea
}

public void cuttext
{
         TextArea1.cut();
}

public void copytext
{
        TextArea1.copy();
}

public void pastetext
{
     TextArea1.paste();
}

}

What i created is a simple class that handles all the text clipboard functions of the
textarea and if you still have questions post them here and i'll answer them for you

Yours Sincerely

Richard West

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.