Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Alexander Morán
Informática 8B
Programación VIII
MSc. Víctor Zapata
import javax.swing.JOptionPane;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Alexander Moran
*/
public class det_matriz extends javax.swing.JFrame {
public static int i,j,k;
public static double det=0;
public static int mat1[][]=new int[3][3];
/**
* Creates new form multi_matriz
*/
public det_matriz() {
initComponents();
jButton2.setEnabled(false);
}
/**
* 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jTextArea1.setEditable(false);
jTextArea1.setBackground(new java.awt.Color(204, 255, 255));
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
jTextField1.setEditable(false);
jTextField1.setBackground(new java.awt.Color(255, 255, 204));
jTextField1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
jTextField1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
getContentPane().add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 180,
80, 60));
jTextArea2.setEditable(false);
jTextArea2.setBackground(new java.awt.Color(204, 255, 255));
jTextArea2.setColumns(20);
jTextArea2.setRows(5);
jTextArea2.setTabSize(5);
jScrollPane2.setViewportView(jTextArea2);
//Ingreso de la Matriz
JOptionPane.showMessageDialog(this,"Ingrese los valores de la Matriz
","OK!",JOptionPane.PLAIN_MESSAGE);
for(i=0;i<3;i++){
for(j=0;j<3;j++){
mat1[i][j]=Integer.parseInt(JOptionPane.showInputDialog("Ingrese valor de la posicion:
"+"["+i+"]"+"["+j+"]"));
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<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.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(det_matriz.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(det_matriz.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(det_matriz.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(det_matriz.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>