The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

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.

Message:

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

http://java.sun.com/j2se/1.3/docs/api/index.html

or the using text components tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/text.html

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

best wishes

richard



Replies:

Sponsored Links



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