您的位置:程序门 -> java -> j2se / 基础类



老师,状态栏里怎么显示 鼠标当前位置


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


老师,状态栏里怎么显示 鼠标当前位置[已结贴,结贴人:ghosthuo]
发表于:2007-01-12 23:08:48 楼主
老师,请问   状态栏里怎么显示   鼠标当前位置
谁能给出代码呀,,,,,,
发表于:2007-01-12 23:14:351楼 得分:0
自己顶一下
发表于:2007-01-12 23:19:122楼 得分:0
问的不够细
我正做一下记事本,不知道怎么在状态栏里怎么显示     鼠标当前的行,列.
请老师们帮助一下.
最好写出什么包的什么类..哪个方法什么的.(我是初学者)
发表于:2007-01-12 23:20:423楼 得分:10
listen   to   mouse   move   event,   you   will   have   the   coordinate   of   current   mouse   location.   then   you   just   display   the   coordinate   values.

if   you   don 't   know   how   to   listen   to   event,   please   study   hard   on   java   tutorial   on   swing.
发表于:2007-01-12 23:23:454楼 得分:0
晕,谢谢了.直接给我代码好了.我再去自己看看..
发表于:2007-01-13 01:00:235楼 得分:10
i   think   you   are   looking   for   this   document.   there   is   a   sample   code   available   for   you   to   study.

http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#caret
发表于:2007-09-03 17:32:016楼 得分:0
void   cmyview::onmousemove(uint   nflags,   cpoint   point)  
{
//   todo:   add   your   message   handler   code   here   and/or   call   default
cstring   str;
str.format( "x   =   %d,y   =   %d ",point.x,point.y);
((cmainframe*)getparent())   -> m_wndstatusbar.setwindowtext(str);
cview::onmousemove(nflags,   point);
}


快速检索

最新资讯
热门点击