is there a way to position the jtextarea on the content pane in a certain location ?
JTextArea position
Collapse
X
-
-
You could remove the LayoutManager and position (and size) the component yourself; but I wouldn't do it if I were you: LayoutManagers are much better at that.
Have you taken a look at a JDesktopPane?
kind regards,
Jos -
JTextarea position
I think this coding may help you...
[code=java]
import javax.swing.*;
import java.awt.*;
public class trial extends JFrame
{
JTextArea txtarea;
JDesktopPane desk;
public trial(String title) // Constructor
{
super(title);
setDefaultClose Operation(EXIT_ ON_CLOSE);
desk=new JDesktopPane();
setContentPane( desk);
txtarea=new JTextArea();
txtarea.setBoun ds(150,150,250, 100);
desk.add(txtare a);
}
public static void main(String args[])
{
trial t=new trial("TextArea position");
t.setSize(500,5 00);
t.setVisible(tr ue);
}
}
[/code]
Regards,
Viji nellaiappanComment
Comment