File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes how to copy code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to copy code" Watch "how to copy code" New topic

how to copy code

dark vader

Joined: Dec 30, 2004
Posts: 1
I am a beginner and am interested in trying the code in many examples,but when I copy and then paste to 'TextPad' the code looses all formating. Can anyone suggest how I paste to my test editer so that I don't loose the Java formatting?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
if you are talking about the many examples posted here (and other forums):
copy/paste the text into word first, then copy/paste from word to your editor
use mozilla as your browser - it preserves the formatting
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
Welcome to JavaRanch, Dark! Please adjust your display name to meet the JavaRanch Naming Policy.
You can change it here.


I have run into this problem mostly when I'm copying code from an html page. To copy code (from a forum here), you can click on the quote marks and copy the code. Just remember to hit the back button when you're done copying the code. To copy code from another web page, you can click on "View" "Page Source".

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: how to copy code
It's not a secret anymore!