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

WindowsLookAndFeel - What font is used - Is there a way to change it

UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); What font gets used? If I have an app, which is using the windowslookandfeel, is there a way to change the font used on a local system, by changing the default font for…
luckylak
  • 279
  • 3
  • 13
0
votes
0 answers

React native app always crashes when first opened, work every time after that

I get this crash log in console. I thought it was just a weird dev bug. I would try to launch the app, it would give this error, then I would launch again and it would load fine. I am using Expo and the app has the same crash behavior in…
0
votes
2 answers

Layout Animation does not work on Android even with UIManager experimental settings

I've been trying to implement LayoutAnimation to animate the insertion and deletion of items from scrollView. I've added the below code for the same. import { LayoutAnimation, NativeModules } from 'react-native'; // Animation setup for…
AMAL MOHAN N
  • 1,416
  • 2
  • 14
  • 26
0
votes
1 answer

how to get both selected and not selected look of the JCheckBox from LAF

I have a problem, because im trying to get both JCheckbox images selected and not selected so far ive been able to get Icon from the UIManager, but unfortunetly it doesnt have ticked version? Ive seen there are painters which paint those icons but…
0
votes
2 answers

Making several synth LookAndFeels coexist at the same time in a java swing application

I am working on a java swing application using synth Look and Feel. There are already styles for every possible swing component I must change the whole application's LookAndFeel, redefining different styles for every possible swing component. I am…
wilbut
  • 34
  • 4
0
votes
1 answer

How can i change the JFrame top buttons and color?

I am trying to edit the JFrame top buttons like steam has in color "dark grey". JFrame "TOP" I would like to remove or add more components like "JButtons or Icons" at this section. Do not know if there is a way where you do not need to change the…
D_Larks
  • 3
  • 2
0
votes
2 answers

How to change row color in Jtable using UIManager

I tried using UIManager to change border color of the focused cell in my JTable, and it works fine. But I don't know how to change the color of rows in my JTable using UIManager. Can anybody tell me what can I write inside UIManager.put(); to change…
0
votes
1 answer

Java Mouse Listener error with UIManager SetLookAndFeel

The below code displays a JFrame with a JMenu and a [custom] JPanel. I set the look-and-feel (LAF) to Windows LAF by calling method UIManager.setLookAndFeel I click on the JMenu with the mouse and then I move the mouse onto the [custom] JPanel –…
0
votes
1 answer

Changing default colors for focused JComboBox (Java Swing/AWT)

Hi ! I'd like to know how i can change the default focused background and foreground for a JComboBox. Since i made it extends a DefaultListCellRenderer, which is modifying both foreground and background for each of its items, i don't like that it…
Oliv
  • 13
  • 3
0
votes
0 answers

Java JTree Implementation

I'll be brief; I'd like to change the color of a JTree from the Metal LF's default blue to a gray. I've already looked at a ExtendedJTreeCellRenderer to no avail. Can this be done with UIManager, if not can it be done without having to custom icon…
0
votes
1 answer

How to link identical GTK::UIManager XML menus?

My GTK application has the following UIManager XML. Is there a way to link those menus in the XML, so that I do not have to repeat myself?
Tim
  • 13,904
  • 10
  • 69
  • 101
0
votes
1 answer

javax.swing.UIManager.getIcon(Object key) returns null when String-keys are streamed from an ArrayList

What I want to achieve: I want to visualize some javax.swing.Icons from the javax.swing.UIManager. On the internet I've found a list of UIManager-keys, which will not only return Icons but also Strings, Colors and so on. So in this step I want to…
A119
  • 45
  • 5
0
votes
1 answer

Invariant Violation: requireNativeComponent: "RangeSlider" was not found in UIManager

I am trying to use this package to create a range slider: https://www.npmjs.com/package/react-native-range-slider import React from 'react'; import { Platform, StyleSheet, Text, View, Image, Switch, Button } from "react-native"; import {…
0
votes
1 answer

overrides nimbus properties

I'm trying to overrides some of the nimbus properties for JLabel. UIDefaults labelDefault = new UIDefaults(); labelDefault.put("Label.font", new FontUIResource("Arial", Font.PLAIN, 14)); labelDefault.put("Label.foreground", new…
wotan2009
  • 9
  • 2
0
votes
1 answer

How to change the color of a disabled jbutton?

I'm implementing a Mastermind game and there is a board which has the plays (left) and the results (right). I have numerous buttons which some are enabled and other disabled. These buttons are associated to the colors of a play or a…