Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to change the coordinates of JTextfield

800328Jan 11 2007 — edited Jan 15 2007
i want to change the coordinates of the jtextfield[ ] ...here is the code


import java.awt.*;
import java.applet.*;
import java.util.*;
import java.lang.Math.*;
import javax.swing.*;
import java.awt.Toolkit;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


public class tm extends JApplet implements ActionListener{
public void init()
{

Container contentPane = getContentPane();
contentPane.setLayout(new FlowLayout());
JButton loadi = new JButton("LOAD INPUT STRING");
contentPane.add(loadi);
loadi.addActionListener(this);

JButton loadp = new JButton("LOAD PROGRAM");
contentPane.add(loadp);
loadp.addActionListener(this);

JButton run = new JButton("RUN");
contentPane.add(run);
run.addActionListener(this);

JButton step = new JButton("STEP");
contentPane.add(step);
step.addActionListener(this);




JTextField[] prog = new JTextField[10];
for(int i=0;i<prog.length;i++)
{
prog= new JTextField(10);
contentPane.add(prog[i]);
}




}
public void actionPerformed(ActionEvent e)
{
}


}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2007
Added on Jan 11 2007
8 comments
498 views