亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? javaapplet.java

?? 有關(guān)java的源程序,為講授java程序設(shè)計(jì)課程使用
?? JAVA
字號(hào):
//******************************************************************************
// JavaApplet.java:	Applet
//
//******************************************************************************
import java.applet.*;
import java.awt.*;
import java.net.*;

//==============================================================================
// Main Class for applet JavaApplet
//
//==============================================================================
public class JavaApplet extends Applet implements Runnable
{
	// THREAD SUPPORT:
	//		m_JavaApplet	is the Thread object for the applet
	//--------------------------------------------------------------------------
	private Thread	 m_JavaApplet = null;

	// ANIMATION SUPPORT:
	//		m_Graphics		used for storing the applet's Graphics context
	//		m_Images[]		the array of Image objects for the animation
	//		m_nCurrImage	the index of the next image to be displayed
	//		m_ImgWidth		width of each image
	//		m_ImgHeight		height of each image
	//		m_fAllLoaded	indicates whether all images have been loaded
	//		NUM_IMAGES 		number of images used in the animation
	//--------------------------------------------------------------------------
	private Graphics m_Graphics;
	private Image	 m_Images[];
	private int 	 m_nCurrImage;
	private int 	 m_nImgWidth  = 0;
	private int 	 m_nImgHeight = 0;
	private boolean  m_fAllLoaded = false;
	private final int NUM_IMAGES = 8;

	private TextField receiveEdit;
    private PlaySound playAudio;
	private Image backImage,ramImage;
	private boolean imageError=false;
	private boolean imageLoaded=false;

	// JavaApplet Class Constructor
	//--------------------------------------------------------------------------
	public JavaApplet()
	{
		// TODO: Add constructor code here
	}

	// APPLET INFO SUPPORT:
	//		The getAppletInfo() method returns a string describing the applet's
	// author, copyright date, or miscellaneous information.
    //--------------------------------------------------------------------------
	public String getAppletInfo()
	{
		return "Name: JavaApplet\r\n" +
		       "Author: wang\r\n" +
		       "Created with Microsoft Visual J++ Version 1.1";
	}


	// The init() method is called by the AWT when an applet is first loaded or
	// reloaded.  Override this method to perform whatever initialization your
	// applet needs, such as initializing data structures, loading images or
	// fonts, creating frame windows, setting the layout manager, or adding UI
	// components.
    //--------------------------------------------------------------------------
	public void init()
	{
        // If you use a ResourceWizard-generated "control creator" class to
        // arrange controls in your applet, you may want to call its
        // CreateControls() method from within this method. Remove the following
        // call to resize() before adding the call to CreateControls();
        // CreateControls() does its own resizing.
        //----------------------------------------------------------------------
    	//resize(100, 100);	//320,240

		// TODO: Place additional initialization code here
				setBackground(Color.yellow);
				setLayout(new BorderLayout());
				receiveEdit=new TextField(40);
				add("South",receiveEdit);
// load back ground image
			    backImage=
					getImage(getDocumentBase(),"images1/img01.gif");
// load Audio Sound file				
				playAudio=
					new PlaySound(this,getCodeBase(),"audio\\ah.au");
				playAudio.start();
	}

	// Place additional applet clean up code here.  destroy() is called when
	// when you applet is terminating and being unloaded.
	//-------------------------------------------------------------------------
	public void destroy()
	{
		// TODO: Place applet cleanup code here
	}

    // ANIMATION SUPPORT:
    //		Draws the next image, if all images are currently loaded
    //--------------------------------------------------------------------------
	private void displayImage(Graphics g)
	{
		if (!m_fAllLoaded)
			return;

		// Draw Image in center of applet
		//----------------------------------------------------------------------
		g.drawString("我可以接收J(rèn)AVA Applet A的信息",10,20);
		g.clipRect((size().width - m_nImgWidth)/ 2,(size().height - m_nImgHeight)/ 2, 
				   m_nImgWidth,m_nImgHeight);
		
		g.setColor(getBackground());
		g.fillRect((size().width - m_nImgWidth)/ 2,(size().height - m_nImgHeight)/ 2, 
				   m_nImgWidth,m_nImgHeight);
		g.setColor(getForeground());
		g.drawImage(m_Images[m_nCurrImage],
				   (size().width - m_nImgWidth)   / 2,
				   (size().height - m_nImgHeight) / 2, null);
    }
		
	public boolean imageUpdate(Image image,int infoflags,int x,int y,int w,int h)
	{
		if((infoflags&ERROR)!=0)	// load image is error !
		{
			imageError=true;
			return true;
		}
		
		repaint();
		return ((infoflags&(ERROR|ALLBITS))!=0);
	}
	
	public void update(Graphics g)
	{
		paint(g);
	}

