简体   繁体   中英

Making the title bar transparent in Java

Here's what my program looks like so far: 在此处输入图片说明

Is there any way to make that gray title bar on the top transparent?

I tried setUndecorated() but that completely removes the red/yellow/green window buttons and doesn't let me drag the window around.

Incase you don't understand what I'm asking, in Objective CI was able to make the titlebar transparent in this program:

图片

You can use JFrame.setOpacity() and set a percentage from 0 to 1 to make the entire frame translucent. Then set the contents to opaque. More information here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM