Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Camilo Carrasco
Instituto IACC
11/10/2021
Desarrollo
modulo 3: home
jefe proyecto
sistema módulos
sistema componentes
sistema integración
En este modulo numero 3 creamos la interacción que tendrá el jefe de proyecto al momento de
ingresar con sus credenciales, en este caso hemos dado dos opciones al jefe de proyecto, la de
VISTA HOME
/*
*/
package vista;
import java.io.File;
import javax.swing.JFileChooser;
/**
* @author camil
*/
/**
public home() {
initComponents();
/**
* 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
*/
@SuppressWarnings("unchecked")
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("HOME");
jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
btnCrearPro.setText("Crear Proyecto");
btnCrearPro.addActionListener(new java.awt.event.ActionListener() {
btnCrearProActionPerformed(evt);
});
btnAbrirPro.setText("Abrir Proyecto");
btnAbrirPro.addActionListener(new java.awt.event.ActionListener() {
btnAbrirProActionPerformed(evt);
});
BtnSalirHome.setText("Salir");
BtnSalirHome.addActionListener(new java.awt.event.ActionListener() {
BtnSalirHomeActionPerformed(evt);
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(btnAbrirPro)
.addComponent(btnCrearPro))))
.addContainerGap(202, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(BtnSalirHome)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addComponent(btnCrearPro)
.addComponent(btnAbrirPro)
.addComponent(BtnSalirHome)
.addContainerGap(39, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
if(frmCreaPro == null){
frmCreaPro = new crearProyecto();
frmCreaPro.setVisible(true);
jf.showOpenDialog(this);
if(archivo != null ){
System.exit(0);
/**
*/
public static void main(String args[]) {
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
*/
try {
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
null, ex);
java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
new home().setVisible(true);
});
VISTA CREARPROYECTO
/*
*/
package vista;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
/**
* @author camil
*/
FileInputStream entrada;
FileOutputStream salida;
/**
*/
public crearProyecto() {
initComponents();
String documento="";
try{
int ascci;
while ((ascci=entrada.read())!=-1){
documento +=caracter;
}
return documento;
String mensaje=null;
try{
byte[]bytxt=documento.getBytes();
salida.write(bytxt);
}catch(Exception e){
return mensaje ;
/**
* 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
*/
@SuppressWarnings("unchecked")
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton1.setText("Guardar");
jButton1.addActionListener(new java.awt.event.ActionListener() {
});
jButton2.setText("Salir");
jButton2.addActionListener(new java.awt.event.ActionListener() {
jButton2ActionPerformed(evt);
});
txtnamePro.addActionListener(new java.awt.event.ActionListener() {
txtnameProActionPerformed(evt);
});
jCheckBox1.setText("Analistas");
jCheckBox2.setText("Programadores");
jCheckBox3.setText("Usuarios finales");
jCheckBox4.setText("Base de datos");
jMenu1.setText("File");
jMenuBar1.add(jMenu1);
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1)
.addComponent(jButton2)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jLabel4))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING, false)
.addComponent(txtnamePro)
.addComponent(txtdatePro)
Short.MAX_VALUE)))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jCheckBox2)
.addComponent(jCheckBox3)
.addComponent(jCheckBox1)
.addComponent(jCheckBox4))))
.addContainerGap(170, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel1)
.addComponent(txtnamePro, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel2)
.addComponent(txtdatePro, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel4)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel3)
.addComponent(jCheckBox1)
.addComponent(jCheckBox2)
.addComponent(jCheckBox4)
.addComponent(jCheckBox3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 88,
Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jButton2)
.addComponent(jButton1))
.addGap(27, 27, 27))
);
pack();
}// </editor-fold>
System.exit(0);
if (seleccionar.showDialog(null, "Guardar")==JFileChooser.APPROVE_OPTION){
archivo = seleccionar.getSelectedFile();
if(archivo.getName().endsWith("txt")){
if(mensaje!=null){
JOptionPane.showMessageDialog(null, mensaje);
}else {
JOptionPane.showMessageDialog(null, "Archivo no compatible");
}else{
JOptionPane.showMessageDialog(null, "Guardado");
/**
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
*/
try {
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
java.util.logging.Logger.getLogger(crearProyecto.class.getName()).log(java.util.logging.Level.S
java.util.logging.Logger.getLogger(crearProyecto.class.getName()).log(java.util.logging.Level.S
java.util.logging.Logger.getLogger(crearProyecto.class.getName()).log(java.util.logging.Level.S
java.util.logging.Logger.getLogger(crearProyecto.class.getName()).log(java.util.logging.Level.S
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
});
}
Bibliografía