Barbecue is a Java library that enables the creation of barcodes in a variety of standard formats that can be displayed as Swing/AWT components, included in printed output, generated as EPS and SVG and displayed in a web application.
For simple HowTo examples see classes:
net.sourceforge.barbecue.Main
net.sourceforge.barbecue.example.BarbecueSwingGUI