|  | 
		
| Java Example Program/ Sample Source Code 
| import javax.swing.*; 
 import java.awt.*;
 import java.awt.event.*;
 
 public class Show_CardLayout extends JFrame implements ActionListener{
 private CardLayout cardLayout;
 private Panel panel;
 private Button values[];
 private String names[] = { "card 1", "card 2", "card 3", "card 4" };
 
 public Show_CardLayout() {
 super("CardLayout Example");
 Container c = getContentPane();
 // create the Panel with CardLayout
 panel = new Panel();
 cardLayout = new CardLayout();
 panel.setLayout(cardLayout);
 // set up card1 and add it to Panel
 Label label1 = new Label("card one", SwingConstants.CENTER);
 Panel card1 = new Panel();
 card1.add(label1);
 panel.add(card1, label1.getText()); // add card to panel
 // set up card2 and add it to Panel deck
 Label label2 = new Label("card two", SwingConstants.CENTER);
 Panel card2 = new Panel();
 card2.setBackground(Color.blue);
 card2.add(label2);
 panel.add(card2, label2.getText()); // add card to panel
 // set up card3 and add it to Panel
 Label label3 = new Label("card three");
 Panel card3 = new Panel();
 card3.setLayout(new BorderLayout());
 card3.add(new Button("North"), BorderLayout.NORTH);
 card3.add(new Button("West"), BorderLayout.WEST);
 card3.add(new Button("East"), BorderLayout.EAST);
 card3.add(new Button("South"), BorderLayout.SOUTH);
 card3.add(label3, BorderLayout.CENTER);
 panel.add(card3, label3.getText()); // add card to panel
 // create and layout buttons that will control panel
 Panel buttons = new Panel();
 buttons.setLayout(new GridLayout(2, 2));
 values = new Button[names.length];
 for (int i = 0; i < values.length; i++) {
 values[i] = new Button(names[i]);
 values[i].addActionListener(this);
 buttons.add(values[i]);
 }
 c.add(buttons, BorderLayout.WEST);
 c.add(panel, BorderLayout.EAST);
 setSize(450, 200);
 setVisible(true);
 }
 
 public void actionPerformed(ActionEvent event) {
 if (event.getSource() == values[0])
 cardLayout.first(panel); // show first card
 else if (event.getSource() == values[1])
 cardLayout.next(panel); // show next card
 else if (event.getSource() == values[2])
 cardLayout.previous(panel); // show previous card
 else if (event.getSource() == values[3])
 cardLayout.last(panel); // show last card
 }
 
 public static void main(String args[]) {
 FirstAndLastInCardLayout cardLayoutExample = new FirstAndLastInCardLayout();
 cardLayoutExample.addWindowListener(new WindowAdapter() {
 public void windowClosing(WindowEvent e) {
 System.exit(0);
 }
 });
 }
 }
 |  |  |  