	// JavaApplet Paint Handler
	//--------------------------------------------------------------------------
	public void paint(Graphics g)
	{
	
		// ANIMATION SUPPORT:
	    // The following code displays a status message until all the
		// images are loaded. Then it calls displayImage to display the current
		// image.
		//----------------------------------------------------------------------
		if (m_fAllLoaded)
		{
			//Rectangle r = g.getClipRect();
			//g.clearRect(r.x, r.y, r.width, r.height);
			displayImage(g);
		}
		else
		    g.drawString("Loading Applet B images...", 10, 20);
	// TODO: Place additional applet Paint code here
	    Dimension rectSize=size();
		g.setColor(Color.red);
		g.draw3DRect(0,0,rectSize.width-1,rectSize.height-1,true);
		g.draw3DRect(3,3,rectSize.width-7,rectSize.height-7,false);
		g.setColor(getForeground());
	}

	//		The start() method is called when the page containing the applet
	// first appears on the screen. The AppletWizard's initial implementation
	// of this method starts execution of the applet's thread.
	//--------------------------------------------------------------------------
	public void start()
	{
		if (m_JavaApplet == null)
		{
			m_JavaApplet = new Thread(this);
			m_JavaApplet.start();
		}
		// TODO: Place additional applet start code here
		playAudio.startPlay();
	}
	
	//		The stop() method is called when the page containing the applet is
	// no longer on the screen. The AppletWizard's initial implementation of
	// this method stops execution of the applet's thread.
	//--------------------------------------------------------------------------
	public void stop()
	{
		if (m_JavaApplet != null)
		{
			m_JavaApplet.stop();
			m_JavaApplet = null;
		}

		// TODO: Place additional applet stop code here
		playAudio.stopPlay();
	}

	// THREAD SUPPORT
	//		The run() method is called when the applet's thread is started. If
	// your applet performs any ongoing activities without waiting for user
	// input, the code for implementing that behavior typically goes here. For
	// example, for an applet that performs animation, the run() method controls
	// the display of images.
	//--------------------------------------------------------------------------
	public void run()
	{
		m_nCurrImage = 0;
		
		// If re-entering the page, then the images have already been loaded.
		// m_fAllLoaded == TRUE.
		//----------------------------------------------------------------------
        if (!m_fAllLoaded)
		{
    		repaint();
    		m_Graphics = getGraphics();
    		m_Images   = new Image[NUM_IMAGES];

    		// Load in all the images
    		//------------------------------------------------------------------
    		MediaTracker tracker = new MediaTracker(this);
    		String strImage;

    		// For each image in the animation, this method first constructs a
    		// string containing the path to the image file; then it begins
    		// loading the image into the m_Images array.  Note that the call to
    		// getImage will return before the image is completely loaded.
    		//------------------------------------------------------------------
    		for (int i = 1; i <= NUM_IMAGES; i++)
    		{
    			// Build path to next image
    			//--------------------------------------------------------------
    			strImage = "images1/img" + ((i < 10) ? "0" : "") + i + ".gif";
			    m_Images[i-1] = getImage(getDocumentBase(), strImage);

                tracker.addImage(m_Images[i-1], 0);
    		}

    		// Wait until all images are fully loaded
    		//------------------------------------------------------------------
			try
			{
				tracker.waitForAll();
				m_fAllLoaded = !tracker.isErrorAny();
			}
			catch (InterruptedException e)
			{
				// TODO: Place exception-handling code here in case an
				//       InterruptedException is thrown by Thread.sleep(),
				//		 meaning that another thread has interrupted this one
			}
			
			if (!m_fAllLoaded)
			{
			    stop();
			    m_Graphics.drawString("Error loading images!", 10, 40);
			    return;
			}
			

			// Assuming all images are same width and height.
			//--------------------------------------------------------------
		    m_nImgWidth  = m_Images[6].getWidth(this);
		    m_nImgHeight = m_Images[6].getHeight(this);
        }		
		repaint();

		while (true)
		{
			try
			{
				// Draw next image in animation
				//--------------------------------------------------------------
				displayImage(m_Graphics);
				m_nCurrImage++;
				if (m_nCurrImage == NUM_IMAGES)
					m_nCurrImage = 0;
// TODO:  Add additional thread-specific code here
				Thread.sleep(50);
					
			}
			catch (InterruptedException e)
			{
				// TODO: Place exception-handling code here in case an
				//       InterruptedException is thrown by Thread.sleep(),
				//		 meaning that another thread has interrupted this one
				stop();
			}
		}
	}

	// MOUSE SUPPORT:
	//		The mouseDown() method is called if the mouse button is pressed
	// while the mouse cursor is over the applet's portion of the screen.
	//--------------------------------------------------------------------------
	public boolean mouseDown(Event evt, int x, int y)
	{
		// TODO: Place applet mouseDown code here
		return true;
	}

