look-and-feel

Overriding LookAndFeel

吃可爱长大的小学妹 提交于 2019-12-13 00:35:42
问题 Hello I am trying to change the colors of my swing progress bar in java. Initially I tried using the following code: UIManager.put("ProgressBar.selectionBackground", Color.black); UIManager.put("ProgressBar.selectionForeground", Color.white); UIManager.put("ProgressBar.background", Color.white); UIManager.put("ProgressBar.foreground", Color.RED); m_progressBar.setBackground(Color.BLACK); m_progressBar.setForeground(Color.red); But none of the commands seemed to have any effect!!! Unless I set

JTable, update Colors Cell when LookAndFeel Nimbus or GTK are used

假装没事ソ 提交于 2019-12-13 00:15:28
问题 I have a Resume of the Codes and Responses... I'm trying to repaint a JPanel (what contains another Objects) contained in JTable cells. In order to follow this answers https://stackoverflow.com/a/28368503/1410223 COMPLETE SOURCE CODE public class JTableSynthTest extends JFrame { String[] hdrsObjects = new String[]{ "Name", "Last Name", "Sport", " Level" }; Object[][] matrixInfo = { {new Info("Kathy"), new Info("Smith"), new Info("Snowboarding"), new Info("1")}, {new Info("John"), new Info(

Change JButton Shape while respecting Look And Feel

风流意气都作罢 提交于 2019-12-12 18:13:13
问题 I know this question has been asked a million times, and can be done by overriding paintComponent() , but what I want to know is how to change the shape while respecting the current Look And Feel. If I want to change the shape to a circle, I also want the button to look like a button, just with a different shape. I tried making a JButton, the overriding paintComponent , then clipping it to a circle, but I didn't get the border effects on Nimbus LAF . Is there a better way? Or is there a

How to list all available LookAndFeel themes?

帅比萌擦擦* 提交于 2019-12-12 16:13:28
问题 How to list all available LookAndFeel themes? I want to show then in a JComboBox for the user to select. 回答1: It's really simple: public static UIManager.LookAndFeelInfo[] getInstalledLookAndFeels() by the way check UIManager documentation here 回答2: UIManager.LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels(); 来源: https://stackoverflow.com/questions/2655513/how-to-list-all-available-lookandfeel-themes

Designing simple cell renderer for Nimbus look and feel

穿精又带淫゛_ 提交于 2019-12-12 08:56:23
问题 I have a simple-ish cell renderer which is composed of a few JLabel s (the renderer itself extends JPanel ) and I'm trying to get it to render sensibly in the Nimbus look and feel. Basically what is happening is that in the lighter rows (as Nimbus has alternate row coloring ), my specific cell renderer is using the table background color (which is much darker than both lighter and the darker row colors). In my renderer I do: if (isSelected) { setBackground(table.getSelectionBackground); }

Add an event handler to each control on a form at runtime VB6

喜夏-厌秋 提交于 2019-12-12 08:54:18
问题 I have a VB6 application where I'd like to have a consistent behavior among its controls application-wide. One of the behaviors, for example, would be highlighting a text box when it gains focus and removing the highlight when it loses focus. I'd like this to happen on every form. What I'm trying to do is have one sub procedure that can be called by all forms when they load that will make this behavior happen. That way, I don't have to manually code for each individual text box to make it

Why the same font looks different in Java app run from Netbeans and run from Jar?

半世苍凉 提交于 2019-12-12 02:56:50
问题 In my Java Swing app I have some JTextAreas, I realize the text looks different when it's run from Netbeans and when the app is run from a Jar file, why ? How to make them look the same ? JTextArea Client_Side_TextArea=new JTextArea(),Network_TextArea=new JTextArea(); setLayout(new BorderLayout()); Client_Side_TextArea.setFont(new Font("Monospaced",0,15)); Client_Side_TextArea.setForeground(new Color(0,28,218)); Client_Side_TextArea.setPreferredSize(new Dimension(290,300)); Client_Side

java, apple default look and feel: How to set color of a button

爷,独闯天下 提交于 2019-12-12 02:15:00
问题 i want to know how to set the color of a button (in example, but i will need to set every component color) with the apple look and feel. I found an answer in stackoverflow that suggest to change to the standard look and feel, that works for me, but i prefer not to change because I like apple's one. Is there any solution? I know there is because I saw many apps written in java that have colored buttons and also that use particular styles or images as background. Can you tell me a solution? 回答1

NullPointerException on PLAF change to Motif

那年仲夏 提交于 2019-12-12 00:56:50
问题 Can anybody see what I have done to cause the NullPointerException (stack trace below)? The panel appears OK: Textual output os.name: Windows Vista os.version: 6.1 java.version: 1.6.0 java.vm.version: 1.6.0-b105 java.vendor: Sun Microsystems Inc. That ( 1.6.0-b105 ) is ancient, it is the default run time environment of Netbeans here. Must update to a version 7 JRE. Code import java.awt.*; import java.awt.event.*; import java.util.HashMap; import java.util.Map; import javax.swing.*; import

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