KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > java > awt > Canvas

java.awt
Class Canvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
See Also:
Top Examples, Source Code

public void addNotify()
See Also:
Component.getToolkit(), Toolkit.createCanvas(java.awt.Canvas)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Canvas()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Canvas(GraphicsConfiguration config)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void createBufferStrategy(int numBuffers)
See Also:
getBufferStrategy(), Component.isDisplayable(), IllegalStateException, IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void createBufferStrategy(int numBuffers,
                                 BufferCapabilities caps)
                          throws AWTException
See Also:
getBufferStrategy(), IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public AccessibleContext getAccessibleContext()
See Also:
Component, Accessible
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BufferStrategy getBufferStrategy()
See Also:
createBufferStrategy(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void paint(Graphics g)
See Also:
update(Graphics), Component
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[214]Crates an AWT Canvas
By halfmove { at } web { dot } de on 2003/04/03 08:14:37  Rate
public KGui (  )   {  
   super ( "Komplexe Zahlen" ) ; 
   field_1 = new JTextField ( 1 ) ; 
   field_2 = new JTextField ( 1 ) ; 
   field_3 = new JTextField ( 1 ) ; 
   field_4 = new JTextField ( 1 ) ; 
    
   field_5 = new JTextField ( 1 ) ; 
   field_6 = new JTextField ( 1 ) ; 
   field_7 = new JTextField ( 1 ) ; 
   field_8 = new JTextField ( 1 ) ; 
   JButton uebernehmen1 = new JButton ( "Zahlen abschicken" ) ; 
   uebernehmen1.addActionListener ( this ) ; 
   content = getContentPane (  ) ; 
   content.setLayout ( new BorderLayout (  )  ) ; 
   content.setBackground ( Color.white ) ; 
   JPanel panel1 = new JPanel (  ) ; 
   content.add ( panel1,BorderLayout.NORTH ) ; 
   OperationPanel opanel = new OperationPanel ( komplex ) ; 
   content.add ( opanel, BorderLayout.WEST ) ;   
   panel1.add ( new JLabel ( "Zahl 1:" )  ) ; 
   panel1.add ( new JLabel ( "RT 1:" )  ) ; 
   panel1.add ( field_1 ) ; 
   panel1.add ( new JLabel ( "IT 1:" )  ) ; 
   panel1.add ( field_2 ) ; 
   panel1.add ( new JLabel ( "Zahl 2:" )  ) ;   
   panel1.add ( new JLabel ( "RZ2:" )  ) ; 
   panel1.add ( field_3 ) ; 
   panel1.add ( new JLabel ( "IZ2:" )  ) ; 
   panel1.add ( field_4 ) ; 
   panel1.add ( uebernehmen1 ) ;   
   apanel = new JPanel (  ) ; 
   zeichenCanvas = new Canvas (  ) ; 
   content.add ( apanel, BorderLayout.CENTER ) ; 
   apanel.add ( zeichenCanvas ) ; 
    
   zeichenCanvas.paint ( Graphics g ) ; 
   g.drawLine ( centerpoint,centerpoint,centerpoint,300 ) ; 
   g.drawLine ( centerpoint,centerpoint,300,centerpoint ) ; 
   g.drawLine ( centerpoint,centerpoint,100,centerpoint ) ; 
   g.drawLine ( centerpoint,centerpoint,centerpoint,100 ) ;


public void update(Graphics g)
See Also:
paint(Graphics), Component
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags