When you add a JTextField to a BoxLayout managed panel it will expand vertically to take up available space.
To avoid this you can simply set the maximum size of the field to be the same as its preferred size.
textField.setMaximumSize( textField.getPreferredSize() );
Cli clip = getClipFromSomewhere();
// Get the gain control from clip
FloatControl gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);
// set the gain (between 0.0 and 1.0)
double gain = 0.25;
float dB = (float) (Math.log(gain) / Math.log(10.0) * 20.0);
Java introduced scripting support with Java 6.
ScriptEngineManager manager = new ScriptEngineManager();
Object result = engine.eval("6 * (3 + 5)");