I created my own OutlineBox class which will create a box with an optional fill and an outline. Here is my code:

```
/**
* OutlineBox.java
*/
package com.propfinancing.jme3;
import java.util.ArrayList;
import com.jme3.asset.AssetManager;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh;
import com.jme3.scene.Node;
import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Cylinder;
import com.jme3.scene.shape.Sphere;
/**
* Class to implement a box with an outline
* @author Neil Aggarwal
*/
public class OutlineBox extends Node {
/** Constructor
* @param fillColor Fill color for the box, set to null for no fill
* @param outlineColor Outline color for the box, set to null for no outline
*/
public OutlineBox(AssetManager assetManager, float xExt, float yExt, float zExt,
float lineWidth, ColorRGBA fillColor, ColorRGBA outlineColor) {
// Check if we have a fill color and add a box for it
if( fillColor != null ) {
Mesh m = new Box(xExt, yExt, zExt);
Geometry geom = new Geometry("Fill", m);
Material mat = new Material(assetManager,"Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", fillColor);
geom.setMaterial(mat);
attachChild(geom);
}
// Check if we have an outline color
if( outlineColor != null ) {
// Put spheres at each of the vertices
for( int x=-1; x<=1; x+=2 )
for( int y=-1; y<=1; y+=2 )
for( int z=-1; z<=1; z+=2 ) {
Mesh m = new Sphere(64,64,lineWidth/2);
Geometry geom = new Geometry("Vertex", m);
Material mat = new Material(assetManager,"Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", outlineColor);
geom.setMaterial(mat);
geom.setLocalTranslation(new Vector3f(x*xExt,y*yExt,z*zExt));
attachChild(geom);
}
// Add the outline segments
ArrayList<Vector3f> rotationAxes = new ArrayList<Vector3f>();
rotationAxes.add(Vector3f.UNIT_X);
rotationAxes.add(Vector3f.UNIT_Y);
rotationAxes.add(Vector3f.UNIT_Z);
for( Vector3f rotationAxis : rotationAxes ) {
if( rotationAxis.equals(Vector3f.UNIT_X) ) {
for( int x=-1; x<=1; x+=2 )
for( int z=-1; z<=1; z+=2 )
addOutlineSegment(assetManager,rotationAxis,x*xExt,0,z*zExt,lineWidth,yExt,outlineColor);
} else if( rotationAxis.equals(Vector3f.UNIT_Y) ) {
for( int y=-1; y<=1; y+=2 )
for( int z=-1; z<=1; z+=2 )
addOutlineSegment(assetManager,rotationAxis,0,y*yExt,z*zExt,lineWidth,xExt,outlineColor);
} else if( rotationAxis.equals(Vector3f.UNIT_Z) ) {
for( int x=-1; x<=1; x+=2 )
for( int y=-1; y<=1; y+=2 )
addOutlineSegment(assetManager,null,x*xExt,y*yExt,0,lineWidth,zExt,outlineColor);
}
}
}
}
/** Add an outline segment */
private void addOutlineSegment(AssetManager assetManager, Vector3f rotationAxis,
float x, float y, float z,
float lineWidth, float extent, ColorRGBA outlineColor) {
Mesh m = new Cylinder(64,24,lineWidth/2f,extent*2);
Geometry geom = new Geometry("Segment", m);
Material mat = new Material(assetManager,"Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", outlineColor);
geom.setMaterial(mat);
if( rotationAxis != null ) {
Quaternion rotation = new Quaternion().fromAngleAxis(90*FastMath.DEG_TO_RAD,rotationAxis);
geom.setLocalRotation(rotation);
}
geom.setLocalTranslation(new Vector3f(x,y,z));
attachChild(geom);
}
}
```

Please let me know if anyone has suggestions on how to improve it.

Also, if people want me to contribute it to JME, I am willing to do so.