1) Each time you call "new util()" you're creating a new "util" object. Each "util" object has its own copy of any member variables in the class. Calling setValue() on one util object will have no effect on the return value of getValue() in another util object. You want to share a single util object between your various classes, by passing it around as a method argument and/or storing it as a member variable in your various classes.
2) The version of "setValue" you've shown us here actually assigns a value to a local variable named myVal -- a variable that's used only in the setValue method. If there's also a member variable named myVal, then that member variable will remain null even within a single object after setValue is called.
These are really fundamental Java issues and have nothing to do with Swing/AWT as far as I can see, so I'm going to move this thread to the Java in General (Beginner) forum.