Question: The BasicArrowButton is a class is part of the Java SE. The BasicArrowButton Displays a Single Arrow Head in a specified direction. I want to override the class, preserving the existing methods but having the Basic Arrow Button display a double arrowhead instead of a single arrowhead. For Example See the following URL www.tiresias.org/images/ff.jpg. All I'm looking to do is to change the way this icon is drawn. 

Thank you,

Answer: 
subclass **BasicArrowButton** and override *paintTriangle*. You can try recalling **BasicArrowButton**'s *paintTriangle* method twice to get the triangles. For example:

```
public static class Bidriectional extends BasicArrowButton {
  private static final long serialVersionUID = 1L;

  public Bidriectional() {
   // This does not matter, we'll override it anyways.
   super(SwingConstants.NORTH);
  }

  @Override
  public void paintTriangle(Graphics g, int x, int y, int size,
    int direction, boolean isEnabled) {

   super.paintTriangle(g, x - (size / 2), y, size, SwingConstants.EAST, isEnabled);
   super.paintTriangle(g, x + (size / 2), y, size, SwingConstants.EAST, isEnabled);
  }
 }

```

Should give you a button looking something like this:

[![screenshot](https://i.stack.imgur.com/0zCdT.jpg)](https://i.stack.imgur.com/0zCdT.jpg)  

(source: [amnet.net.au](http://www.amnet.net.au/~kgoh/images/double_arrow.jpg))
Simple.

Subclass BasicArrowButton and override the paint() method and simply draw the image mentioned in your question (ff.jpg or any other image) by using [g.drawImage()](http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Graphics.html#drawImage(java.awt.Image,%20int,%20int,%20java.awt.Color,%20java.awt.image.ImageObserver)). 

Note you may need to copy ff.jpg in to your project and load it.

**Note**: For this you have to create a new class and use it. You cannot change the exisiting behaviour of BasicArrowButton because it does not use a UI delegate.