File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTextArea

 
Piyush Walia
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyone who has good understanding of JTextArea
 
Kriti Garg
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic