3

I work a lot with look and feel in java and it works well but the only problem that the only component that has no change is the title bar(caption) still have the same native look and feel of os(windows platform as example)

i want to know what's is the reason and how to fix this? any body help..........

thanks in advance

2
  • There's not enough information in here to have any chance of giving you any help. What, precisely, do you do? What toolkits are you using?
    – bmargulies
    Commented Feb 6, 2010 at 21:51
  • AFAIK, the title bar is created and managed by the OS / Window manager . The Java Look n Feel cannot change this.
    – ZeissS
    Commented Feb 6, 2010 at 21:55

4 Answers 4

6

Check out Substance https://substance.dev.java.net/see.html

You can change the title bar look and feel with substance support.

Here are a few screenshots:

alt text

alt text

5
  • This is pretty cool, but it might be worth mentioning that it doesn't work in OpenJDK for me. Works with the sun jdk though.
    – jonescb
    Commented Feb 6, 2010 at 23:06
  • Problems only occurs with OpenJDK in Webstart Commented Feb 6, 2010 at 23:12
  • Oh, I was using the Webstart demo. That must have been why.
    – jonescb
    Commented Feb 6, 2010 at 23:28
  • @ Mr Massimo Fazzolari you are right but i use substance look and feel and import the test.jar but still no change title bar still the same (native windows) could you please give me a sample code if you try this before? thanks in advance
    – ironman
    Commented Feb 9, 2010 at 21:20
  • @ironman Substance requires JDK 6.0 or higher. Check out this example substance.dev.java.net/docs/getting-started.html Commented Feb 9, 2010 at 22:44
1

Some PL&Fs support rendering frame decorations, and some do not. I believe the Sun cross-platform PL&Fs (for instance Metal) support it, but platfrom-specific PL&F (for instance Windows) do not.

The feature is not on by default. To switch it on for all new frames use JFrame.setDefaultLookAndFeelDecorated. The API docs for the method show how to switch it on for frames individually.

0

If you want to create your own borderless window, instead of using a Frame/JFrame use a Window/JWindow. Frame/JFrame are extensions to Window/JWindow that provide borders and the maximize, minimize and close buttons. Usually those widgets are provided by the OS, but you can override them.

0

Use

JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);

Before any JFrame or JDialog creation. Usually into main.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.