| 
| 
AWTEventMulticaster
How To Use AWTEventMulticasteradd(ActionListener a, ActionListener b) In AWTEventMulticasteradd(AdjustmentListener a, AdjustmentListener b) In AWTEventMulticasteradd(ComponentListener a, ComponentListener b) In AWTEventMulticasteradd(ContainerListener a, ContainerListener b) In AWTEventMulticasteradd(FocusListener a, FocusListener b) In AWTEventMulticasteradd(HierarchyBoundsListener a, HierarchyBoundsListener b) In AWTEventMulticasteradd(HierarchyListener a, HierarchyListener b) In AWTEventMulticasteradd(InputMethodListener a, InputMethodListener b) In AWTEventMulticasteradd(ItemListener a, ItemListener b) In AWTEventMulticasteradd(KeyListener a, KeyListener b) In AWTEventMulticasteradd(MouseListener a, MouseListener b) In AWTEventMulticasteradd(MouseMotionListener a, MouseMotionListener b) In AWTEventMulticasteradd(MouseWheelListener a, MouseWheelListener b) In AWTEventMulticasteradd(TextListener a, TextListener b)  In AWTEventMulticasteradd(WindowFocusListener a, WindowFocusListener b) In AWTEventMulticasteradd(WindowListener a, WindowListener b) In AWTEventMulticasteradd(WindowStateListener a, WindowStateListener b) In AWTEventMulticasteraddInternal(EventListener a, EventListener b) In AWTEventMulticasterremove(ActionListener l, ActionListener oldl) In AWTEventMulticasterremove(AdjustmentListener l, AdjustmentListener oldl) In AWTEventMulticasterremove(ComponentListener l, ComponentListener oldl) In AWTEventMulticasterremove(ContainerListener l, ContainerListener oldl) In AWTEventMulticasterremove(EventListener oldl) In AWTEventMulticasterremove(FocusListener l, FocusListener oldl) In AWTEventMulticasterremove(HierarchyBoundsListener l, HierarchyBoundsListener oldl) In AWTEventMulticasterremove(HierarchyListener l, HierarchyListener oldl) In AWTEventMulticasterremove(InputMethodListener l, InputMethodListener oldl) In AWTEventMulticasterremove(ItemListener l, ItemListener oldl) In AWTEventMulticasterremove(KeyListener l, KeyListener oldl) In AWTEventMulticasterremove(MouseListener l, MouseListener oldl) In AWTEventMulticasterremove(MouseMotionListener l, MouseMotionListener oldl) In AWTEventMulticasterremove(MouseWheelListener l, MouseWheelListener oldl) In AWTEventMulticasterremove(TextListener l, TextListener oldl)  In AWTEventMulticasterremove(WindowFocusListener l, WindowFocusListener oldl) In AWTEventMulticasterremove(WindowListener l, WindowListener oldl) In AWTEventMulticasterremove(WindowStateListener l, WindowStateListener oldl) In AWTEventMulticasterremoveInternal(EventListener l, EventListener oldl) In AWTEventMulticastersave(ObjectOutputStream s, String k, EventListener l)  In AWTEventMulticastersaveInternal(ObjectOutputStream s, String k)  In AWTEventMulticaster 
DefaultFocusTraversalPolicy 
DefaultKeyboardFocusManager 
Graphics
clipRect(int x, int y, int width, int height) In GraphicsdrawArc(int x, int y, int width, int height, int startAngle, int arcAngle) In GraphicsdrawLine(int x1, int y1, int x2, int y2) In GraphicsdrawOval(int x, int y, int width, int height) In GraphicsdrawPolygon(int[] xPoints, int[] yPoints, int nPoints) In GraphicsdrawRect(int x, int y, int width, int height) In GraphicsdrawString(String str, int x, int y) In GraphicsfillArc(int x, int y, int width, int height, int startAngle, int arcAngle) In GraphicsfillOval(int x, int y, int width, int height) In GraphicsfillPolygon(int[] xPoints, int[] yPoints, int nPoints) In GraphicsfillRect(int x, int y, int width, int height) In GraphicsdrawImage(Image img, int x, int y, ImageObserver observer) In GraphicssetColor(Java.awt.Color) In GraphicssetPaintMode() In GraphicssetXORMode(Java.awt.Color) In GraphicssetFont(Java.awt.Font) In Graphics 
GraphicsConfiguration
Using GraphicsConfigurationcreateCompatibleImage(int width, int height) In GraphicsConfigurationcreateCompatibleImage(int width, int height, int transparency) In GraphicsConfigurationcreateCompatibleVolatileImage(int width, int height) In GraphicsConfigurationcreateCompatibleVolatileImage(int width, int height, ImageCapabilities caps) In GraphicsConfigurationcreateCompatibleVolatileImage(int width, int height, ImageCapabilities caps, int transparency) In GraphicsConfigurationcreateCompatibleVolatileImage(int width, int height, int transparency) In GraphicsConfigurationgetBounds() In GraphicsConfigurationgetBufferCapabilities() In GraphicsConfigurationgetColorModel() In GraphicsConfigurationgetColorModel(int transparency) In GraphicsConfigurationgetDefaultTransform() In GraphicsConfigurationgetDevice() In GraphicsConfigurationgetImageCapabilities() In GraphicsConfigurationgetNormalizingTransform() In GraphicsConfigurationisTranslucencyCapable() In GraphicsConfiguration 
MediaTracker
How To Use MediaTrackeraddImage(Image image, int id) In MediaTrackeraddImage(Image image, int id, int w, int h) In MediaTrackercheckAll() In MediaTrackercheckAll(boolean load) In MediaTrackercheckID(int id) In MediaTrackercheckID(int id, boolean load) In MediaTrackergetErrorsAny() In MediaTrackergetErrorsID(int id) In MediaTrackerisErrorAny() In MediaTrackerisErrorID(int id) In MediaTrackerremoveImage(Image image) In MediaTrackerremoveImage(Image image, int id) In MediaTrackerremoveImage(Image image, int id, int width, int height) In MediaTrackerstatusAll(boolean load) In MediaTrackerstatusID(int id, boolean load) In MediaTrackerwaitForAll() In MediaTrackerwaitForAll(long ms) In MediaTrackerwaitForID(int id) In MediaTrackerwaitForID(int id, long ms) In MediaTracker | 
 |  |  |  |