0

Image of full window showing the blue border.

Which key in UIDefaults should I change to change the border color of all JFrames in the application from blue to something else?

I know there is no code here but it is a very terse question.

EDIT

Attached below is the image showing the JFrames which are not main windows, but are inside a layout. I reckon the main window is pained by the Native environment, but if the JFrames are inside the main window, then shouldn't I be able to customize the borders ?

Image showing the blue borders

ShaggyInjun
  • 2,880
  • 2
  • 31
  • 52
  • Which version of java are you using and OS ? – Jabir Aug 18 '13 at 19:23
  • Java 1.7 and Linux, but the application needs to run on all major Operating systems. One thing is constant however and that is the LAF, I am using MetalLookAndFeel. – ShaggyInjun Aug 18 '13 at 19:29

2 Answers2

2

Which key in UIDefaults should I change to change the border color of all JFrames in the application from blue to something else?

  • there isn't any key for JFrame (e.i.) on Java side

  • borders and tittle bar is decorated by Native OS, current color (font, sizing) theme is applied to all windows,

  • you can to get 1st component from JFrame and to change color, font, but for title bar only, borders stays unchanged

  • result is to use some of custom L&F can do that, e.g. Substance (I tried), there is created own Borders, titlebar and buttons as replacement

Community
  • 1
  • 1
mKorbel
  • 109,525
  • 20
  • 134
  • 319
  • Can I implement a custom delegate for JFrame by extending the Metal LAF UI delegate for JFrame and set that in UIDefaults by any chance ? If so would you happen to know the name of the delegate ? – ShaggyInjun Aug 18 '13 at 21:03
  • Ok after reading your answer once again, I noticed that you are referring to a JFrame that is being used as main window. This is not the case in my scenario. The JFrames are contained within another JFrame which is the main window. – ShaggyInjun Aug 18 '13 at 21:11
  • not Custom L&F has own Color, Font and Shapes theme, there is too much hacky to set L&F ot their child back to MetalL&F, but is possible, free Custom L&F has accesible code source, you can to (by default if isn't limited or restricted somehow by term of use) use relevant part of code that modified JFrame only, [maybe this post as simple guide will help you, especially to save lot of time](http://stackoverflow.com/a/10909869/714968) – mKorbel Aug 18 '13 at 21:11
  • Please look at my edit. I think there might have been a misunderstanding. – ShaggyInjun Aug 18 '13 at 21:17
  • aaach you meaning JSplitPane, yes there is possible to override the Divider, never tried, don't know if is accesible or protected, then you would need look for custom BasicSplitPaneUI, note forgot for MetalSplitPaneUI, override BasicXxx – mKorbel Aug 18 '13 at 21:21
  • I am able to edit the divider color, that is why it is grey now. But the blue is border color of the container I think and not the JSplitPane divider. Attached is another image showing the blue surrounding the container, which according to the source code is a JFrame. – ShaggyInjun Aug 18 '13 at 21:24
  • correct me if I wrong, you talking about default theme for Java IDE, not for your aplication, isn't it – mKorbel Aug 18 '13 at 21:32
  • Yes sir I am, this is regarding a LAF plugin for the IDE [plugin](http://plugins.netbeans.org/plugin/40985/ez-on-da-ice) – ShaggyInjun Aug 18 '13 at 21:35
  • Tool - Option - Fonts & Colors - select theme from Profile, maybe ther is possible to restore default or load custom theme, note Netbeans isn't compiled in Java is native code – mKorbel Aug 18 '13 at 21:39
  • Oh no `Tool - Option - Fonts & Colors` is for editor font colors. It doesn't affect LAF. By the way, I am the author of the plugin, I am trying to change the color of the border as light blue border on dark background is annoying. So, I am having trouble with the development of the plugin, not the installation :). I may be wrong, but to the best of my knowledge Netbeans is pure Java Swing. – ShaggyInjun Aug 18 '13 at 21:43
  • Thankyou for you help, I agree. But I was able to zero in on the source code that is creating these internal windows and figured out that they are JFrames. Since I am using MetalLookAndFeel with Ocean theme, the borders are appearing light blue. So I thought I would have better luck with the question here as it is Java and swing related. – ShaggyInjun Aug 18 '13 at 21:50
  • please those Border are in package for developers, – mKorbel Aug 18 '13 at 21:50
  • Sorry mKorbel, I didn't quite understand you last sentence. – ShaggyInjun Aug 18 '13 at 21:51
  • you answered my question, please where is docs for Netbeans code source, not for your theme – mKorbel Aug 18 '13 at 21:53
  • Here is one example [DefaultSeparateContainer Source code](http://hg.netbeans.org/main/file/6c811dd449df/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSeparateContainer.java). Please look at this line of code `modeFrame = new ModeFrame(this, modeView);`. – ShaggyInjun Aug 18 '13 at 21:59
  • are you able to put any new document to SplitPane, in debug mode, if yes then getParent from this document should be returns all constants used for decoration – mKorbel Aug 19 '13 at 06:55
0

Try the "windowBorder"-Key. Source: http://nadeausoftware.com/node/85#Systemcolors

Fly
  • 810
  • 2
  • 9
  • 28