如题,swing中JTextArea继承JTextComponent,
JTextComponent自带的copy()和paste()实现了键盘中的ctrl+C和 ctrl+V的功能,
我现在想把这个功能给禁掉,如何实现?
------解决方案--------------------
继承JTextArea类,然后重写copy paste cut方法
给个例子,这里为了方便使用匿名类
		JTextArea text = new JTextArea() {
			@Override
			public void copy() {
				System.out.println("Copy");
			}
			@Override
			public void paste() {
				System.out.println("Paste");
			}
			@Override
			public void cut() {
				System.out.println("Cut");
			}
		};
		
		JFrame frame = new JFrame("Test");
		frame.setSize(600, 400);
		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		frame.setLocationRelativeTo(null);
		
		frame.add(text);
		
		frame.setVisible(true);