|
-
October 20th, 2009, 04:02 PM
#1
Trying to add JTextField to JTabbed Panel
I have a Tabbed panel defined at design time. It has two tabs, which are also added at design time.
What I am trying to do is add a JTextField during run time. Here is the beginning of the code that adds the JTextField.
int numFields = Integer.parseInt(jTextField2.getText());
int x = jTextField2.getX();
int y = jTextField2.getY();
fieldNames = new JTextField[numFields];
tedsLabels = new JLabel[numFields * 3];
beginBit = new JTextField[numFields];
fieldLength = new JTextField[numFields];
fieldNames[0] = new JTextField();
//fieldNames[0].setLocation(x, y + 30);
fieldNames[0].setText(" ");
jPanel3.add(fieldNames[0]);
The JTextField does not display when I run the program. Eventually this will be put into a for loop, and I want to set the location using a calculation I will work out later.
Kevin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|