look-and-feel

Table Cell renderer using Nimbus and Scala

廉价感情. 提交于 2019-12-22 10:31:13
问题 I asked this question about a problem I was seing with a cell renderer using the Nimbus look and feel and the issue has turned out to be possibly to do with Scala. Basically I have a cell renderer which extends Panel (as opposed to DefaultTableCellRenderer ) and it is behaving oddly: it is not rendering the alternate row colors properly whereas an equivalent Java program behaves just fine. If anyone is interested, here is some Scala code to run: import com.sun.java.swing.plaf.nimbus

How can I setup LookAndFeel Files in Java?

霸气de小男生 提交于 2019-12-22 07:51:09
问题 I need to setup LookAndFeel Files in JDK 1.6. I have two files: napkinlaf-swingset2.jar napkinlaf.jar How can I set this up and use it? I would like a GTK look and feel OR Qt look and feel, Are they available? 回答1: The class name for Naplin is net.sourceforge.napkinlaf.NapkinLookAndFeel . So to set it as default on the command line, use: java -Dswing.defaultlaf=net.sourceforge.napkinlaf.NapkinLookAndFeel To install it add napkinlaf.jar to the lib/ext direction and the lines: swing

Substance and MacOS MenuBar

只愿长相守 提交于 2019-12-22 06:48:01
问题 I have a Class MainWindow which extends JFrame. In MainWindow i have a JMenuBar. I want to show the MenuBar in OSX on top (next to the Apple Symbol). This only works, when i dont set a Substance Skin. Is it possible to use a Substance Skin and use The MacOS MenuBar? My Code: //Set Menu for MacOS System.setProperty("apple.laf.useScreenMenuBar", "true"); System.setProperty("com.apple.mrj.application.apple.menu.about.name", name); try { SwingUtilities.invokeAndWait(new Runnable() { public void

How to change background color of JTabbedPane in runtime?

廉价感情. 提交于 2019-12-20 04:15:57
问题 I have founds loads of examples that change the background color of JTabbedPane using either setBackgroundAt() and UIManager.put("JTabbedPane...") However, I want to create an onclick event on a checkbox that changes the background color to green when you select it, and back to default when you unselect it. I haven't been able to make that work using the above methods. Any ideas? PS: I can change the foreground color by using setForgroundAt() but not the background for some reason 回答1: LAFs

Mixing look and feel

你离开我真会死。 提交于 2019-12-20 03:14:08
问题 So far I have this public static void main(String[] args) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); UIManager.getBorder("design");//change look and feel here? } catch (Exception e) { JOptionPane.showMessageDialog(null, "Nimbus isn't available"); } javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { design GUI = new design(); GUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); GUI.setVisible(true); } }); } I'm trying to make

How to change the color of a single JProgressBar in Nimbus?

[亡魂溺海] 提交于 2019-12-19 21:52:14
问题 I'm trying to change the color of a single JProgressBar in Nimbus LAF (Look And Feel). This solution does work, but it changes the colors of ALL JProgressBars :/ UIDefaults defaults = UIManager.getLookAndFeelDefaults(); defaults.put("nimbusOrange",defaults.get("nimbusBase")); In this thread is another solution to change the color for each JProgressBar individually: progress = new JProgressBar(); UIDefaults defaults = new UIDefaults(); defaults.put("ProgressBar[Enabled].backgroundPainter", new

How to change the color of a single JProgressBar in Nimbus?

倾然丶 夕夏残阳落幕 提交于 2019-12-19 21:50:12
问题 I'm trying to change the color of a single JProgressBar in Nimbus LAF (Look And Feel). This solution does work, but it changes the colors of ALL JProgressBars :/ UIDefaults defaults = UIManager.getLookAndFeelDefaults(); defaults.put("nimbusOrange",defaults.get("nimbusBase")); In this thread is another solution to change the color for each JProgressBar individually: progress = new JProgressBar(); UIDefaults defaults = new UIDefaults(); defaults.put("ProgressBar[Enabled].backgroundPainter", new

Change Default Buttons in Java to Make Them Look “Better”

大憨熊 提交于 2019-12-19 05:45:17
问题 I'm essentially trying to mimic the default windows xp simple calculator. When I change the background colours of the buttons in Java it makes them look very flat and "boring". I want to make the buttons look as close as possible to the buttons in the Windows XP calculator. Here is an image comparing mine to WinXp's: Is there some kind of method I can use to change the style of the buttons much like you can do in Visual Basic to make the buttons almost pop more or look 3D like the Windows Xp

Is there a way to have the Nimbus Look&Feel render its own windows decorations for a top level JFrame?

£可爱£侵袭症+ 提交于 2019-12-19 04:20:15
问题 Is there a way to have the Nimbus Look&Feel render its own windows decorations for a top level JFrame ? I've been digging through the Internet, and I'm starting to suspect it might not be possible at all. Has anyone actually succeeded with (and cared about) that? Nimbus decorations are nice and neat for internal frames , but apparently there is no way to have the same effect on JFrame s and JDialog s. I tried nimbusx (Nimbus Extensions), a library that subclasses JFrame and JDialog and

JFrame and Nimbus Look And Feel

。_饼干妹妹 提交于 2019-12-18 18:05:21
问题 I use Nimbus Look and Feel in a project. However, although every GUI JComponent have a Look and Feel of Nimbus, JFrame always have Windows Look and Feel. How can JFrame have Nimbus Look And Feel? Edit: Operating System : Windows XP 回答1: Try using this: JFrame.setDefaultLookAndFeelDecorated(true); //before creating JFrames For more info., see How to Set the Look and Feel in the tutorial. import javax.swing.*; class FrameLook { public static void showFrame(String plaf) { try { UIManager