Hi all, started playing with nifty recently, and have started looking at styles…

Where is nifty-default-styles.xml?

I can find the nifty-default-controls.xml…(its in nifty-default-controls.jar/default package) but the default styles…I’m at loss as to where this config is…any pointers? (I tried adding my own nifty-styles), but this replaces the entire default styles defined as well…which is not what I want…(i.e. I just want add a few styles to those already defined).

Ultimately I’m just trying to change the background color of a pre-existing panel programatically, but from what I can tell this is only possible by changing the style? this incorrect?

I started to write a Quick reference for Nifty (for myself to use), but didn’t get very far. Here is the document as far as I managed to get in PDF format. I think it has some of the information you want.

Nifty Quick Reference PDF

This document addresses Nifty from an XML perspective only. Nothing programmatic here.

1 Like

Why people use crap like is beyond me. Couldn’t you use something more usable please? I’d like to see that QR.

lol alfnete your farther behind then I am… :slight_smile:

this is much better pdf imho:

Yes, admittedly it is better. But it will take you a couple of days to read and there is a fair bit of complementary info on the web, not to mention dozens of web posts on jME’s site … so “keep chewing” !

: )


I’d love to use something more useable. What is more useable?


If you don’t have a domain, don’t you have a web space provided by your ISP (they all give that)? Upload it there. Lacking that, you could use dropbox or other file hosting solution. There are many options. Just google it.

nifty-default-styles.xml hides in the nifty-style-black-.jar :slight_smile:

What do you mean by “pre-existing panel”? You mean a panel style like “nifty-panel” or “nifty-panel-red”? Then you’re right that these are default styles and you can make your own copy by looking at the source or resource files of the nifty-style-black jar.

You can create your own style or not use styles at all and still create the exact same look…

1 Like

By pre-existing I mean I have created panel with id=x defined in the xml config…

and simply want to do based off of an event:

Element e = nifty.getCurrentScreen().findElementByName(“x”);


but obviously there is no such method…nor did I see any 'object/class definition for A Panel object, which I would think would have a setBackgroundColor()). perhaps there is another method like: e.setAttribute(“backgroundColor”,“xyz”)…but I didnt see that other.

from what I gather I can only do something like: e.setStyle(xxx)

hence I need to either add a new style, which looks like a no go…unless I replace all the default styles…(at least when I added my own styles definition in the xml…the defaults all vanished…from what I could tell…i.e. black screen).

page 93 in the nifty bible: “change panel, image and text attributes” + PanelRenderer is the way to salvation …