Oi, galera...fazendo uns testes aqui com o Miglayout, a aplicação só apresenta a janela vazia.
Peguei o código no site do Mig e fiz algumas alterações. Também gostaria de saber por que a aplicação não está reconhecendo
os métodos nos trechos de código que pus comentado..
import java.util.ArrayList;
import javax.swing.*;
import net.miginfocom.swing.MigLayout;
import net.miginfocom.layout.AC;
import net.miginfocom.layout.CC;
import net.miginfocom.layout.LC;
public class FrontEnd extends JFrame{
JTabbedPane tabbedPane = new JTabbedPane();
JTable table;
JScrollPane scroll;
ArrayList registros;
private long codCliente;
JPanel panel;
public FrontEnd(){
super("CADASTRO DE CLIENTES");
setContentPane(new JPanel());
setResizable(true);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
LC layC = new LC().fill().wrap();
AC colC = new AC().align("right",0).fill(1,3).grow(100,1,3).align("right",2).gap("15",1);
AC rowC = new AC().index(6).gap("15!").align("top").grow(100,8);
panel = new JPanel(new MigLayout(layC,colC,rowC));
/* JPanel panel = createTabPanel(new MigLayout(layC,colC,rowC);*/
panel.add(new JLabel("Last Name:"));
panel.add(new JTextField());
panel.add(new JLabel("First Name:"));
panel.add(new JTextField(), new CC().wrap());
panel.add(new JLabel("Phone:"));
panel.add(new JTextField());
panel.add(new JLabel("Email:"));
panel.add(new JTextField());
panel.add(new JLabel("Address 1:"));
panel.add(new JTextField(), new CC().spanX().growX());
panel.add(new JLabel("Address 2:"));
panel.add(new JTextField(), new CC().spanX().growX());
panel.add(new JLabel("City:"));
panel.add(new JTextField(),new CC().wrap());
panel.add(new JLabel("State:"));
panel.add(new JTextField());
panel.add(new JLabel("Postal Code:"));
panel.add(new JTextField(10), new CC().spanX(2).growX(0));
panel.add(new JLabel("Country:"));
panel.add(new JTextField(),new CC().wrap());
panel.add(/*createButton("New"), new CC().spanX(5),split(5).tag("other")*/ new JButton("New"));
panel.add(/*createButton("Delete"), new CC().tag("other")*/new JButton("Delete"));
panel.add(/*createButton("Edit"), new CC().tag("other")*/new JButton("Edit"));
panel.add(/*createButton("Save"), new CC().tag("other")*/new JButton("Save"));
panel.add(/*createButton("Cancel"), new CC().tag("Cancel")*/new JButton("Cancel"));
tabbedPane.addTab("Layout showdown improved",panel);
}
public static void main(String[] args) {
new FrontEnd();
}
}
Você da setContentPane(new JPanel()) e adiciona o panel com os items no tabbedPanel, useo como ContentPane
Foi executado na 22 (?) e na 60 seria tabbedPane.add(“Layout showdown improved”,panel);
Só isso ?