java中e.getModifiers()的作用 - Java / Java相关
public void initMusicModeControl() {
but_music.addMouseListener(new MouseAdapter() {
MyMenu popup_menuList = new MyMenu("播放曲目");
public void mouseClicked(MouseEvent e) {
int mod = e.getModifiers() & 4;
if (e.getButton() == MouseEvent.BUTTON1
&& e.getClickCount() == 2) {
int index = list.getSelectedIndex();
if (but_music.getActionCommand() == "true") {
changToMusicMode();
} else {
changToMoveMode(index);
}
} else if (mod != 0) {
System.out.println("Ok");
popup_menu.add(popup_menuList);
popup_menu.show(but_music, e.getX(), e.getY());
popupList.setSelectedIndex(list.getSelectedIndex());
popup_menuList.add(popupList);
}
}
});
}
上面代码中int mod = e.getModifiers() & 4的作用是什么,什么意思啊;
getModifiers()返回此类或接口以整数编码的 Java 语言修饰符是什么意思啊?
就是前面的修饰符,像public static之类的,只不过所有的修饰符都是不冲突的数字,这样一个数字就能代表多个修饰符,例如public 是 00000001而static 是 00000010,那么合在一起就是00000011 就代表public static了
具体的含义,请参见Modifier这个类
这段代码中mod = e.getModifiers()&4的意思及作用是什么呢
这个在Modifier类里面有定义的
Java code
Code highlighting produced by Actipro CodeHighlighter (freeware)
http:
相关问答:
一个JSP页面接收其他页面提交过来的FORM表单,但是要求只接收当前站点及其子站点提交过来的FORM表单,其他站点提交过来的表单不接收,这个怎么设置?
用过滤器
filter
将当前站点及其子站点放一个目录
然 ......
我JSP的页面是:
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
为什么HTML以及一些其它标签会显示一些特定表现形式呢?如HTML中的换行标签<BR/>在底层是怎样实现的呢?现实的原理是什么呢
去W3C官方网站上,看看吧!我想一看你就明白了
我猜和编译原理有关,浏览器里可 ......
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......
如: @superwaring("unchecked");
这个里面都可以取哪些值啊,还有类似的 @superwaring标签有哪些啊
没用过。。
看jee的api
javax.persistence里
@superwaring("unchecked");只是忽略 ......