Factorial

Solo disponible en BuenasTareas
  • Páginas : 2 (351 palabras )
  • Descarga(s) : 0
  • Publicado : 29 de noviembre de 2010
Leer documento completo
Vista previa del texto
como sacar el factorial en netbeans con graficos

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* factorial.java
*
* Created on21-oct-2010, 2:25:30
*/

package javaapplication67;

/**
*
* @author lab5O
*/
public class factorial extends javax.swing.JFrame {

/** Creates new form factorial */
publicfactorial() {
initComponents();
}

/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of thismethod is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// //GEN-BEGIN:initComponents
private void initComponents() {

num = newjavax.swing.JSpinner();
jButton1 = new javax.swing.JButton();
resultado = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);jButton1.setText("factorial");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {jButton1ActionPerformed(evt);
}
});

resultado.setText("=");

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup()
.addGap(50, 50, 50)
.addComponent(num, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addGap(29, 29, 29)
.addComponent(jButton1)
.addGap(32, 32, 32)
.addComponent(resultado, javax.swing.GroupLayout.PREFERRED_SIZE, 70,...
tracking img