📄 applet1.java~6~
字号:
package picture;import java.awt.*;import java.awt.event.*;import java.applet.*;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.applet.*;import java.awt.event.*;import java.awt.image.ImageObserver;import javax.swing.*;import javax.swing.tree.*;import javax.swing.event.*;import java.net.*;import java.io.*;import java.util.*; //vector Classimport java.lang.Thread.*;import java.awt.image.BufferedImage;import java.awt.Graphics2D.*;import java.awt.geom.Line2D;import java.lang.Thread.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Applet1 extends Applet { private boolean isStandalone = false; Image backImage; int backImageWeith; int backImageHeight; URL chatURL; JButton jButton1 = new JButton(); //Get a parameter value public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } //Construct the applet public Applet1() { } //Initialize the applet public void init() { try { chatURL = new URL("http://127.0.0.1:8080/"); jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { jButton1.setBounds(new Rectangle(11, 4, 75, 33)); jButton1.setText("wjy"); jButton1.addMouseListener(new Applet1_jButton1_mouseAdapter(this)); this.setLayout(null); this.add(jButton1, null); } //Get Applet information public String getAppletInfo() { return "Applet Information"; } //Get parameter info public String[][] getParameterInfo() { return null; } void jButton1_mouseClicked(MouseEvent e) { backImage = this.getImage(chatURL, "916试验点分布图.gif"); do { backImageWeith = backImage.getWidth(null); backImageHeight = backImage.getHeight(null); } while (backImageWeith == -1 || backImageHeight == -1); Graphics g; g=this.getGraphics(); g.drawImage(backImage, 0, 0, backImageWeith, backImageHeight, null); } //endif }class Applet1_jButton1_mouseAdapter extends java.awt.event.MouseAdapter { Applet1 adaptee; Applet1_jButton1_mouseAdapter(Applet1 adaptee) { this.adaptee = adaptee; } public void mouseClicked(MouseEvent e) { adaptee.jButton1_mouseClicked(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -