j2me 低级UI下 圆角小菜单画法

/**
	 * 画小菜单
	 *  @param g 画笔
	 * @param st_w 文字数组
	 * @param x  x坐标
	 * @param y y坐标
	 * @param i_wight  宽度
	 * */
	public void paintLowMenu(Graphics g, String[] st_w, int x, int y, int i_wight) {
		g.setClip(0, 0, 240, 320);
		g.setColor(ColorSet.i_noButtenFrame);
		g.fillRoundRect(x, y, i_wight, st_w.length * 20, 10, 10);
		g.setColor(ColorSet.i_noButtenBG);
		g.fillRoundRect(x + 2, y + 2, i_wight - 4, st_w.length * 20 - 4, 10, 10);
		for (int i = 0; i < st_w.length; i++) {
			if (i != 0) {
				g.setColor(ColorSet.i_noButtenFrame);
				g.drawLine(x, y + i * 20, x + i_wight - 2, y + i * 20);
			}
			g.setColor(ColorSet.i_noButtenFont);
			g.drawString(st_w[i], x + 5, y + (i * 20) + 1, 20);
		}
	}

 

此方法还有诸多的局限性,仅供各位参考。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值