nimbus

Discover Reason of NullPointerException in Java Native Classes, SynthTreeUI using LAF Nimbus

二次信任 提交于 2019-12-11 17:39:17
问题 Note to reviewers: This may be a (possibly known) bug in NimbusLookAndFeel, and is not (as yet) a dup to the canonical NPE question. I have multiple classes, but I have no clue which of them the Exception might imply. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.plaf.synth.SynthTreeUI.paint(SynthTreeUI.java:382) at javax.swing.plaf.synth.SynthTreeUI.update(SynthTreeUI.java:269) at javax.swing.JComponent.paintComponent(JComponent.java:780) at javax.swing

how to make Indeterminate progressbar look nicely?

廉价感情. 提交于 2019-12-11 11:58:56
问题 I'm using nimbus lookAndFill UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); and my indeterminate JProgressBar looks like that: http://img15.imageshack.us/img15/9470/uglyprogress.jpg can i make it looks better? 回答1: There's an easier solution. You can just copy the progress bar UI defaults before setting the nimbus look-and-feel and then set them back after. You then get Nimbus look and feel but without its progress bar styling. // copy progress bar defaults

Swing Nimbus change style of a non editable JTextField

爷,独闯天下 提交于 2019-12-11 11:54:16
问题 Is there a way to change the style of non editable JTextField? We would like to give the TextField a slightly more grayish background if it is set to editable = false. I guess one way would be readonlyComponent.setBackground(Color.LIGHT_GRAY); on every component but this seems error prone and tedious. What I want to achieve is this: Normal JTextFiels should appear as defined by the nimbus look and feel. Readonly fields, e.g. editable = false, should have a different background color. Disabled

Fixing Background bug Color of JTextPane when Nimbus or GTK LookAndFeeel is Used, by overriding methods

这一生的挚爱 提交于 2019-12-11 10:57:42
问题 I was trying to change background Color of JTextPane, contained like a Cell of JTable with problems related in this question JTable, update Colors Cell when LookAndFeel Nimbus or GTK are used I discovered later the bug (and not for me applicable solution) https://bugs.openjdk.java.net/browse/JDK-8058704?jql=order%20by%20lastViewed%20DESC UIManager.put("TextPane[Enabled].backgroundPainter", new Painter<JComponent>() { @Override public void paint(Graphics2D g, JComponent comp, int width, int

JTree ignoring LaF overrides

醉酒当歌 提交于 2019-12-11 09:09:06
问题 I have recently been attempting to convert a system to a unified look and feel (In this case Nimbus). However certain components require alteration from the defaults and I don't want to just change the defaults because of a single component. I am trying to override the row highlight colour for a JTree component. I have managed to switch it off entirely but this is not what I am after. From reading the various questions on here I have tried using: UIDefaults overrides = new UIDefaults();

Nimbus L & F: Setting different background colors of a Check-Boxes in a CheckBox List

☆樱花仙子☆ 提交于 2019-12-11 07:55:48
问题 I had a list of check-boxes and I want to set different colors on each check-box. Following code does not change the background color checkBox[i] = new JCheckBox(); checkBox[i].setEnabled(false); checkBox[i].setBackground(Color.GREEN); Kindly let me know way of setting background color 回答1: for example import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.UIManager.LookAndFeelInfo; import javax.swing.event.*; public class JListDisabledItemDemo implements

Nimbus look and feel for Matlab

半城伤御伤魂 提交于 2019-12-11 07:36:57
问题 I am trying to change the appearance of my Matlab GUI using Java. Following the instructions of the post found here, I have tried this code: javax.swing.UIManager.setLookAndFeel('com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel'); However, the results are not shown correctly and I am getting the following error messages: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.mathworks.widgets.desk.DTTitleBar$InternalUI.getBottomColor(DTTitleBar.java:1181) at com

Nimbus - Different JProgressBar Styles

笑着哭i 提交于 2019-12-11 05:40:34
问题 I was wondering how I could set my JProgressBar to use the two available styles, as NetBeans does. I've noticed in NetBeans, that when debugging or building a program, the progress bar at the bottom-right of the screen first uses the indeterminate style, but with blocks instead of the oscillations and then switches over to the 'standard' style. I'd like my program to use the oscillating style when the server is starting, and then the blocks style when the server is running. How could I

NullPointerException at javax.swing.plaf.synth.SynthContext.getPainter

落爺英雄遲暮 提交于 2019-12-11 03:59:27
问题 A Java Swing program I work on keeps getting the exception below. It happens at random times and is far from reproducible. It does not seem to usually cause any problem other than on time action events are not triggered but usually even after this exception things work fine. There seems to be no consistency to its happening. Any one have any advice? I should mention that we are using the nimbus LAF. java.lang.NullPointerException at javax.swing.plaf.synth.SynthContext.getPainter(SynthContext

Change JComboBox colours WITHOUT renderer

泪湿孤枕 提交于 2019-12-11 03:41:20
问题 I can change the ComboBox background color using: UIManager.put("ComboBox.background", Color.RED); and it works. But to change the [selected].background , having a look at Nimbus Defaults the property is called ComboBox:"ComboBox.listRenderer"[Selected].background , so I tried with: UIManager.put("ComboBox:\"ComboBox.listRenderer\"[Selected].background", Color.RED); but it doesn't work. I want to do this with a renderer (which I have tried and gives many problems into a long code I even hadn