windows-look-and-feel

Double icons with JMenuItem setHorizontalTextPosition on Win

爷,独闯天下 提交于 2021-02-07 18:28:38
问题 Two icons are rendered when using JMenuItem setHorizontalTextPosition(SwingConstants.LEFT) with Windows Look and Feel. It works fine with the default Java Look and Feel. I just filed a Java bug report, posting here for anyone else having the same problem. Does anyone have another workaround to suggest? Thanks. import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.image.BufferedImage; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax

JTabbedPane in Windows L&F with unremovable border

泄露秘密 提交于 2019-12-25 08:17:42
问题 I'm writing a Swing program using JTabbedPane (containing a JScrollPane) and the Windows look and feel. When the JTabbedPane renders with Windows L&F, it places a two pixel white line to the left, and a one pixel white line on the bottom of the Component (see attached image). Is there a way to remove this? Adding (or removing) a border only places one around the outside of the lines. I've looked at writing my own UI for this particular component, but I'm not sure where to start exactly (let

Disable single ALT type to activate the menu

若如初见. 提交于 2019-12-24 06:17:08
问题 I'm trying to disable the default behavior of the ALT key in Windows Look and Feel when a JTextArea is focused and the frame has a JMenu installed. What happens by default is that the menu gets the keyboard focus and therefore you can't continue typing there. My first attempt was to capture single ALT presses by adding the key to the JTextArea InputMap: //Disable ALT key presses when the textarea is focused jta.getInputMap(javax.swing.JComponent.WHEN_FOCUSED).put(javax.swing.KeyStroke

JProgressBar Windows laf

末鹿安然 提交于 2019-12-23 07:38:07
问题 I've been working for a while with JProgressBar using WindowsLookAndFeel , but I found some major differences from the native progress bar: Here is the native bar, in its regular state: While this is Java's: A sharp eye might see java's, top white color much brighter, and the green a little brighter too. Also the native is "filled" while Java's has an empty border. Now, the native indeterminate: And Java's: The flicker is much shorter, and much much faster (not shown). Also as the native