• Post Reply Bookmark Topic Watch Topic
  • New Topic

Paragraphs in a jFrame  RSS feed

 
Gord Kerr
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if I am using the correct terminology here, so please bear with me.  I am super new at this.
I have set a string to be a paragraph.  Is it possible to show the contents of that string in a jFrame just by calling the string name?

Thanks
 
Carey Brown
Saloon Keeper
Posts: 3329
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A String has no concept of being a "paragraph", so I'm not sure what you mean here.

Swing has a component JTextArea() which can display multiple lines of text. It has parameters you can set to tell it how you'd like to see the text displayed, e.g. with/without word wrapping. A JTextArea object is often contained in a JScrollPane in order to handle the display of more lines of text than can be shown in your allocated area.
 
Paul Clapham
Sheriff
Posts: 22844
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gord Kerr wrote:Is it possible to show the contents of that string in a jFrame just by calling the string name?


Welcome to the Ranch, Gord!

As well as what Carey said, a String doesn't have a name. And if it did you wouldn't be able to call it, because the only thing you can call in Java is a method.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!