Solved

multiple lines of text

Posted on 2004-04-17
6
287 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
commonTwo  challenge 63 98
topping3 challenge 14 49
Free Alternative to JIRA 4 55
GUI builder for Eclipse? 8 8
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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 about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

708 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

16 Experts available now in Live!

Get 1:1 Help Now