Im making a simple java swing program but i'm having trouble with the size and positions of my components. I have three Jlabels and three JtextFields. The jlabels are overlapping so only the last one i add is showing. The textfields are showing up very small.(almost look like lines.) Also, everything appears on one line and i would like each component on its own line.
CODE:
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class setCustoms {
static JPanel panel = new JPanel();
static JFrame frame2 = new JFrame("Settings");
public static void makeWindow(){
frame2.setVisible(true);
frame2.add(panel);
frame2.setBounds(500, 300, 500, 200);
JLabel app1l = new JLabel("");
JLabel app2l = new JLabel("");
JLabel app3l = new JLabel("");
JLabel site1l = new JLabel("");
JLabel site2l = new JLabel("");
JLabel site3l = new JLabel("");
panel.add(app1l);
app1l.setText("Set Application ONE name and path");
JTextField app1t = new JTextField();
app1t.setBounds(100, 100, 100, 25);
app1t.addActionListener(new Action());
panel.add(app1t);
panel.add(app2l);
app1l.setText("Set Application TWO name and path");
JTextField app2t = new JTextField();
app2t.addActionListener(new Action());
panel.add(app2t);
panel.add(app3l);
app1l.setText("Set Application THREE name and path");
JTextField app3t = new JTextField();
app3t.addActionListener(new Action());
panel.add(app3t);
}
static class Action implements ActionListener{
public void actionPerformed (ActionEvent e){
}
}
}
EDIT: althoguh i do have code to set bounds for certain items, it does not work