Java仿千千静听音乐播放器源代码 自己收集的。
private JMenuItem cut = new JMenuItem(" 剪切 "); private JMenuItem paste = new JMenuItem(" 粘贴 "); private JMenuItem selectAll = new JMenuItem(" 全选 "); private JMenuItem delete = new JMenuItem(" 删除 "); private Font font = new Font("宋体", 0, 12); public LTextField() { } public LTextField(int column) { } public LTextField(int column, String text) { } public LTextField(String text) { } public void focusGained(FocusEvent e) { this.setText(text); this.addFocusListener(this); this.addKeyListener(this); this.setSelectionColor(new Color(0, 80, 140)); this.setSelectedTextColor(Color.white); this.addMouseListener(this); copy.setFont(font); cut.setFont(font); paste.setFont(font); selectAll.setFont(font); delete.setFont(font); copy.addActionListener(this); cut.addActionListener(this); paste.addActionListener(this); selectAll.addActionListener(this); delete.addActionListener(this); popup.add(cut); popup.add(copy); popup.add(paste); popup.add(delete); popup.addSeparator(); popup.add(selectAll); this(text); this.setColumns(column); this(column, ""); this("");