This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextArea " Watch "JTextArea " New topic
Author

JTextArea

Piyush Walia
Greenhorn

Joined: Apr 16, 2004
Posts: 8
I am creating a simple JTextArea but i want that when ever it is displayed for
Editing it should look like this:

-------------------------------------------------------------

TEXT SHOULD BE ALLOW EDITING
ONLY BETWEEN THE DOTTED LINES.


-------------------------------------------------------------
Piyush Walia
Greenhorn

Joined: Apr 16, 2004
Posts: 8
Is there anyone who has good understanding of JTextArea
Kriti Garg
Ranch Hand

Joined: Sep 13, 2004
Posts: 50
Hi,

is there any specific reason to use texArea alone for this,

i mean u can concatenate two JLables one above and one below textArea

Kriti
Kriti Garg
Ranch Hand

Joined: Sep 13, 2004
Posts: 50
Like This....

......Code.........


package abc;

import javax.swing.*;
import java.awt.*;


public class TextTry extends JFrame{
JTextArea textArea=new JTextArea();
JLabel label=new JLabel();
JLabel label1=new JLabel();
public TextTry() {

label.setText("...................................");
textArea.setText("Text Editing Only allowed here");
label1.setText("...................................");

Box box=Box.createVerticalBox();
box.add(label);
box.add(Box.createVerticalStrut(15));
box.add(textArea);
box.add(Box.createVerticalStrut(15));
box.add(label1);


this.getContentPane().setBackground(Color.WHITE);
this.getContentPane().add(box);
this.setSize(new Dimension(250,250));
this.setVisible(true);

}
public static void main(String args[]){
TextTry textTry=new TextTry();
}

}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTextArea