初学者

 初次接触C,JAVA 。感觉很有趣,好象很有信心去学。可是还没有发现有类似的网络平台去学西,也没有什么大鸟级的人物学习、研发的过程,去学习。也很希望自己将来成了大虾后,能留下些东西,让后人学习。

Apple                import java.applet.Applet;      import java.awt.Graphics;            public class Apple extends Applet ...{                StringBuffer buffer;                public void init() ...{              buffer = new StringBuffer();              addItem("initializing... ");          }                public void start() ...{              addItem("starting... ");          }                public void stop() ...{              addItem("stopping... ");          }                public void destroy() ...{              addItem("preparing for unloading...");          }                void addItem(String newWord) ...{              System.out.println(newWord);              buffer.append(newWord);              repaint();          }                public void paint(Graphics g) ...{              //Draw a Rectangle around the applet's display area.              g.drawRect(0, 0, size().width - 1, size().height - 1);                    //Draw the current string inside the rectangle.              g.drawString(buffer.toString(), 5, 15);          }      }        MyApplet                import java.awt.*;      import java.applet.*;            public class MyApplet extends Applet {              public void init() {          this.setBackground(Color.blue);          this.setLayout(new FlowLayout());          this.add(new Button("Button1"));          this.add(new Button("Button2"));        }      }        MyApplet2                import java.awt.*;      import java.applet.*;            public class MyApplet2 extends Applet {              public void paint(Graphics g) {          g.drawString("hello there", 200, 250);        }      }        FirstApp                import java.awt.*;            public class FirstApp extends Frame {                public FirstApp(String title) {             super(title);          }                public static void main(String argv[]) {            FirstApp fa = new FirstApp("First Application");            Button b = new Button("Ok");            fa.add(b);            fa.setSize(400, 160);            fa.setVisible(true);          }      }        MyClass                import java.awt.*;      import java.applet.*;            public class MyClass extends Frame {              public static void main(String argv[]) {          Applet applet = new MyApplet();          Frame f = new Frame("Applet as an Application");          f.add(applet);          f.setSize(400, 160);          f.setVisible(true);          applet.init();          applet.start();        }      }

  

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值