copy paste « Development « Java Swing Q&A





1. GUI builder bug with copy paste and fonts    forums.netbeans.org

NetBeans 6.8 using the GUI builder: I click on an object I have created (a jLabel for this example). Its properties->font is set to: SansSerif 12 Bold. Now I ctrl-c and ...

2. Creating cut, copy, and paste capabilities with Java Swing TransferHandler    forums.netbeans.org

I don't know how you would go about enabling cut, copy and paste on a Java Netbeans GUI. I know it uses the TransferHandler class but is there a way to do this through Netbeans without editing the GUI code?

3. cut copy paste    coderanch.com

4. how to do copy/paste using swing    coderanch.com

Here is an example: import java.awt.*; import java.awt.event.*; import com.sun.java.swing.*; import java.awt.datatransfer.*; import java.io.IOException; public class ClipIt { public static void main (String args[]) { final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); JFrame f = new JFrame ("Clip It"); f.addWindowListener (new WindowAdapter() { public void windowClosing (WindowEvent e) { System.exit (0); } }); Container c = f.getContentPane(); final JTextArea jt = new JTextArea(); ...

5. Cut,Copy,Paste    coderanch.com

The following is an example of how to copy and paste... import java.awt.*; import java.awt.datatransfer.*; import java.awt.event.*; /** * This program demonstrates how to add string cut-and-paste capabilities * to an application. **/ public class StringCutAndPaste extends Frame implements ActionListener { /** * The main method creates a frame, arranges to handle its closing, * packs it and pops it up. ...

6. Clipboard/Tokenizer -- copy and paste problem    coderanch.com

Hello. I have a jtable that has the capacity for copy and paste to an excel spreadsheet -- using a clipboard etc. My problem is 1) when pasting to the jtable from excel, the StringTokenizer skips any blank new line. For e.g. : in excel i copy these (1 column 3 rows) 545646 545648 The result after pasting ...

7. Copy and paste java objects using System clipboard    coderanch.com

hi I want to copy paste java objects between java applications using the system clipboard.So far only string transfer is supported between java programs and system clipboard. One way to transfer java objects is to encode them as string and put into the system clipboard, then retrieving the string from the system clipboard and decoding them to the respective object. Ofcourse ...

8. copy 'n paste    coderanch.com

9. Cut,copy and paste    coderanch.com

Is this a SWING app? I think you might be approaching with too much complexity. All the Text classes in SWING have a cut(), copy(), and paste() method. I usually build a ContextMenu (JPopupMenu) and when I right click on the highlighted text, that menu pops up and on the appropriate menu item, all you have to do is call one ...





10. copy/paste    coderanch.com

11. special chars generated during paste/copy    coderanch.com

I am trying to get paste/copy events in a JTextField when user uses CTRL-V or CTRL-C to paste or copy texts. The strange thing is, every time I use ctrl-v, ctrl-c, or ctrl-x to paste/copy/cut, there is always a special character (like a small square, or rectangle?) showing up at the end. I have to use jdk1.4.1 since I am working ...

12. copy paste problem with clipboard data    coderanch.com

13. GUI: Cut/Copy/Paste/Etc.    coderanch.com

*smacks himself* Yes, I guess telling you what is really wrong would help. Sorry, I was a bit sleepy. Anywhere, first off, here is my entire code... import java.awt.*; import javax.swing.*; import java.awt.event.*; import javax.swing.event.*; import java.io.*; //GUI TEXT WRITER public class SimplePad extends JFrame { //DECLARE VARIABLES String m_file; JTextArea m_textArea; JScrollPane m_scroller; BufferedReader m_fileReader; JLabel m_statusBar = new JLabel("Welcome ...

14. Regarding Copy and paste operation    coderanch.com

15. java copy paste cut and undo functions    java-forums.org

How to Write a Mouse Listener (The Java Tutorials > Creating a GUI with JFC/Swing > Writing Event Listeners) Copy and Paste is as simple as a acessing the clipboard: Java Tip 61: Cut, copy, and paste in Java - Java World Undo depends on the kind of action that you want to undo. Do you mean the text that was ...

16. Motif LookandFeel does not support copy paste    forums.oracle.com

You where given the answer to this question over a year ago. [http://forums.sun.com/thread.jspa?threadID=5267663&start=4] I know the question is not the same, but the solution is the same. Since you still haven't learned to post in the proper forum, I'll let you figure out the details on your own. Although I will say that I have provided a link to my blog ...