The LineAttributes object defines all rendering state that can be set as a component object of a Shape3D node.The line attributes that can be defined are:

  1. Pattern
  2. Antialiasing (enabled or disabled)
  3. Width (in pixels)

This program illustrates antialiasing by the LineAttributes.

 public class AntialiasingExample extends JFrame {
  public AntialiasingExample() {
    ...
  }

  public BranchGroup createSceneGraph() {
    BranchGroup objRoot = new BranchGroup();

    ...

    objRoot.addChild(new Shape3D(createGeometry(),createAppearance()));

    ...

    return objRoot;
  }
  
  private Geometry createGeometry(){
    ...
  }
  
  private Appearance createAppearance(){
    Appearance appear=new Appearance();
    
    LineAttributes la=new LineAttributes();
    // Enable line antialiasing
    la.setLineAntialiasingEnable(true);
    appear.setLineAttributes(la);
    
    return appear;
  }
  
  public static void main(String[] args){
    ...
  }
}