I’v been surfing about, and it seems like most places agree: You can’t change the title bar of a JFrame.
Some people suggest stuff like hiding the title bar and building your own (faking it with a JPanel). But it’s messy and probably won’t be perfect (especially if you are using a special look and feel). I thought I would ask you guys if you have any good ideas of how the content of the title bar can be changed.
I’m thinking of stuff like adding additional buttons next to the minimize/maximize/close buttons, removing the close button, making the maximize button react to right mouse-click and so forth. This can be done in other languages so it of course should be possible in Java. It may not be easy but it should be possible. And if it truly is so, it is too bad that you have to “fake it”.
I’m posting this because I wanted to make it possible to minimize my JFrame to the system tray (that’s “next to the clock”) when you right-click the close “X” instead of left-clicking it (left-clicking it should still close the window as usual/pass a event to WindowListener). When that wasn’t easy to do I instead wanted to add a extra button to the left of the minimize button (the icon would have been a dot) that would do the same thing. As you understand that wasn’t an easy task either.
So, anyone got a good method of changing how the title bar works?