⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 visitoris.java

📁 Java Applet实例讲解 N多例子
💻 JAVA
字号:
import java.applet.*;

import java.awt.*;

import java.net.*;

public class VisitorIs extends Applet

{
  private InetAddress VisitorAddress;
  private Label LAddress;
  private Dimension size;
  
  public void init()
  {
    size = this.size();
    this.setBackground(Color.white);
    this.setLayout(null);
    
    try
    {
      VisitorAddress = InetAddress.getLocalHost();					

    }
    catch(UnknownHostException nohost)
    {
    
    }
    repaint();
  }
  
  public void  paint(Graphics g)
  {
    String s = new String("");
    s = VisitorAddress.getHostName();
    g.setFont(new Font("Courier",Font.BOLD,18));
    g.setColor(Color.blue);
    g.drawString(s,0,23);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -