Joined
·
256 Posts
Hi,
I am making a JAVA applet.
At the minute i have a text field, button and another text field all next to each other on the same row. This is fine.
But i also want to add another label, but i want this to be positioned underneath the first text field.
When i put it in it just goes next to the last text field.
Here is the code where i have made them all and added them to the applet, there is also comments to show you what i mean:
public void init()
}
//First text field
srchBar = new TextField(20);
add(srchBar);
srchBar.addActionListener(this);
//Button
info = new Button("Information");
add(info);
info.addActionListener(this);
//Second text field
feedback = new TextField(20);
add(feedback);
feedback.addActionListener(this);
// Label i want positioned under first text field
srchTerm = new Label("");
add(srchTerm);
}
I have to use AWT labels and cannot use Jlabels.
How do i do this?
I am making a JAVA applet.
At the minute i have a text field, button and another text field all next to each other on the same row. This is fine.
But i also want to add another label, but i want this to be positioned underneath the first text field.
When i put it in it just goes next to the last text field.
Here is the code where i have made them all and added them to the applet, there is also comments to show you what i mean:
public void init()
}
//First text field
srchBar = new TextField(20);
add(srchBar);
srchBar.addActionListener(this);
//Button
info = new Button("Information");
add(info);
info.addActionListener(this);
//Second text field
feedback = new TextField(20);
add(feedback);
feedback.addActionListener(this);
// Label i want positioned under first text field
srchTerm = new Label("");
add(srchTerm);
}
I have to use AWT labels and cannot use Jlabels.
How do i do this?