Implementación de interfaz en java
importar java.awt.BorderLayout;
importar java.awt.Container
importar java.awt.Font; java.awt.GridLayout;
importar javax.swing.*;
la clase pública MyFrame extiende JFrame{
JLabel lblT1 =null, lblT2=null, lblT3 =null, lblT4=null, lblT5=null;
JLabel lblC1=null, lblC2= null, lblC3=null, lblC4=null, lblC5=null;
JButton btnOk=null , btnDel=null, btnLogout=null;
Container c=null
public MyFrame(){
lblT1 = new JLabel("Entrada de información del producto" );
lblT1.setFont(new Font("",Font.BOLD,18));
lblT2 = new JLabel("Nombre del producto");
lblT3 = nuevo JLabel("peso");
lblT4 = nuevo JLabel("precio");
lblT5 = nuevo JLabel("frecuencia");
lblC1 = nuevo JLabel("Bangbang");
lblC2 = nuevo JLabel("100");
lblC3 = nuevo JLabel("300");
p>lblC4 = new JLabel("中");
btnOk = new JButton("OK");
btnDel = new JButton("Eliminar");
btnLogout = new JButton("Cerrar sesión");
JPanel p1 = nuevo JPanel()
p1.add(lblT1);
JPanel p2 = nuevo JPanel();
p2.setLayout(new GridLayout(4, 2));
p2.add(lblT2); p > p2.add(lblC1);
p2.add(lblT3
p2.add(lblC2);
p2.add(lblT4);
p2.add(lblC3);
p2.add(lblT5
p2.add(lblC4); JPanel p3 = nuevo JPanel();
p3.add(btnOk);
p3.add(btnDel);
p3.add(btnLogout);
c = this.getContentPane();
<p> c.add(p1, BorderLayout.NORTE);
c.add(p2);
c.add(p3, BorderLayout.SUR); p> this.setSize(400, 400);
}
public static void main(String [] args){
MyFrame frame = new MyFrame(
frame.setVisible(verdadero
}
}
);