/* Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This code is for educational purposes only. Use at own risk.*/

1. import java.awt.event.* ; 

2. import java.awt.* ; 

3. import java.applet.*; 

4.  

5. public class Override 

6.     extends OurApplet 

7.

8.   public void paint ( Graphics gr ) 

9.   { 

10.     for ( int i=0; i < 127; i++ ) 

11.     { 

12.       gr.setColor ( new Color ( i+127, 0, 0 )  ) ; 

13.       gr.drawLine ( 0, i, 300, i ) ; 

14.     } 

15.     for ( int i=127; i < 256; i++ ) 

16.     { 

17.       gr.setColor ( new Color ( 382-i, 0, 0 )  ) ; 

18.       gr.drawLine ( 0, i, 300, i ) ; 

19.     } 

20.     super.paint ( gr ) ; 

21.   } 

22.  

23.   public void init() 

24.   { 

25.     super.init(); 

26.     add ( new Label ( ".Duh ?" )  ) ; 

27.   } 

28.

29. //============================================== 

30. class OurApplet 

31.   extends Applet 

32.

33.   public void paint ( Graphics gr ) 

34.   { 

35.     gr.setColor ( Color.white ) ; 

36.     gr.drawString ( "..Superclass's paint ...." , 20,50 ) ; 

37.   } 

38.   public void init() 

39.   { 

40.     add ( new Label ( "..Superclass's init" ) ) ; 

41.   } 

42.

43. //======== other source files : ========================== 

44. /* 

45. ... 

46.   Object [ ]  obrefar = new Object [7] ; 

47.  

48.   Color col = new Color( ); 

49.   Date dt = new Date( ); 

50.   StringBuffer sb = new StringBuffer( ); 

51.   .... 

52.   obrefar [0] = col ; 

53.   obrefar [1] = dt ; 

54.   obrefar [2] = sb ; 

55.   .... 

56.  

57.   for ( int i=0 ; i < obrefar.length ; i++ ) 

58.   { 

59.     ta.append ( obrefar[i].toString( ) + "\n" ) ; 

60.   } 

61.   ... 

62.     ta.append ( obrefar[i] + "\n" ) ; 

63. ========================================== 

64.   public String toString( ) 

65.   { 

66.     //make String str 

67.     return str ; 

68.   } 

69. ... 

70. */