0

So far I got that we can remove the minimize/maximize etc buttons from a jframe (header).

How can I remove just the Maximize button from a JFrame?

How to hide the default minimize/maximize and close buttons on JFrame window in Java?

Is there a way to add a custom button in a jframe(header)? I am trying to extend the default available jframe buttons feature and add my own "always on top" into it. If this is not possible then I would like to add some pinning icon into the jframe (header) to replicate "always on top" feature for a jframe (or jinternalframe).

This feature that I am trying to implement is similar to what we see on a linux machines with gui which enable us to keep a folder always in top. enter image description here

rakesh
  • 1
  • 3
  • see: https://stackoverflow.com/questions/21215355/java-how-to-put-a-button-on-border-surround-of-window-or-jframe – c0der Oct 08 '17 at 17:08
  • @c0der Thanks for the link. It seems like we have to implement our own JFrame header. Well as of now I could not implement my "always on the top" option for the header, but have added keyboard shortcut to bring my target JInternelFrame to front whenever we need. – rakesh Apr 12 '18 at 08:12
  • @c0der: I revisited this question after a long time. I can mark your comment as an answer but I don't know how to do that. – rakesh Mar 27 '20 at 18:43
  • Thank you for your message. It is important to accept / up vote good answers. If you found the linked answer helpful please up vote it. – c0der Mar 28 '20 at 05:25

1 Answers1

0

Here's a thought, how about instead, you remove the JFrame header:

frameName.setUndecorated(true);

And simply create your own using a JPanel. With this method, you can fully customize a JFrame header!

JasperHsu
  • 45
  • 11
  • Thanks for the answer. I did not like the idea initially but now I know that this is the only way :). But as c0der pointed out this first, I want to select his comment as answer. – rakesh Mar 27 '20 at 18:45