* Principal.java
*
* Created on 4 de mayo de 2008, 09:10 AM
*/
package prymenu;
/**
*
* @author Administrador
*/
public class Principal extends javax.swing.JFrame {
static String txt_nombre="";
VenUsuario venUsuario=new VenUsuario();
VenProducto venProducto=new VenProducto();
/** Creates new form Principal */
public Principal(String nom) {
initComponents();
txt_nombre=nom;
setTitle("Sistema Usuario - Bienvenido : "+txt_nombre);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
//
private void initComponents() {
jDesktopPane1 = new javax.swing.JDesktopPane();
Menu = new javax.swing.JMenuBar();
mTabla = new javax.swing.JMenu();
mtUsuario = new javax.swing.JMenuItem();
mtProducto = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
mTabla.setText("Tabla");
mtUsuario.setText("Usuario");
mtUsuario.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
mtUsuarioActionPerformed(evt);
}
});
mTabla.add(mtUsuario);
mtProducto.setText("Producto");
mtProducto.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
mtProductoActionPerformed(evt);
}
});
mTabla.add(mtProducto);
Menu.add(mTabla);
jMenu2.setText("Edit");
Menu.add(jMenu2);
setJMenuBar(Menu);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDesktopPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
);
pack();
}//
private void mtProductoActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(venProducto.isVisible()){
venProducto.moveToFront();
}else{
jDesktopPane1.add(venProducto);
venProducto.setVisible(true);
venProducto.moveToFront();
}
}
private void mtUsuarioActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(venUsuario.isVisible()){
venUsuario.moveToFront();
}else{
jDesktopPane1.add(venUsuario);
venUsuario.setVisible(true);
venUsuario.moveToFront();
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Principal("").setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JMenuBar Menu;
private javax.swing.JDesktopPane jDesktopPane1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu mTabla;
private javax.swing.JMenuItem mtProducto;
private javax.swing.JMenuItem mtUsuario;
// End of variables declaration
}
No hay comentarios:
Publicar un comentario