Are you asking how to change the text that shows up, for example, in the Windows "System tray" when your window is iconified? I think that's a detail that's really up to the operating system, as the whole concept of a "System tray" is system-dependent. But on many systems, the text is just the same text that's in the window's title bar.
If you're just asking about the text in the window's title bar, in
Java that's called the "title" and you can set it (for a Frame, JFrame, Dialog, or JDialog) with the window object's "setTitle()" method. In a WindowEvent handler for an WindowEvent
e, you'd say
e.getWindow().setTitle("The title");