Click here to Skip to main content
15,905,071 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,

It seems like my JTextArea is not working whenever I try to setPosition, can anyone tell me why?

here is my code:

super("paySlipCalculator MOFO!");
setLayout(new FlowLayout());


calculate = new JTextArea(5,5);
calculate.setVisible(true);
calculate.setLineWrap (true);
add(calculate);

based on what I know the setLayout will takecare of all the positioning of may objects and by default it's in left to right until it hit the end of the right side of the window, How can I exclude this my calculate JTextArea so I can freely move it around?

Thanks,
Posted

C#
calculate = new JTextArea(5,5);
//calculate.setBounds(x,y,width,height); /*x,y,width,height are integer Values*/
calculate.setBounds(10,10,200,60);
calculate.setVisible(true);
calculate.setLineWrap (true);
add(calculate);
 
Share this answer
 
v2
Comments
KatsuneShinsengumi 5-Oct-13 10:35am    
Hey man thanks,

I found the way, and amazed that your answer is the same, though I set the setLayout to null because the Layout manager is getting in the way.
Hey guys thanks,

I found it, I set the setLayout to null and manually direct the size and position of all the objects(im not sure if this is the right term in java please correct me if i'm wrong). Thanks everyone.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900