My problem is that I want to create a graphical interface with vertical insert fields, but I can only create it horizontally.
Code:
JTextField mapField = new JTextField(5);
JTextField tamField = new JTextField(5);
JTextField wordField = new JTextField(5);
JTextField politicaField = new JTextField(5);
JTextField numViasField = new JTextField(5);
JPanel myPanel = new JPanel();
myPanel.add(new JLabel("Mapeamento:"));
myPanel.add(mapField);
myPanel.add(Box.createVerticalStrut(15)); // a spacer
myPanel.add(new JLabel("Tamanho da Cache:"));
myPanel.add(tamField);
myPanel.add(Box.createVerticalStrut(15)); // a spacer
myPanel.add(new JLabel("Wors por bloco:"));
myPanel.add(wordField);
myPanel.add(Box.createVerticalStrut(15)); // a spacer
myPanel.add(new JLabel("Politica de substituição:"));
myPanel.add(politicaField);
myPanel.add(Box.createVerticalStrut(15)); // a spacer
myPanel.add(new JLabel("Numero de vias:"));
myPanel.add(numViasField);