If your class has a main() method, you can run it by Shift + F6 in NetBeans.
By the way, can you post your code here ? (and remember to format the code :))