The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


I remember Pascal

Posted by richard on January 27, 2001 at 9:31 PM

Seems to me that you are thinking old-style procedural rather than new style OOP. These methods come from the crt unit of Pascal and are used with a text based screen I suppose?

In Java everything takes place in a window, either of the Applet or of a Frame object. Typically you add GUI objects to these surfaces. Text-based objects you can add include TextFields and TextAreas. Each of these objects have their own methods for manipulating and selecting text. To clear a TextArea for example you could use myTextArea.setText(""). As to moving to selected locations within the TextArea, as far as I know there is no goToXY() method. However, if you have the Swing package the newer JTextArea has methods for finding out how many lines and columns there are in text. The JTextPane also provides formatting functions. An excellent place to look for further help is the Sun documentation site at

or the using text components tutorial:

Keep on using Java and you will get into a different way of thinking as I did myself.

best wishes



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us