I'm having trouble managing the layout of a JFrame that is a test.
How are you:
HowIwouldlikeittobe:
import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout;
public class TesteMigImagem {
public TesteMigImagem() {
JFrame frame = new JFrame();
frame.setLayout(new GridLayout(1,1));
JPanel panel = new JPanel(new MigLayout());
JPanel imagem = new JPanel();
imagem.setBackground(Color.red);
panel.add(new JLabel("Codigo"));
panel.add(new JTextField(), "width 100%, wrap");
panel.add(new JLabel("Nome"));
panel.add(new JTextField(),"split, grow x");
panel.add(imagem, "width :100:, height :100:, spany 2, wrap");
panel.add(new JLabel("Endreço"));
panel.add(new JTextField(), "grow x, split");
panel.add(new JLabel("Numero"));
panel.add(new JTextField(), "grow x");
frame.add(panel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 300);
frame.setVisible(true);
}
public static void main(String args[]) {
new TesteMigImagem();
}
}