Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
CounterItem.java
Package: J2ME&Game.rar [view]
Upload User: gyyuli
Upload Date: 2013-07-09
Package Size: 3050k
Code Size: 2k
Category:
J2ME
Development Platform:
Java
- import javax.microedition.lcdui.*;
- // A custom component for MIDP 2.0 that wraps
- // a CounterArea instance.
- public class CounterItem extends CustomItem
- implements CounterArea.Callback {
- public CounterItem(){
- super( null );
- _area = new CounterArea();
- _area.setCallback( this );
- }
- public Font getFont(){
- return _area.getFont();
- }
- public int getMinContentHeight(){
- return _area.getMinHeight();
- }
- public int getMinContentWidth(){
- return _area.getMinWidth();
- }
- public int getPrefContentHeight( int width ){
- return getMinContentHeight();
- }
- public int getPrefContentWidth( int height ){
- return getMinContentWidth();
- }
- public int getValue(){
- return _area.getValue();
- }
- protected void hideNotify(){
- _area.stop();
- }
- public void invalidateCounter( CounterArea counter ){
- if( counter == _area ){
- invalidate();
- }
- }
- protected void paint( Graphics g, int width, int height ){
- _area.paint( g );
- }
- public void repaintCounter( CounterArea counter ){
- if( counter == _area ){
- repaint();
- }
- }
- public void resizeCounter( CounterArea counter ){
- if( counter == _area ){
- invalidate();
- }
- }
- protected void sizeChanged( int w, int h ){
- _area.setWidth( w );
- _area.setHeight( h );
- }
- public void setFont( Font f ){
- _area.setFont( f );
- }
- public void setValue( int value ){
- _area.setValue( value );
- }
- protected void showNotify(){
- _area.start();
- }
- public boolean traverse( int dir, int vw, int vh,
- int[] vrect ){
- return false;
- }
- private CounterArea _area;
- }