Hi everybody,
Here it is my question. I have a JPanel inside which there are two things: a JLabel and a JTextField.
I want that the JLabel is placed just as close as posible to the left side of the JPanel, and the JTextField just after it.
So, something like:
|JLabel(default space in a FlowLayout() between components)JTextField |
representing the vertical lines the horizontal limits of the JPanel.
Here it is the code that I have tried but it did not work:
panel = new JPanel();
panel.setLayout(new FlowLayout());
JLabel label = new JLabel("xxx");
label.setAlignmentY(0.0f);
panel.add(label);
panelRM.add(jTextFieldName);
//being jTextFieldName the JTextField I talked about above. It is created in the constructor.
I have tried also "label.setAlignmentX(0.0f)" because actually I did not know whether I had to use setAlignmentX or setAlignmentY... but it did not work either.
Thanks to everybody!
Fran.