Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/07/2011, 22:51
Avatar de kannonnr
kannonnr
 
Fecha de Ingreso: junio-2011
Ubicación: Pasto
Mensajes: 39
Antigüedad: 12 años, 9 meses
Puntos: 1
Pregunta Alguien que me ayude con este codigo de pestañaspara java

Hola a todos

La idea es mostrar las pestañas en el panel "p2", pero no se porque no se muestran, igual al compilar no me sale ningún error ni nada, gracias por su ayuda




import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class Biblioteca extends JFrame implements ActionListener
{
JPanel p1=new JPanel(null);
JPanel p2=new JPanel(null);
JPanel p3=new JPanel(null);

JPanel pes1=new JPanel(null);
JPanel pes2=new JPanel(null);

Color c1=new Color(165,196,145);

JTabbedPane pest =new JTabbedPane();

JLabel l1=new JLabel(new ImageIcon("banner1.gif"));
JScrollPane j1= new JScrollPane(l1);

public Biblioteca()
{
setTitle("::::Biblioteca I.E. ITA Candelilla::::");
setSize(615,350);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setResizable(false);
setContentPane(p3);

pes1.setBackground(c1);
pes2.setBackground(c1);

p1.setBounds(0,0,610,90);
p1.add(j1);j1.setBounds(0,0,610,90);

pest.addTab("Buscar", null, pes1, "Primer panel");
pest.addTab("Devolucion", null, pes2, "segundo panel");

p2.setBounds(0,100,610,350);
p2.add(pest);


p3.add(p2); p3.add(p1);
}

public void actionPerformed(ActionEvent e){

}

public static void main(String[] args){

JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
Biblioteca c1=new Biblioteca();
c1.setVisible(true);
}

}
__________________
Bosatzu Kannon
Keep Moving Forward