Bom dia, estou usand o gridLayout e ocorre o seguinte “erro”
Porém o campo o panel (com o texto excrito ip) e o de inserção de ip ficam desalinhado
IP: .___.___.
segue o código [code]TitledBorder border;
border = BorderFactory.createTitledBorder(parent.langpack.getString(“ipPanel.infoPanel”));
JPanel painel = new JPanel(new GridLayout(1, 2));
GridBagLayout novoLayout = new GridBagLayout();
GridBagConstraints novaConstraints = new GridBagConstraints();
String txt = parent.langpack.getString("IP: ");
painel.setBorder(border);
lblIp = new JLabel(txt);
novaConstraints.gridx = col;
novaConstraints.gridy = line;
novaConstraints.gridwidth = 0;
novaConstraints.gridheight = 0;
novaConstraints.fill = GridBagConstraints.HORIZONTAL;
novoLayout.addLayoutComponent(lblIp, novaConstraints);
painel.add(lblIp);
this.ipv6 = new JIpAddressV6();
novaConstraints.gridx = col+1;
novaConstraints.gridy = line;
novaConstraints.gridwidth = 0;
novaConstraints.gridheight = 0;
novaConstraints.fill = GridBagConstraints.HORIZONTAL;
novoLayout.addLayoutComponent(ipv6, novaConstraints);
painel.add(ipv6);
constraints.gridx = col;
constraints.gridy = line + 9;
constraints.gridwidth = 1;
constraints.gridheight = 1;
constraints.fill = GridBagConstraints.HORIZONTAL;
layout.addLayoutComponent(painel, constraints);
add(painel);[/code]
todos os objetos estão instanciados e é usando o izPack, por isso há chamada de dados de xml