• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

multiple lines of text

hi
I have a textarea and I want to display multiple lines of text. I just need to display it and will even disable the abbility to edit it.
is there a simple way to do this
please include examples
thanks
0
Samooramad
Asked:
Samooramad
2 Solutions
 
CEHJCommented:
'I refer you to the answer i gave earlier' as they say over here in the Houses of Parliament:

>>Just use a JTextArea and setEditable(false)
0
 
objectsCommented:
import javax.swing.*;

public class DisplayText
{
   public static void main(String[] args)
   {
      JFrame f = new JFrame();
      JTextArea ta = new JTextArea("first line\nsecond line\nthird line");
      ta.setEditable(false);
      f.getContentPane().add(new JScrollPane(ta));
      f.pack();
      f.show();
   }
}
0
 
GrandSchtroumpfCommented:
There is also the setEnabled(false).
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
SamooramadAuthor Commented:
thanks guys :)
0
 
CEHJCommented:
8-)
0
 
objectsCommented:
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now