look-and-feel

Updating the LAF of a different class

那年仲夏 提交于 2019-12-25 14:42:54
问题 In a "Battleship" program I wrote, I included the possibility to change the "look and feel" of a program to SystemDefault, "Metal" (Java Default) or "Motif" (also included in Java). If you choose the desired LAF from a JComboBox (--> changes a predefined String, lookFeel ) and press a confirm button, UIManager.setLookAndFeel(lookFeel) is called, and also SwingUtilities.updateComponentTreeUI(this) and the method updateUI() with the following code: public static void updateUI() { /

Updating the LAF of a different class

↘锁芯ラ 提交于 2019-12-25 14:42:10
问题 In a "Battleship" program I wrote, I included the possibility to change the "look and feel" of a program to SystemDefault, "Metal" (Java Default) or "Motif" (also included in Java). If you choose the desired LAF from a JComboBox (--> changes a predefined String, lookFeel ) and press a confirm button, UIManager.setLookAndFeel(lookFeel) is called, and also SwingUtilities.updateComponentTreeUI(this) and the method updateUI() with the following code: public static void updateUI() { /

Updating the LAF of a different class

帅比萌擦擦* 提交于 2019-12-25 14:42:05
问题 In a "Battleship" program I wrote, I included the possibility to change the "look and feel" of a program to SystemDefault, "Metal" (Java Default) or "Motif" (also included in Java). If you choose the desired LAF from a JComboBox (--> changes a predefined String, lookFeel ) and press a confirm button, UIManager.setLookAndFeel(lookFeel) is called, and also SwingUtilities.updateComponentTreeUI(this) and the method updateUI() with the following code: public static void updateUI() { /

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

Color of JOptionPane border

佐手、 提交于 2019-12-25 05:27:16
问题 How might I go about changing the color of a JOptionPane's border ? Here is a screenshot of the border I am talking about: That blue border is what I am trying to get rid of. I tried to set UIManager.put("OptionPane.border", new BorderFactory...) for LookAndFeel but that changed the inside border, not the outermost one. I need to get rid of that blue border. Any ideas? -Mark 回答1: Read the JOptionPane API . It shows you how to create a JOption pane manually so that you have access to the

setting Swing JInternalFrame lnf manually

笑着哭i 提交于 2019-12-25 01:44:08
问题 UIManager.put("InternalFrame.activeTitleBackground", new ColorUIResource(new Color(207,255,247))); UIManager.put("InternalFrame.inactiveTitleBackground", new ColorUIResource(new Color(207,255,247))); JDesktopPane baTabbedPane = new JDesktopPane(); JInternalFrame iframe = new JInternalFrame("Cheapest To Deliver",true,true,true,true); iframe.setSize(400,150); baTabbedPane.add(iframe); why is my Internal Frame's title background not set on startup? I've tried setting it on the overall JFrame

JFileChooser open multiple files in the order they are clicked

我怕爱的太早我们不能终老 提交于 2019-12-24 16:44:06
问题 I have an application that takes multiple files and applies some operation that depends on their order (e.g. merge them one after another). The user can select files in any order by Ctrl+click, or by Shift+click. The list files returned by the chooser does not have the same order as the user clicked them. I'd like them to be returned in the same order the user clicked them. Disclaimer: I'm "the user" I'm using the JFileChooser class with Java look and feel on Windows 7 64bits, with JDK 7.

Mimic default behaviour of row rendering in a JTable

我的未来我决定 提交于 2019-12-24 13:40:26
问题 In my Java 7 application I use a Swing JTable with two columns. The left column uses a DefaultTableCellRenderer where the setHorizontalAlignment() is set to centered, whereas the right column uses no specific renderer. That right column shows each table row in alternating colors by default, which is not the case on the left column with the renderer used. Moreover, when I hover with the mouse over the rows on the right column, then the row under the mouse curser is highlighted when focused,

How to set JProgressBar text color independently for multiple JProgressBars without changing Look and Feel

人走茶凉 提交于 2019-12-24 11:32:51
问题 Continuing from Setting the colors of a JProgressBar text I would like to be able to set the text colors of JProgressBar s in my program dependent upon process state and without moving away from System look and feel. From one of the answers on Setting the colors of a JProgressBar text , it looks like I can only set text colors without changing the UI to a single set of values, so I could choose neutral values that look decent regardless of the foreground and progress, but I would like to

java look and feel: windows server 2012 shows progress bar too thin

纵然是瞬间 提交于 2019-12-24 09:16:04
问题 I get very thin progress bar on **windows server 2012 ** , when I use UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); The bar look okay in windows 7, very thin on windows server 2012. java version every where is (both JDK and JRE) 1.6.0_25, 32 bit Here is the full code to demonstrate a problem (or documentation issue) I am on jdk 1.6.0_25 package demos; import javax.swing.*; import javax.swing.plaf.metal.DefaultMetalTheme; import javax.swing.plaf.metal.MetalLookAndFeel;