Well, you're doing nothing wrong from a _Java_ point of view. Unfortunately due to the way Processing code is preprocessed into Java code, your classes can't have static functions.
Basically, Processing turns any class declared in the IDE into an inner class - the wrapper class extends PApplet, and that is the way you get to say things like println("Hello") instead of System.out.println("Hello") or PApplet.println("Hello"). So what your example is parsed into behind the scenes is something like this:
Code:
import [a whole bunch of things];
public class MyClass extends PApplet{
[other stuff, like your setup or draw methods]
class Something{
int a;
static int B;
static int GetB(){
return B;
}
static void PrintHello(){
println("Hello from class Something");
}
}
}
Now, as to why exactly this is disallowed, that's a whole other story. There are some (kind of) decent reasons that nested classes are not allowed to have static members, which you can certainly Google for if you're interested. I'm not sure what the argument is against static methods in inner classes, but apparently Sun decided it was a Bad Idea.
There are two workarounds in Processing: first, you could just declare any of those methods as global functions, outside of your declared class, which will probably suit your needs 90% of the time. For instance, you could write:
int GetB(){
return Something.B;
}
and
void PrintHello(){
println("Hello from class Something");
}
in your example, outside of the Something class definition, and things should work right.
Otherwise, if you create a new tab in Processing and name it something with a .java extension, it will not be run through the preprocessor, and you can write pure Java code. The "gotcha" there is that the Something class will no longer extend PApplet, so you'd need to write PApplet.println("Hello") instead of just println("Hello"). Similarly, a lot of the math functions will need to be qualified like that as well, and the drawing ones might be even trickier, since I think they even require a specific instance of PApplet, which you'll need to store in the Something class when you construct it.