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

📄 button.java

📁 J2ME上的一个播放器,可以更换皮肤.开源软件.
💻 JAVA
字号:
package inline.ui.ce;

import inline.ui.*;
import java.util.*;
import javax.microedition.lcdui.*;

    public class Button extends CanvasElement 
    {
        private String caption;

        private int vctsel = 0;
        private int intsta = 0;
        private int intend = 0;
        

        public Button(HostCanvas prnt, int x, int y, int w, int h, String ccaption)
        {
            super(prnt, x,y,w,h);
            caption = ccaption;
        }
        
        protected final boolean drawFocus()
        {
            return true;
        }
        
        protected final boolean drawBorder()
        {
            return true;
        }
        
	public final boolean canFocus()
        {
            return true;
        }

        public void paintElement(Graphics g) 
        {
            synchronized (g) 
            {
		g.drawString(caption, 0, 0, 0);
            }
        }
        
        public void keyPressedElement(int keyCode)
        {
            boolean paint = false;
            
            if (keyCode == CENTER)
            {
		parent.selectPreview(this);
            }
        }

	protected int getContentWidthImpl()
	{
	    return getFont().stringWidth(caption); 
	}

	protected int getContentHeightImpl()
	{
	    return getFontHeight(); 
	}
	
    }

⌨️ 快捷键说明

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