| |

VerySource

 Forgot password?
 Register
Search
Author: wonianwei

Dear friends, how to remove the title bar of JFrame! !! !!

[Copy link]

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-15 20:15:01
| Show all posts
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);

Personally think that if you just need JFrame not to display the title, then you should use JWindow.
But if you need to make a title yourself, the above is the correct usage. For example, the default Metal style, you need to set it before you can see the Metal title bar.
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 United States

Post time: 2020-8-15 20:30:01
| Show all posts
Forgot to mention that not all UIs support titles.
It depends on what the public boolean getSupportsWindowDecorations() method in LAF returns.
Reply

Use magic Report

0

Threads

4

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-4 17:45:01
| Show all posts
JFrame.setUndecorated(true); This method removes all decorations of the form, including the title bar.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list