Hi! I'm working on a notepad project and like original notepad i want the form title set by the name of the file that has been openned so how can i do that?!

WHat class are you using for your "form" - if it's a JFrame you can call its setTitle method any time to change the title.

so, the title has to be the name of the class the form is in?
well, you can find the name through the native class Class, there are some methods in there to retrieve the name in several formats
just check how you need it and implement it.

if you mean, it has to have the name of the file in which the file of the form is instantiated, nobody is stopping you from passing it as a parameter to the constructor, I guess.

I think he means the name of the file that was the source of the content displayed in the form - so there's some kind of file open dialog from which a chosen file is opened in the form, and the chosen file name should be in the form's title. Is that right?