How to use freely resizable font in in Java ME(5)

来源:未知 责任编辑:责任编辑 发表时间:2013-12-18 11:34 点击:

        return pressed;
    }
 
    public void commandAction(Command c, Displayable d) {
        if (c == exitCommand) {
            midlet.notifyDestroyed();
        }
    }
 
    class Button {
        private int x=0;
        private int y=0;
        private int w=0;
        private int h=0;
        private int size=0;
        private String text="";
        protected boolean selected = false;
 
        protected Button(int h, int size, String text) {
            this.h = h;
            this.size = size;
            this.text = text;
        }
 
        public void registerFeedbackArea(Canvas canvas, int id) {
            if (touchFeedback) {
                try {
                    tactileFeedback.registerFeedbackArea(canvas, id, x, y, w, h,
                        TactileFeedback.FEEDBACK_STYLE_BASIC);
                }
                catch (IllegalArgumentException iae) {
                    System.out.println("IllegalArgumentException: " + iae.getMessage());
                }
            }
        }
 
        public int drawButton(Graphics g, int x, int y, boolean selected) {
            this.x = x;
            this.y = y;
            font = DirectUtils.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, size);
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • Java编程语言的八大优点
  • JVM对象生命周期详细介绍
  • Java平台上的CRM系统
  • Java 算数测试小程序
  • Command(命令模式)
  • Java 一个简单的画图程序
  • Java环境 使用Resin在NT环境下配置JSP环境
  • Java 日历的小程序
  • Java 统计代码的小工具
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1