Hey ho everybody I need some help I want to change the Color from my JFrame I know that I can remove the border with "setUndecorated(true)" but now I want to customize this Border. Are there any methods to customize my JFrame border?? Thank you for your help.
Asked
Active
Viewed 3,175 times
0
-
1Google before you ask. Duplicate of: http://stackoverflow.com/questions/2482971/how-can-i-change-the-color-of-titlebar-in-jframe – Christophe De Troyer Nov 12 '14 at 12:12
-
The best choice is to create a Look And Feel delegate for the frame, and probably set it's [`DefaultLookAndFeelDecorated`](https://docs.oracle.com/javase/7/docs/api/javax/swing/JFrame.html#setDefaultLookAndFeelDecorated(boolean)) to `true` – MadProgrammer Nov 12 '14 at 12:13
-
@ChristopheDeTroyer Hmmm, not entirely true (linked answer), it is possible, may not be what the OP wants to do though ;) – MadProgrammer Nov 12 '14 at 12:14
-
I google before but there are only themes like How can I change my backgound or something like this and thats not what I searched for. But thank You for Your response @Christophe De Troyer – Blank Nov 12 '14 at 12:16
1 Answers
2
You can use a LAF:
try {
// Set cross-platform Java L&F (also called "Metal")
UIManager.setLookAndFeel(
UIManager.getCrossPlatformLookAndFeelClassName());
}
catch (UnsupportedLookAndFeelException e) {
// handle exception
}
catch (ClassNotFoundException e) {
// handle exception
}
catch (InstantiationException e) {
// handle exception
}
catch (IllegalAccessException e) {
// handle exception
}
this wil use the default look and feel for youre divice. You can download custom lafs from the web

S. Tersteeg
- 141
- 4
-
3This won't use "the default look and feel for your divice", you'd need to use the system look and feel. This will use the cross platform (metal) look and feel, wch, IMHO is crap – MadProgrammer Nov 12 '14 at 19:45