look-and-feel

setOpaque() in java

ぐ巨炮叔叔 提交于 2019-11-26 17:49:28
问题 Can anyone explain why Nimbius treats the setOpaque() differently than other java LaF's. Its breaking my code because components that are normally transparent no longer are. EDIT: The problem seems to only deal with JTextAreas (which is what I need) or similar components. EDIT EDIT: This is a screen of the actual application. When applying trashgod's solution, the background still does not show through. EDIT EDIT EDIT: I tried trashgod's suggestion to override the paint(). I toiled with this

Trying to create JTable with proper row header

倖福魔咒の 提交于 2019-11-26 11:17:41
问题 I am trying to create a JTable that has a row header that looks just like a column header and I have spent altogether too much time on it :/ My situation is similar to this question: JTable Row Header Implementation and maybe this one: customizing jtable cellrenderer with table's cell header color They don\'t seem to have gotten me all the way there yet. I have searched tried many examples out there and all are lacking. There aren\'t even any examples of tables with row headers at all from

PrimeFaces CSS skin not showing in login page, also JavaScript undefined errors

邮差的信 提交于 2019-11-26 07:49:55
问题 I am using PrimeFaces 3.4 in my web app and for a particular page the controls are not displayed with the normal PrimeFaces skin: <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:h=\"http://java.sun.com/jsf/html\" xmlns:f=\"http://java.sun.com/jsf/core\" xmlns:ui=\"http://java.sun.com/jsf/facelets\" xmlns:p=\"http://primefaces.org/ui\"> <h:head> <title>VMS login<

How can I change the arrow style in a JComboBox

折月煮酒 提交于 2019-11-26 05:36:30
问题 Let\'s say I want to use a custom image for the arrow in JComboBox, how can I do this? I understand it\'s possible using the synth xml files, or maybe even UIManager.put(...), but I don\'t know how. All I want to do at this time is change the arrow image to something else, either programatically or even just overriding the image it uses. How exactly can I do this? 回答1: You can override createArrowButton() in BasicComboBoxUI. BasicArrowButton is a convenient starting point. class ColorArrowUI

Custom button not working on mac (ButtonUI)

旧巷老猫 提交于 2019-11-26 01:02:38
问题 I\'ve got an application that uses custom buttons all over the place for text and icons. Works great for windows and linux, but now OSX users are complaining. Text doesn\'t display on the mac, just \'...\'. The code seems simple enough, but I\'m clueless when it comes to macs. How can I fix this? Test case: package example.swingx; import example.utils.ResourceLoader; import com.xduke.xlayouts.XTableLayout; import javax.swing.*; import javax.swing.plaf.ComponentUI; import java.awt.*; import

Painting the slider icon of JSlider

早过忘川 提交于 2019-11-26 01:01:43
问题 Would like to repaint the the marker or the thumb of the JSlider instead of the standard gray. How can I achieve this? 回答1: There are three ways: change Java Look and Feel, Preferred of Ways OverRide XxxSliderUI, but that would be Look and Feel sensitive, and not easy way learning The Synth Look and Feel Example using Synth SynthSliderTest.java import java.awt.*; import javax.swing.*; import javax.swing.plaf.synth.*; public class SynthSliderTest { private JFrame f = new JFrame(); public

Look and feel is not updating in Swing JTabbedPane

时光总嘲笑我的痴心妄想 提交于 2019-11-25 23:33:31
问题 I have created an application in Java Swing. I offer the option to change the look and feel of the application from a menu, but after adding a new tab in JTabbedPane , it is not getting updated with the new look and feel. I have already used this code: Window windows[] = Frame.getWindows(); for(Window window : windows) { SwingUtilities.updateComponentTreeUI(window); } 回答1: Leveraging @Andrew's example and this old thing, it seems to work for me. import java.awt.BorderLayout; import java.awt

Custom button not working on mac (ButtonUI)

ぐ巨炮叔叔 提交于 2019-11-25 22:57:44
I've got an application that uses custom buttons all over the place for text and icons. Works great for windows and linux, but now OSX users are complaining. Text doesn't display on the mac, just '...'. The code seems simple enough, but I'm clueless when it comes to macs. How can I fix this? Test case: package example.swingx; import example.utils.ResourceLoader; import com.xduke.xlayouts.XTableLayout; import javax.swing.*; import javax.swing.plaf.ComponentUI; import java.awt.*; import java.awt.event.ActionEvent; public class SmallButton extends JButton { private static ComponentUI ui = new

Painting the slider icon of JSlider

空扰寡人 提交于 2019-11-25 22:40:39
Would like to repaint the the marker or the thumb of the JSlider instead of the standard gray. How can I achieve this? mKorbel There are three ways: change Java Look and Feel , Preferred of Ways OverRide XxxSliderUI, but that would be Look and Feel sensitive, and not easy way learning The Synth Look and Feel Example using Synth SynthSliderTest.java import java.awt.*; import javax.swing.*; import javax.swing.plaf.synth.*; public class SynthSliderTest { private JFrame f = new JFrame(); public SynthSliderTest() { try { SynthLookAndFeel laf = new SynthLookAndFeel(); laf.load(SynthSliderTest.class

Java Look and Feel (L&F) [closed]

空扰寡人 提交于 2019-11-25 22:18:54
问题 I am developing a desktop application with Java Swing for my personal use.I am in need of some beautiful Look and Feel for my application. How can I do it using Java or a 3rd party API? 回答1: There is a lot of possibilities for LaFs : The native for your system The nimbus LaF Web LaF The substance project (forked into the Insubstantial project) Napkin LaF Synthetica Quaqua (looks like aqua from MacOS X) Seaglass JGoodies Liquidlnf The Alloy Look and Feel PgsLookAndFeel JTatoo Jide look and