Ei meu codigo…
era para aprece JLabel Jtextfield
ms, soesta aparecendo o Jlabel…
algue pod eme ajudar?
package br.com.SisConShop;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class Cliente extends JFrame implements ActionListener
{
String nome;
private static final long serialVersionUID = 1L;
public Cliente ()
{
super ("SisConShop - Cliente");
setSize( 800,600);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel painel = new JPanel();
painel.setLayout(new GridBagLayout());
GridBagConstraints pos = new GridBagConstraints();
JTextField nomeCliente = new JTextField (15);
nomeCliente.setBackground(new Color(240,230,140));
pos.gridx = 0;
pos.gridy = 0;
pos.insets = new Insets(0, 10, 10, 10);
painel.add(new JLabel("Nome"), pos);
pos.gridx = 0;
pos.gridy = 1;
pos.insets = new Insets(10, 0, 10, 10);
painel.add(nomeCliente, pos);
add(painel);
}
public static void main(String[] args)
{
new Cliente().setVisible(true);
}
}