Use Arrow Button from Swing in Java
Description
The following code shows how to use Arrow Button from Swing.
Example
import java.awt.GridLayout;
// w w w . j av a 2 s . c o m
import javax.swing.JFrame;
import javax.swing.plaf.basic.BasicArrowButton;
public class Main {
public static void main(String args[]) {
JFrame frame = new JFrame("Popup JComboBox");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new GridLayout(0,5));
frame.add(new BasicArrowButton(BasicArrowButton.EAST));
frame.add(new BasicArrowButton(BasicArrowButton.NORTH));
frame.add(new BasicArrowButton(BasicArrowButton.SOUTH));
frame.add(new BasicArrowButton(BasicArrowButton.WEST));
frame.setSize(300, 200);
frame.setVisible(true);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Swing »
Java Tutorial »
Swing »