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

📄 bitmapcomponent.java

📁 This serial client in JAVA allows sending, reading and writing of SMS via a serial COM port. The too
💻 JAVA
字号:
// Mobile Access Control: Access Unit Prototype
// (C) 2002, Swisscom Corporate Technology, S. Moscibroda

// Helping class to display Bitmap pictures in a simple way




import java.awt.*;

class BitmapComponent
extends Canvas
{
   private Image img;

   public BitmapComponent(String fname)
   {
     img = getToolkit().getImage(fname);
     MediaTracker mt = new MediaTracker(this);

     mt.addImage(img, 0);
     try {
     //Warten, bis das Image vollst鋘dig geladen ist,
      //damit getWidth() und getHeight() funktionieren
       mt.waitForAll();
     } catch (InterruptedException e) {
      //nothing
    }
   }

   public void paint(Graphics g)
   {
     g.drawImage(img,1,1,this);
   }

   public Dimension getPreferredSize()
   {
     return new Dimension(
       img.getWidth(this),
       img.getHeight(this)
     );
   }

   public Dimension getMinimumSize()
   {
     return new Dimension(
       img.getWidth(this),
       img.getHeight(this)
     );
   }
}

⌨️ 快捷键说明

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