nimbus

Changing the defauls key values for JButton in Nimbus LaF

∥☆過路亽.° 提交于 2019-12-10 22:36:56
问题 I have a two Buttons in my program JButton button1 = new JButton(); button1.setText("First Button"); JButton button2 = new JButton("Second Button"); I have tried to change the LaF of the button, I am able to change the button background color using the following code UIManager.put(Button.background new color(134,201,236)); But when i tried to change the other key values like "Button.disabled" , "Button[Default+Focused+Pressed].backgroundPainter" the code did not work for me. Could someone

JButton margins. Not respected when nimbus plaf

南楼画角 提交于 2019-12-10 19:22:18
问题 The property margin of a JButton isn't respected when the nimbus look and feel is installed. . I need some "little" buttons, but nimbus forces the space around button text to be large, so I only get "very large" buttons. I discovered in nimbus defaults page that there is a property called: Button.contentMargins that is preset with large values. I've tryed to override it with the following code: UIManager.getDefaults().put("Button.contentMargins", new InsetsUIResource(0,0,0,0)); in the main ,

Java Nimbus Button.foreground not working

元气小坏坏 提交于 2019-12-10 17:16:53
问题 I am using the Nimbus LAF on my application and I want to change all buttons foreground colors. I do this setting: UIManager.put("Button.foreground", Color.WHITE); But this is not working. Maybe it is because I should only use the primary and secondary Nimbus colors? Could anyone help me please? Thanks a lot. 回答1: simple way 1) you can set Color once by put value to UIManager , then will be valid for whole (for example JLabel) instance 2) dynamically set and override UIManager repeatedly most

Loosing vertical scrollbar in netbeans nimbus LAF

喜你入骨 提交于 2019-12-10 15:19:53
问题 I'm using Netbeans 8.0.2 and the Nimbus Look And Feel. At a certain point, when the vertical scroll slider becomes small, it disappears. Has anyone the same behavior or any fix for that problem? EDIT: This happens only in Nimbus and Dark Nimbus LAF 回答1: There is a bug filed here. Assuming this is your problem, after setting your look and feel to Nimbus, try adding: LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); UIDefaults defaults = lookAndFeel.getDefaults(); defaults.put("ScrollBar

How to deal with derived color in Nimbus Look and Feel?

一曲冷凌霜 提交于 2019-12-10 13:54:06
问题 What I want is to make the background of a uneditable text area the same as its disabled background. I know that the color is available from the UIManager with the key TextArea.disabled : DerivedColor(color=214,217,223 parent=control offsets=0.0,0.0,0.0,0 pColor=214,217,223 I firstly tried: textArea.setBackground(UIManager.getColor("TextArea.disabled")); It changed nothing at all and the background was still white. Then I tried: textArea.setBackground(new Color(UIManager.getColor("TextArea

Nimbus Look And Feel adjust colors of menubar

走远了吗. 提交于 2019-12-09 00:57:27
问题 I am trying to adjust the colors of the Nimbus Look and Feel but it is only working partially. Especially I have problems adjusting the colors of the menubar. Here is a running example: import java.awt.Color; import java.awt.Dimension; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.UIManager.LookAndFeelInfo; import javax.swing

JTabbedPane: icon on left side of tabs

拈花ヽ惹草 提交于 2019-12-08 16:41:31
问题 hello i am using the nimbus look-and-feel and have a tabbedpane with an icon and text. now the icon appears on the right side of the text, while i would like to have it on the left side. also i would like to add some spacing between the icon and the text. thanks! 回答1: You need to set the tab component yourself; which governs how the tab title is rendered. // Create tabbed pane and add tabs. JTabbedPane tabbedPane = ... // Create bespoke component for rendering the tab. JLabel lbl = new JLabel

Changing DesktopIcon.width on nimbus

耗尽温柔 提交于 2019-12-08 04:55:52
问题 I'm trying to change the JInternalFrame iconifying size, I've tried changing the L&F defaults with javax.swing.UIManager.put("DesktopIcon.width", 300); but it doesn't work on Nimbus, I've also tried changing the DesktopIconUI with javax.swing.UIManager.put("DesktopIconUI", javax.swing.plaf.basic.BasicDesktopIconUI.class.getName()); but as soon as I minimize the JInternalFrame it dissapears, any sugestions? 回答1: You might be able to override the getBoundsForIconOf(JInternalFrame) method of

Update LookAndFeel Values On The Fly

孤者浪人 提交于 2019-12-08 03:02:23
问题 I want to be able to update the LookAndFeel attributes of my Swing GUI on the fly. In this case, I have a simple Swing/Awt game running what starts out as the Nimbus LookAndFeel . At various points after start up I want to change (let us say) just one detail: the background color of my application. I can change the background color by doing this: for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info

AbstractRegionPainter Java 7 dynamic import

六眼飞鱼酱① 提交于 2019-12-08 02:23:43
问题 As you know nimbus package is change in java 7. I am using AbstractRegionPainter with java6 in my app's server side, and my app's client side must work both in java 6 and 7. So how can i import this abstract class dynamicly depends on client's java version. The import text must change belong to java version. Or another solution i must extend it dynamicly belong to java version. 来源: https://stackoverflow.com/questions/14399843/abstractregionpainter-java-7-dynamic-import