Solved

multiple lines of text

Posted on 2004-04-17
6
296 Views
Last Modified: 2010-03-31
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
Comment
Question by:Samooramad
6 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 100 total points
ID: 10850838
'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
 
LVL 92

Accepted Solution

by:
objects earned 150 total points
ID: 10851063
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
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 10851145
There is also the setEnabled(false).
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Samooramad
ID: 10863387
thanks guys :)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10863469
8-)
0
 
LVL 92

Expert Comment

by:objects
ID: 10864353
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Systems talking to each other 5 126
Java array passed to SQL where clause 23 64
Problem to start Neon 20 88
why cannot we forward request once the response is committed 2 33
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now