	// MOUSE SUPPORT:
	//		The mouseUp() method is called if the mouse button is released
	// while the mouse cursor is over the applet's portion of the screen.
	//--------------------------------------------------------------------------
	public boolean mouseUp(Event evt, int x, int y)
	{
		// TODO: Place applet mouseUp code here
		return true;
	}

	// MOUSE SUPPORT:
	//		The mouseDrag() method is called if the mouse cursor moves over the
	// applet's portion of the screen while the mouse button is being held down.
	//--------------------------------------------------------------------------
	public boolean mouseDrag(Event evt, int x, int y)
	{
		// TODO: Place applet mouseDrag code here
		return true;
	}

	// MOUSE SUPPORT:
	//		The mouseMove() method is called if the mouse cursor moves over the
	// applet's portion of the screen and the mouse button isn't being held down.
	//--------------------------------------------------------------------------
	public boolean mouseMove(Event evt, int x, int y)
	{
		// TODO: Place applet mouseMove code here
		return true;
	}

	// MOUSE SUPPORT:
	//		The mouseEnter() method is called if the mouse cursor enters the
	// applet's portion of the screen.
	//--------------------------------------------------------------------------
	public boolean mouseEnter(Event evt, int x, int y)
	{
		// TODO: Place applet mouseEnter code here
		return true;
	}

	// MOUSE SUPPORT:
	//		The mouseExit() method is called if the mouse cursor leaves the
	// applet's portion of the screen.
 	//--------------------------------------------------------------------------
	public boolean mouseExit(Event evt, int x, int y)
	{
		// TODO: Place applet mouseExit code here
		return true;
	}


	// TODO: Place additional applet code here
	public void processRequestFrom(String senderString)
	{
		receiveEdit.setText("OK Receive----"+senderString);
//Let Explore to Show HTML Document in The Applet Window
		getAppletContext().showDocument(getDocumentBase());
//Display Host Name String
		if(getCodeBase().getHost()==null)
			showStatus("Host is Null String");
		showStatus(getCodeBase().getHost());
	}

}

//--------Audio Class to Play Sound(must have Sound Hardware Support)
class PlaySound extends Thread
{
	Applet applet;
	URL baseURL;
	String audioFileName;
	AudioClip audioClip=null;

	public PlaySound(Applet applet,URL baseURL,String audioFileName)
	{
		this.applet=applet;
		this.baseURL=baseURL;
		this.audioFileName=audioFileName;
		setPriority(MIN_PRIORITY);
	}

	public void run()
	{
		audioClip=applet.getAudioClip(baseURL,audioFileName);
		if(audioClip!=null)
		      audioClip.loop();
	}

	public void startPlay()
	{
		if(audioClip!=null)
		    audioClip.loop();
	}

