I'm new to Java. My problem is to draw sometning in a new window, so I had an idea to use a new class for drawing.
Now I have tried a new approach.
I create a new JFrame and I want to draw to a new frame.
Randomly trying different ways of solving the problem is no substitute for learning how to do it correctly before trying to write the code. It also makes trying to help you extremely frustrating as by the time one of us has answered your post you no doubt will already trying out a different approach.
paint() mehtod immediatelly draws in my main Frame, and hides a text area and a button.
First if all you shouldn't be overriding the paint() method, for swing components you should override the paintComponent() method. And secondly you shouldn't be overriding any paint() or paintXXX() method on JFrame. If you want to draw anything create a class that extends JPanel and draw in that.

Your use of components is very confused I suggest you read a swing tutorial before attempting any more code