当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: Listeners Listeners are how any
 

 

 ·jboss3.0 下配置和部署ejb简介    »显示摘要«
    摘要:jboss3.0 下配置和部署ejb简介 (by huihoo.org 赵晨希,zhaochenxi@vip.sina.com) 1.jboss简介 jboss是一个运行ejb的j2ee应用服务器。它是开放源代码的项目,遵循最新的j2ee规范。从jboss项目开始至今,它已经从一个ejb容器发展成为一个基于的j2ee的一个web 操作系统(operating system for web),......
    摘要: 第二节:定制datagrid的外观 上一篇文章中,我初步感受到了datagrid给我带来的便利,但是,如果是我们自己编写程序画的表格的话,我们能够很灵活的控制表格的表现形式,所以,datagrid能不能定制它的表现形式。答案,我知道肯定是可以的,关键是它是否比我自己用代码“画”要来得快。 根据以往的经验,我知道,从datagrid的属性中就可以完成这些操作。 ......


something about Listeners

listeners

【程序编程相关:我,一个C++程序员,面试遇到常考问题总

【推荐阅读:管理寓言:驴子之死

event listeners are functions you define that will be called when events happen. the jfc/swing core tells each component - like jbuttons and jmenus - when an event they would be interested in occurs. this is how jbuttons know to make themselves look "clicked". you can also ask a jbutton to tell you when it gets clicked by registering an event listener with it. if you were to write java code with emacs, there would be 3 steps involved in registering an event listener with a jbutton: 【扩展信息:如何为指定用户或计算机设置域策略

listeners are how anything gets done in swing. clicking on stuff causes events. events are sort of like little messages that get sent around inside your program. if you want, you can watch all these messages and try to filter out the ones you want. that would be a colossal waste of time, on top of being really, really inefficient. there are better ways to do things. namely, event listeners.

1 - define the listener:

there are different kinds of events, so there are different kinds of listeners. jbutton generates an actionevent when it is clicked, so we create a class that implements the actionlistener interface...

class anactionlistener implements actionlistener{

    public void actionperformed(actionevent actionevent){

          system.out.println("i was selected.");

    }

}

2 - create an instance of the listener

ok, this is pretty simple...

actionlistener actionlistener = new anactionlistener();

3 - register the listener with a component

start out by pretending you already have a jbutton and you want that listener function we wrote in step 1 to get called when j. random user clicks on it. you do this by registering it with the jbutton. essentially you ask the jbutton to add it to the list of functions it calls when it decides to generates an actionevent, like so...

jbutton button = new jbutton();

... // other code

button.addactionlistener(actionlistener);

visual age to the rescue!


...   下一页
 ·sql注入的新技巧    »显示摘要«
    摘要: sql注入的新技巧 来源:黑客基地 表名和字段名的获得 适用情况: 1)数据库是mssql 2)连接数据库的只是普通用户 3)不知道asp源代码 可以进行的攻击 1)对数据内容进行添加,查看,更改 实例: 本文件以 http://www.dy***.com/user/wantpws.asp 为列进行测试攻击。 第一步: 在输入用户名处输入单引号,显示 microsoft ole db provi......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE