Have a look at Using negative patterns for Subversion’s svn:ignore property. Obviously you can use “!” in character groups to negate its meaning. So if you want to ignore everything except files ending with .java, set the following pattern to svn:ignore:
*[!j][!a][!v][!a]
*.java?*