nimbus

Swing and Nimbus: Replace background of JPopupMenu (attached to JMenu)

喜夏-厌秋 提交于 2019-11-29 17:04:32
问题 Nimbus often looks great, but for certain color combinations the result is non-optimal. In my case, the background of a JPopupMenu does not fit, which is why I want to set it manually. I'm on Java 7 and, interestingly, Nimbus fully ignores the setting of some properties in the UIManager (like PopupMenu.background ). So my only option was to create a subclass of JPopupMenu that overrides paintComponent(...) . I know, that's nasty, but at least it worked. However, if you add a JMenu to another

Aligning icon to the left in JTabbedPane in Nimbus Look and Feel

僤鯓⒐⒋嵵緔 提交于 2019-11-29 14:57:22
I was creating an application with JTabbedPane using Nimbus look and feel I have used this code to place tabs: pane.addTab("Welcome",new ImageIcon("resources\\1.png"),mainPanel,"Takes to the welcome page"); I want the icon to appear on the left and dic19 You can set a custom component for rendering the tab title, through JTabbedPane.setTabComponentAt(int index, Component component) method: Sets the component that is responsible for rendering the title for the specified tab . A null value means JTabbedPane will render the title and/or icon for the specified tab. A non-null value means the

JTable Nimbus Look and Feel - how to make it clear which cell has focus

喜你入骨 提交于 2019-11-29 14:40:00
When editing data in a JTable (Nimbus L & F), as the user tabs from cell to cell, it is not obvious which cell has focus. How can I make it clearer which cell has focus? I know there are a number of properties that can be set to modify Nimbus - does anyone know which property I want? The screen shot below has only one property set to something other than the default: UIManager.put("Table.showGrid", true); you have look at Renderer concept , by defaul works for Nimbus Look and Feel , some issue could be with JButtons components (JCheckBox e.i.) , but a few times are answered or solved on this

Nimbus and alternate row colors

◇◆丶佛笑我妖孽 提交于 2019-11-29 04:49:01
I don't understand how alternate row coloring works in Nimbus. It seems just crazy!!! I would like to clear things up here. For the demonstration, let's say that we want a JTable that alternate Red and Pink rows (and I don't care which color is the first one). Without redefining custom cellRenderers that perform their own "modulo 2" thing, and without overriding any method from JTable, I want to list the mandatory steps between starting one's application and getting a JTable with custom alternate row colors using Nimbus properties only . Here are the steps I expected to follow: Install the

Nimbus L&F - Change Background color of Progress Bar

♀尐吖头ヾ 提交于 2019-11-28 14:07:47
i'm developing a little GUI application with Java using Netbeans Editor. I've put in a JFrame a simple Progress Bar. I'm developing the project with JDK7 I want to change the background Color from default Orange to a personal one. I've already tried all the properties for the color changing but when i run the program the color still the same. I've already tried using ProgressBar1.setBackground(new java.awt.Color(0, 204, 255)); and UIManager.put("ProgressBar.background", Color.YELLOW); UIManager.put("ProgressBar.foreground", Color.MAGENTA); UIManager.put("ProgressBar.selectionBackground", Color

Java / Swing -> Creating a notification JFrame, and the error “The frame is displayable”

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 13:59:08
Ok, I am not that versed in Java / Swing, and I am running into a problem. My application is throwing this error: "Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: The frame is displayable." Google isn't turning up much information on this error, and a quick search of StackOverflow is not showing anything yet. What I am trying to do: just implement translucent windows using the code from the tutorials. That's it. I plan to use this as a general window for displaying notifications, such as "This program has not been run in 30 days" down near the system tray. Are

TTF and OTF versions of Source Sans Pro are differently displayed in Swing (Nimbus L&F)

假如想象 提交于 2019-11-28 12:48:22
ttf: otf: both are the same font but different fontfile types I am running Java 7 in Windows 7 According to Miguel Sousa by Adobe the bug is not in the fonts https://github.com/adobe/source-sans-pro/issues/32#issuecomment-23319673 I am just setting the default font to the new font. The TTF version works without any issues Font font_o = Font.createFont(Font.TRUETYPE_FONT, fonts.class.getResourceAsStream("fonts/TTF/SourceSansPro-Regular.ttf")); //Font font_o = Font.createFont(Font.TRUETYPE_FONT, fonts.class.getResourceAsStream("fonts/OTF/SourceSansPro-Regular.otf")); Font font_n=font_o

Problems changing JButton background colors multiple times in Nimbus L&F

点点圈 提交于 2019-11-28 09:59:50
问题 While using the Nimbus L&F feel in Java, I am having problems with changing the background color for a JButton more than once. In the code below, I have a simple Swing application that displays a JButton and attempts to change the color once per second. However, only the first color is being applied. Can anyone provide any suggestions on how to make this change more than once? I'm running java 6.29. public class NimbusTest3 extends JFrame { private javax.swing.JButton button; public

JTable Nimbus Look and Feel - how to make it clear which cell has focus

荒凉一梦 提交于 2019-11-28 08:32:59
问题 When editing data in a JTable (Nimbus L & F), as the user tabs from cell to cell, it is not obvious which cell has focus. How can I make it clearer which cell has focus? I know there are a number of properties that can be set to modify Nimbus - does anyone know which property I want? The screen shot below has only one property set to something other than the default: UIManager.put("Table.showGrid", true); 回答1: you have look at Renderer concept, by defaul works for Nimbus Look and Feel, some

Java Nimbus LAF with transparent text fields

南笙酒味 提交于 2019-11-28 08:32:11
I have an application that uses disabled JTextFields in several places which are intended to be transparent - allowing the background to show through instead of the text field's normal background. When running the new Nimbus LAF these fields are opaque (despite setting setOpaque(false)), and my UI is broken. It's as if the LAF is ignoring the opaque property. Setting a background color explicitly is both difficult in several places, and less than optimal due to background images actually doesn't work - it still paints it's LAF default background over the top, leaving a border-like appearance