Multi-Media APIs Code Samples
Multi-Media includes 2D graphics, 3D graphics, printing, imaging, and sound. For 3D graphics examples, see The j3d.org Code Repository.
Imaging
- ImageOps.java illustrates the use of four image-filter operations: low-pass, sharpen, lookup, and rescale. For supporting information see The Java Tutorial Continued: Images.
- Java Advanced Imaging download includes demo and tutorial with source code
Java Media Framework
- JMF in Action presents several applets that run movie clips.
Printing
- ComponentPrinterFrame.java prints a frame and the components it contains.
- printbutton.java displays a panel with MyButton on it. When you click the button, the application prints the MyButton AWT component.
- printbutton.java displays a panel with MyButton on it. When you click the button, the application prints the MyButton Swing component.
- printpanel.java prints a panel and the button it contains.
- ShapesPrint.java creates a print job, displays a print dialog, and initiates the printing process to print the contents of a component. For supporting information see The Java Tutorial Continued: Printing.
- SimpleBook.java prints a collection of pages. For supporting information see The Java Tutorial Continued: Printing.
2D Graphics
- ClipImage.java animates a clipping path to reveal different portions of an image. For supporting information see The Java Tutorial Continued: 2D Graphics.
- Composite.java illustrates the effects of various compositing styles and alpha combinations. For supporting information see The Java Tutorial Continued: 2D Graphics.
- Pear.java shows how to construct a pear shape using area geometry shapes. For supporting information see The Java Tutorial Continued: 2D Graphics.
- ShapesDemo2D.java shows how to draw and fill a selection of 2D geometric shapes. For supporting information see The Java Tutorial Continued: 2D Graphics.
- SwingShapeMover.java lets the user drag a Shape object around within a window and is redrawn at every mouse location to provide feedback to the user dragging it. For supporting information see The Java Tutorial Continued: 2D Graphics.
- Transform.java demonstrates various transformation algorithms for changing the shape and position of 2D graphics. For supporting information see The Java Tutorial Continued: 2D Graphics.