⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mp3abstractaction.java

📁 自己用Java写的一个mp3文件改名的小工具
💻 JAVA
字号:
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import java.net.URL;

import javax.swing.event.EventListenerList;

/**
 *  Description of the Class
 *
 * @author     kilo
 * @created    2003年12月22日
 */
public abstract class mp3AbstractAction
		 extends AbstractAction {

	/**
	 *  Description of the Field
	 */
	private EventListenerList listeners;


	/**
	 *  Gets the actionCommand attribute of the mp3AbstractAction object
	 *
	 * @return    The actionCommand value
	 */
	public final String getActionCommand() {
		return (String)getValue( Action.ACTION_COMMAND_KEY );
	}


	/**
	 *  Gets the shortDescription attribute of the mp3AbstractAction object
	 *
	 * @return    The shortDescription value
	 */
	public final String getShortDescription() {
		return (String)getValue( Action.SHORT_DESCRIPTION );
	}


	/**
	 *  Gets the longDescription attribute of the mp3AbstractAction object
	 *
	 * @return    The longDescription value
	 */
	public final String getLongDescription() {
		return (String)getValue( Action.LONG_DESCRIPTION );
	}


	/**
	 *  Description of the Method
	 *
	 * @param  evt  Description of the Parameter
	 */
	public final void actionPerformed( ActionEvent evt ) {
		if ( listeners != null ) {
		Object[] listenerList = listeners.getListenerList();

		ActionEvent e = new ActionEvent( evt.getSource(), evt.getID(),
					(String)getValue(
					Action.ACTION_COMMAND_KEY ) );
			for ( int i = 0; i <= listenerList.length - 2; i += 2 )
				( (ActionListener)listenerList[i + 1] ).actionPerformed( e );

		}
	}


	/**
	 *  Adds a feature to the ActionListener attribute of the mp3AbstractAction
	 *  object
	 *
	 * @param  l  The feature to be added to the ActionListener attribute
	 */
	public final void addActionListener( ActionListener l ) {
		if ( listeners == null )
			listeners = new EventListenerList();

		listeners.add( ActionListener.class, l );
	}


	/**
	 *  Description of the Method
	 *
	 * @param  l  Description of the Parameter
	 */
	public final void removeActionListener( ActionListener l ) {
		if ( listeners == null )
			return;
		listeners.remove( ActionListener.class, l );
	}


	/**
	 *  Gets the icon attribute of the mp3AbstractAction object
	 *
	 * @param  name  Description of the Parameter
	 * @return       The icon value
	 */
	public final ImageIcon getIcon( String name ) {
		if ( name != null ) {
		URL url = this.getClass().getResource( name );
			if ( url != null )
				return new ImageIcon( url );
		}
		return null;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -