How do i create textboxes at runtime on a UI?

I have a UI canvas, with a panel as a child.

I’d like to create lots of Text objects at runtime as children/components/whatever of that panel. AddComponent doesn’t seem to work though. What function am i looking for to create them?

I think i’ve figured it out. i used new GameObject() and then added the text component to that.

However i have another problem: How do i position this text to go where i want? - Unity Answers