	public void stopPlay()
	{
		if(audioClip!=null)
		      audioClip.stop();
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲影视在线播放| 欧美一三区三区四区免费在线看 | 91精品国产一区二区| 免费人成精品欧美精品| 欧美午夜精品理论片a级按摩| 一区二区三区中文字幕在线观看| 色综合色狠狠天天综合色| 国产精品成人一区二区艾草| av中文字幕一区| 国产精品第四页| 91亚洲精品久久久蜜桃| 日韩一区在线免费观看| 91久久人澡人人添人人爽欧美 | 亚洲欧美自拍偷拍| 99久久国产综合精品色伊| 亚洲精品菠萝久久久久久久| 色婷婷综合激情| 婷婷丁香久久五月婷婷| 精品久久久久久久久久久久久久久 | 国产在线不卡一区| 精品av久久707| 经典三级视频一区| 日韩欧美卡一卡二| 国产毛片一区二区| 亚洲天天做日日做天天谢日日欢 | 99re这里只有精品6| 亚洲人123区| 欧美日韩高清在线播放| 久久99国产精品免费| 国产亚洲成aⅴ人片在线观看| 91亚洲精品久久久蜜桃网站| 天使萌一区二区三区免费观看| 91一区一区三区| 夜夜亚洲天天久久| 欧美一级精品在线| 国产99久久久国产精品潘金| 亚洲精品免费在线| 日韩欧美亚洲一区二区| 成人精品一区二区三区四区 | 精品理论电影在线观看| 白白色 亚洲乱淫| 亚洲高清在线视频| 国产亚洲欧美一区在线观看| 在线观看一区日韩| 国产麻豆成人传媒免费观看| 亚洲精品网站在线观看| 日韩精品一区二区三区视频| 成人中文字幕合集| 视频一区国产视频| 国产精品成人网| 91精品国模一区二区三区| 成人国产视频在线观看| 日日嗨av一区二区三区四区| 国产精品久久久久久亚洲毛片| 欧美人与z0zoxxxx视频| 成人免费精品视频| 久久99国产精品麻豆| 一区二区三区免费看视频| 久久九九久精品国产免费直播| 欧美日韩亚洲不卡| 99热这里都是精品| 精品亚洲porn| 亚洲一区二区美女| 一区二区在线观看免费| 综合分类小说区另类春色亚洲小说欧美| 精品88久久久久88久久久| av毛片久久久久**hd| 国产人成一区二区三区影院| 日韩一区二区高清| 欧美久久一二三四区| 国产精品视频观看| 成人免费一区二区三区在线观看| 99久久99久久久精品齐齐| 大陆成人av片| 成人精品gif动图一区| 成人免费观看视频| 成人高清av在线| 99视频在线观看一区三区| 色综合久久中文综合久久牛| 日本韩国欧美一区| 色综合视频在线观看| 91免费观看视频在线| 精品视频在线看| 欧美精品电影在线播放| 91精品综合久久久久久| 欧美成人午夜电影| 久久久久国产精品厨房| 中文字幕不卡的av| 亚洲视频1区2区| 亚洲一区二区高清| 美女一区二区在线观看| 久久99久久精品欧美| 亚洲视频在线观看三级| 久久精品国产免费看久久精品| 无吗不卡中文字幕| 韩国v欧美v日本v亚洲v| 丁香婷婷深情五月亚洲| 一本色道久久综合亚洲精品按摩| 欧美日韩一本到| 精品粉嫩aⅴ一区二区三区四区| 久久久一区二区三区捆绑**| 国产精品免费久久| 亚州成人在线电影| 国产精品一区久久久久| 色婷婷精品大在线视频 | 日韩精品一卡二卡三卡四卡无卡| 蜜桃一区二区三区在线| 国产成人av影院| 91久久精品网| 久久老女人爱爱| 亚洲一区免费在线观看| 久久爱www久久做| 色综合激情久久| 精品国产一区二区精华| 一区二区三区欧美在线观看| 久久99精品一区二区三区三区| 成人精品视频.| 欧美丰满少妇xxxbbb| 国产免费成人在线视频| 亚洲成人免费影院| 国产 欧美在线| 4438x成人网最大色成网站| 国产欧美日韩在线观看| 日韩精品亚洲一区| 92精品国产成人观看免费| 日韩一区二区三区高清免费看看| 国产精品久久久久影院老司| 免费欧美日韩国产三级电影| av电影一区二区| 精品国产乱码久久久久久老虎| 一区二区三区产品免费精品久久75| 国产一区在线观看麻豆| 欧美精品乱码久久久久久| 国产精品沙发午睡系列990531| 蜜桃免费网站一区二区三区| 在线亚洲+欧美+日本专区| 久久久久99精品一区| 日本麻豆一区二区三区视频| 日本精品免费观看高清观看| 国产亚洲一区二区三区四区 | 国内成+人亚洲+欧美+综合在线| 在线亚洲免费视频| 国产精品久久久久久一区二区三区| 久久99热这里只有精品| 欧美日韩在线精品一区二区三区激情 | 欧美午夜电影网| 亚洲女女做受ⅹxx高潮| 成人午夜碰碰视频| 久久久久亚洲综合| 麻豆精品视频在线观看视频| 欧美精品国产精品| 亚洲va国产天堂va久久en| 在线精品视频一区二区| 中文字幕综合网| 99精品黄色片免费大全| 国产精品久久午夜夜伦鲁鲁| 国产成人av影院| 国产日韩精品一区二区三区| 久久精品国产第一区二区三区| 欧美高清视频一二三区| 亚洲一区二区成人在线观看| 91久久精品一区二区三区| 亚洲人成亚洲人成在线观看图片| 成人爽a毛片一区二区免费| 久久综合资源网| 激情综合五月天| 久久人人97超碰com| 国产一区二区在线电影| 久久九九久久九九| 成人性生交大片| 中文字幕在线不卡一区| 99r国产精品| 一区二区在线电影| 欧美日韩午夜精品| 午夜精品福利一区二区三区蜜桃| 欧美丝袜自拍制服另类| 亚洲电影你懂得| 日韩午夜在线影院| 国产一区三区三区| 中文av字幕一区| 97成人超碰视| 婷婷综合在线观看| 日韩精品中午字幕| 国产jizzjizz一区二区| 亚洲精品大片www| 在线播放/欧美激情| 久久精品国产成人一区二区三区 | 91精品国产综合久久婷婷香蕉| 日本网站在线观看一区二区三区| 精品国产乱码久久久久久蜜臀| 成人免费观看视频| 亚洲综合视频在线| 日韩欧美国产午夜精品| 国产999精品久久久久久| 亚洲美女淫视频| 日韩一级完整毛片| 99视频精品在线| 免费一级欧美片在线观看| 久久九九久久九九| 欧美私人免费视频|