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

PyGTk pictures not showing in menu

Recently I've started to learn pygtk . As an exercise, I am planing to build a small feed reader. Currently I have the following (working) code: #!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk class FeedbarWindow(): …
Andrei Ciobanu
  • 12,500
  • 24
  • 85
  • 118
0
votes
0 answers

Simplified ComponentUI

I am developing a UI in swing. I want to add the possibility to choose between two well defined look-and-feels (laf), with the possibility to extend this choice in the future. I do not plan to support any look-and-feel, but I also do not want to be…
NeitherNor
  • 254
  • 2
  • 7
0
votes
1 answer

How can I make a certain JFrame have a different LAF from other JFrames?

Let's say I have 2 JFrames. After setting JFrame to visible, you cannot seem to change the LAF without setting the visibility to hidden and normal first. This means a flicker, and the JFrame jumping to the top. Otherwise, you get this: (Some…
Universal Electricity
  • 775
  • 1
  • 12
  • 26
0
votes
0 answers

JFileChooser Save Dialog shows overlaping open and save button text

I'm using the following code to display save file dialog. final JFileChooser fc = new JFileChooser(); retval = fc.showSaveDialog(jinternalFrame); When i select a folder/drive once the JFilechooser opens, the save and open button overlaps for a few…
Null Pointer
  • 130
  • 1
  • 5
  • 16
0
votes
0 answers

Selected cell L&F default colors from UIManager in custom renderer

I have a custom JList renderer that has an image and some labels. I know how to set the background and foreground of this list using the isSelected variable and the UIManager default L&F. public Component getListCellRendererComponent(JList list,…
Mgamerz
  • 2,872
  • 2
  • 27
  • 48
0
votes
1 answer

UIManager in Java Swing not working consistently? / JOptionPane Message Background

I'm trying to set the background color in my custom JOptionPane and no matter what, I cannot get the message part of the option pane to change color. Attempt #1 was to set the pane background and opaque. Attempt #2 was to also loop through the…
space_food_
  • 800
  • 1
  • 7
  • 23
0
votes
0 answers

UIError after extending JTextComponent

I got this error after I extended JTextComponent UIDefaults.getUI() failed: no ComponentUI class for:…
0
votes
0 answers

UIManager Won't Set Button Background

All, I am using java swing's UIManager to set this theme UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); This theme is terrible at differentiating disabled/enabled backgrounds for buttons, so I've been battling trying…
Constantin
  • 16,812
  • 9
  • 34
  • 52
0
votes
0 answers

Java - UIManager.setLookAndFeel isn't working

I'm trying to get look and feel to work with no success. I'm creating a Frame and painting an Applet inside it. No exceptions are thrown when I execute the program. AppScreen < Applet: public class AppScreen extends Applet implements Runnable { …
Snake
  • 43
  • 4
0
votes
1 answer

Resize all components in a frame by a given value

I am trying to increase the size and fonts of all of the components in frames in my application. I found some code which does so for the fonts via the code below: private static void setUIFont(javax.swing.plaf.FontUIResource f) { …
f78xd23
  • 117
  • 2
  • 15
0
votes
0 answers

How to get new frame to inherit existing lookandfeel

I have a jar that is loaded into a large Java platform. There appears to be a custom LookAndFeel, which any Panels etc I create picks up. Now I need to create a new jFrame, however, it doess NOT inherit the current lookandfeel. How may I specify…
ManInMoon
  • 6,795
  • 15
  • 70
  • 133
0
votes
1 answer

Swing change foreground color of BasicArrowButton

In JSpinner class, how would I change the foreground color of two BasicArrowButton(up and down) components? the component.setForeground(<>) doesn't work. Thanks in advance. EDIT private void set_colors(JSpinner spinner){ int n =…
user2889419
0
votes
0 answers

Set ComboBoxUI for all JComboBoxes

Hi I want to change look for all ComboBoxes in my app. MyComboBox class: class MyComboBoxUI extends BasicComboBoxUI { public static ComponentUI createUI(JComponent c) { return new MyComboBoxUI(); } protected JButton…
Zolkovv
  • 13
  • 4
0
votes
0 answers

Changing JButton color After Applying L&F

Is it possible to change jbutton color after applying the system default L&F? I've used this code in my main method before applying color changes: try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch…
Dylan Katz
  • 194
  • 2
  • 14
0
votes
1 answer

Java 1.6.0_51 and Java 1.7.0_25 Swing Applications fail with Webstart

we are using PlasticLookAndFeel from JGoodies in the Version jGoodies-looks 2.2.2. I know this Version is not new, but we also tried it with the current Version of JGoodies, which didn´t help. Since updating to Java 1.6.0_25 or 1.7.0_25 we have…
Bernhard Kern
  • 208
  • 2
  • 10
1 2 3
11
12