File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Copy/paste issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Copy/paste issues" Watch "Copy/paste issues" New topic
Author

Copy/paste issues

Charles Angemeyer
Greenhorn

Joined: Dec 18, 2012
Posts: 22
In learning java I'll sometimes (not often) copy code from a web page and paste it into Eclipse so I can test it out.
For example I wanted to copy the code I found here:
http://www.javaworld.com/community/node/8339

In order to test out inner classes and improve my understanding of that feature.
When I copy the code and go to paste it, instead of breaking it apart, line by line, it gives me one very long line.
Is there a way to keep this from happening?
Many thanks.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31062
    
232

It works for me copying from Safari into TextEdit on a Mac. What are you copying from/into?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

It is probably a side effect of either your browser on the way you are copying (example selecting bits of HTML that confuses the IDE). You can try CTRL+SHIFT+F in Eclipse to let it format the code for you. Should prevent the need to worry about the copy/paste problem.


Steve
Charles Angemeyer
Greenhorn

Joined: Dec 18, 2012
Posts: 22
Ctrl-Shift-F worked great. Thank you very much.
(I'm using a Windows machine).
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
It should work the same on a *nix machine or a Mac.
I think this discussion would fit better in our IDEs forum: moving.
 
 
subject: Copy/paste issues