Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create a Window in Java with no caption buttons?

Is it possible to create a Window object of some sort in Java that has a frame and border, but no caption buttons (minimise, restore, close).

Naturally, I can't use the undecorated setting. Further, the window needs to:

  • Have a platform-rendered border
  • Have a titlebar
  • Have no caption buttons. If need be, I'll take care of disposing the window programmatically.
  • Use the default, or System Look and Feel

Here is an example:

captionless window

like image 623
Redandwhite Avatar asked Dec 19 '25 10:12

Redandwhite


1 Answers

this is about

  1. decent How to Create Translucent and Shaped Windows

  2. undecorated JDialog with Compound Borders, then you can create similair or nicer Borders as came from Native OS

  3. create JPanel (orJLabel#opaque(true)) with GradientPaint

  4. or (better non_focusable == my view) JLabel with prepared Icon

  5. add to JPanel / JLabel the Component Mover / Component Resize (notice, don't never to mix these two codes together) by @camickr

  6. set Alpha Transparency for painting in JPanel / JLabel for great look and feel

  7. simplest of ways is put there JMenuBar

like image 74
mKorbel Avatar answered Dec 21 '25 01:12

mKorbel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!