Java仿千千静听音乐播放器源代码 自己收集的。
} } } } popup.show(this, e.getX(), e.getY()); selectAll.setEnabled(true); if (this.getSelectedText() != null) delete.setEnabled(true); delete.setEnabled(false); else public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { }
LTextField.java
package eb.cstop.swing;
import javax.swing.JTextField;
import java.awt.event.FocusListener;
import java.awt.event.FocusEvent;
import java.awt.event.KeyListener;
import java.awt.event.KeyEvent;
import java.awt.Color;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
import java.awt.Font;
public class LTextField extends JTextField implements MouseListener,
FocusListener, KeyListener, ActionListener { private JPopupMenu popup = new JPopupMenu(); private JMenuItem copy = new JMenuItem(" 复制 ");