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
4
votes
1 answer

Override UIManager value for single object

Is it possible to override the UIManager properties for specific objects? For example, my UI Manager has [Label.background] => (ColorUIResource) [javax.swing.plaf.ColorUIResource[r=238,g=238,b=238]] I want to make ONE JLabel with a Color.WHITE…
bigleftie
  • 453
  • 1
  • 6
  • 17
3
votes
3 answers

What's a convenient way to set default settings for all JComponents

I want a way to set default settings like, background colour, size etc. for all components I use in my GUI, what's a convenient way to do this? so when I do new JButton or JLabel etc. it will already have the settings applied?
fenerlitk
  • 5,414
  • 9
  • 29
  • 39
3
votes
2 answers

java.lang.NoClassDefFoundError: Could not initialize class javax.swing.UIManager

I have meet this error,does anyone know why is it? Java Version: 1.6.0_16 java.lang.NoClassDefFoundError: Could not initialize class javax.swing.UIManager at javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:191) at…
jeff.lee
  • 31
  • 1
  • 2
3
votes
1 answer

JTextField background color on enable/disable

i changed the background color of my JTextField to black when it is disabled. I do this using the UIManager and this property TextField.disabledBackground, that i set at application start up. I would like to know how can i change the background…
wotan2009
  • 31
  • 1
  • 2
3
votes
2 answers

UIManager, how to get values of different LookAndFeels?

I need to get the default background color of a TableHeader but of the Windows LookAndFeel. I have already tried: try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); …
KaNaDa
  • 141
  • 12
3
votes
1 answer

Change JCheckBox/JRadioButton selection color

Is there a way to change the selection color of a checkbox/radiobutton?
Vasyl
  • 1,393
  • 15
  • 26
3
votes
1 answer

how to make frame undecorated after jTattoo theme installed

after using jTattoo LookAndFeel, try { UIManager.setLookAndFeel(new McWinLookAndFeel()); new Main(new UserModel()).setVisible(true); } catch (UnsupportedLookAndFeelException ex) { …
Asela Wijesinghe
  • 157
  • 2
  • 13
3
votes
3 answers

Change JCheckBox 'ticked' color

How do I change or modify the color of the JCheckBox symbol (not the text property). I'm testing UIManager.put("CheckBox.selected", Color.RED) without success. Can someone help?
BicaBicudo
  • 307
  • 1
  • 8
  • 20
3
votes
1 answer

UIManager in Button Action

I have one LoginScreen and one MainWindow. When connection attempt succeed to DB, LoginScreen disposed and MainWindow appear. I have one button has ActionListener for create a JOptionPane. Code succesfully working actually. I have three problems in…
Black White
  • 700
  • 3
  • 11
  • 31
3
votes
1 answer

Changing Look And Feel by Swapping UIDefaults

I am writing a GUI Builder and want the user to be able to change the LookAndFeel of the GUI he builds. The LookAndFeel should only be changed for the Components inside the editor area. The rest of the Application should remain with the…
Jhonny007
  • 1,698
  • 1
  • 13
  • 33
3
votes
2 answers

setLookAndFeel() gives NullPointerException if I use JTable

I have a JFrame with two panels. And I am setting the UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()) in a class which extends JFrame.So It works fine for both panels If I dont've JTable in it. But If I add JTable to any panel…
Saikiran Gosikonda
  • 928
  • 1
  • 11
  • 29
3
votes
2 answers

Where are the java swing String for me to translate?

The JFileChooser don't provide support for my language, I'd translate strings defined in the file http://www.rgagnon.com/javadetails/JavaUIDefaults.txt with the UIManager.put(), but I'm not finding the popup strings ("view", "refresh" and "new…
The Student
  • 27,520
  • 68
  • 161
  • 264
3
votes
1 answer

Extending existing Swing look and feels with custom JComponents

I'm writing a custom JComponent, that should look differently for different look and feels. I intend to have different ComponentUi classes at least for the WindowsLookAndFeel, the MetalLookAndFeel and for the MotifLookAndFeel. Now, while this task…
Balder
  • 8,623
  • 4
  • 39
  • 61
3
votes
2 answers

How to determine the correct UI implementation for a custom component

I'm creating a custom component with its own custom UI. The question How to create a custom Swing Component provided a great start in developing the component, but I haven't been able to find a good way to connect the custom component with its…
Rangi Keen
  • 935
  • 9
  • 29
3
votes
1 answer

How to set disabled text color for JLabel?

How to set the disabled text color for every JLabel in my program. It is not in the docs . Is there any way to set the disabled foreground color for it?
JavaTechnical
  • 8,846
  • 8
  • 61
  • 97
1 2
3
11 12