Questions tagged [uimanager]

UIManager manages the current look and feel and its defaults.

The UIManager manages the current look and feel, the set of available look and feels, PropertyChangeListeners that are notified when the look and feel changes, look and feel defaults, and convenience methods for obtaining various default values.

Specifying the look and feel

The look and feel can be specified in two distinct ways: by specifying the fully qualified name of the class for the look and feel, or by creating an instance of LookAndFeel and passing it to setLookAndFeel.

Setting the look and feel to the system look and feel:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

Setting the look and feel based on class name:

UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");

Defaults

UIManager manages three sets of UIDefaults. They are:

1. Developer defaults - With few exceptions Swing does not alter the developer defaults; these are intended to be modified and used by the developer.
2. Look and feel defaults - The look and feel defaults are supplied by the look and feel at the time it is installed as the current look and feel (setLookAndFeel() is invoked). The look and feel defaults can be obtained using the getLookAndFeelDefaults() method.
3. System defaults - The system defaults are provided by Swing.

179 questions
0
votes
2 answers

Setting FileChooserUI property in UIManager to the system's

I want to have my JFileChooser use the system's LookAndFeel, but have the rest of my components use Nimbus. Since each platform provides a different FileChooserUI, how would I set the FileChooserUI property in UIManager to the system's LookAndFeel?
Technius
  • 58
  • 1
  • 6
0
votes
4 answers

Set filechooser Colors with Nimbus L&F

I'm using custom Colors with Nimbus. After hours of searching I can't find out how to set the Background and Foreground colors for JFileChooser properly. My (non working) code: UIManager.getLookAndFeelDefaults().put("FileChooser.background",…
TomDK
  • 1,321
  • 11
  • 16
0
votes
0 answers

How to create a java.awt.Font object available for the whole application instance in java?

I need to create a java.awt.Font object for my project and it needs to be available for the whole application. I cannot install the font to the system and any help regarding creating the font object in the runtime is needed. My JDK is 1.7.0_17 and…
0
votes
1 answer

JTree implementation

For some strange reason when I implement a JTree in java I don't see the expansion lines (angled) on Mac OSX; but when the tree is expanded to show all the nodes, I see them on Windows. I have tried tree.putClientProperty("JTree.lineStyle",…
jrdnsingh89
  • 215
  • 2
  • 7
  • 18
0
votes
1 answer

custom ui delegates for TreeUI

For some reason, my TreeUI doesn't get applied. I am using MetalTheme and want to customize the TreeUI. So, I started by copying the TreeUI code and renaming the class EzTreeUI. Am I doing this right ? None of the commands below work. When I debug…
ShaggyInjun
  • 2,880
  • 2
  • 31
  • 52
0
votes
1 answer

UIManager Changes color only once (Nimbus)

Refer to this bug: 4848910 : UIManager only updates colors once I have two buttons on a JFrame. From first button I am changing LAF Color by UIManager.put( "Button.background", new ColorUIResource(Color.red) ); SwingUtilities.updateComponentTreeUI(…
awatan
  • 1,182
  • 15
  • 33
0
votes
1 answer

Setting look and feel to windows does not change for scroll bars and other

So i used the following code to set the look and feel of my program to windows since i don't really like any of the themes like nimbus or the default swing theme but some component are still appearing with the old look and feel and not my windows…
Nicolas Martel
  • 1,641
  • 3
  • 19
  • 34
0
votes
1 answer

UIManager strings

Possible Duplicate: Location of String keys in L&F This here is a line in my code: UIManager.getString("FileChooser.saveButtonText", l); This will return a string that represents text printed on save button of JFileChooser Where does it fetch…
Ivan Karlovic
  • 221
  • 5
  • 14
0
votes
1 answer

JToolBar always float

When you add a JToolBar to a component, you can drag it out and it create a new floating window while the parent component is also there. How can I make JToolBar show this floating window automatically with the parent invisible?
LanguagesNamedAfterCofee
  • 5,782
  • 7
  • 45
  • 72
-1
votes
3 answers

Java gui colors dont load

I've made a gui for my program and used UIManager.put("Button.background", new Color(0,0,0)); UIManager.put("JButton.background", new Color(0,0,0)); to make the buttons appear black. Unfortunately, this doesn't work sometimes. Without modifying…
Cody
  • 870
  • 4
  • 21
  • 38
-1
votes
1 answer

I do not know what it means by the metro file

I do not know what it means by the metro file, nor where to find it, and how to close it and start it again. Does it mean the Android emulator or what? Error: Invariant Violation: "Project" has not been registered. This can happen if: * Metro (the…
-1
votes
1 answer

Java - Changing the Menu Bar and Item Background and Text Color

How to change the Menu Bar and Item Color using UIManager.put(key, value);. I have tried this method: try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.put("MenuBar.background", Color.black); …
user7485924
-1
votes
1 answer

Is it possible to change any Windows Desktop Property Look and Feel?

In the company where I work, we derived a class from sun.awt.WToolkit to change some of the colors by calling setDesktopProperty(). And that worked fine for years. But now in JDK 8, WToolkit is final and cannot be subclassed. The easy way out could…
Stelios Adamantidis
  • 1,866
  • 21
  • 36
-3
votes
2 answers

How to get back the original look and feel color of a button after changing its color?

I changed the color of my button. Now I want its original look and feel back. I want to change the color once to a color that i like. After that, I want the button to get its original look back. How do I do that ? Here is the code to change color -…
SuperStar
  • 495
  • 2
  • 9
  • 22
1 2 3
11
12