0% found this document useful (0 votes)
18 views

Solución 1

Uploaded by

jorgeluis.d1973
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Solución 1

Uploaded by

jorgeluis.d1973
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Solución 1

Solución 2
Solución 3

Solución 4

COIDGO
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license

* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template

*/
package pc3.practica3;

/**

* @author ASUS

*/

public class Formulario extends javax.swing.JFrame {

/**

* Creates new form Formulario

*/

public Formulario() {

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

* regenerated by the Form Editor.

*/

@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jComboBox1 = new javax.swing.JComboBox<>();

jButton1 = new javax.swing.JButton();

jLabel1 = new javax.swing.JLabel();

jCheckBox1 = new javax.swing.JCheckBox();

jCheckBox2 = new javax.swing.JCheckBox();

jCheckBox3 = new javax.swing.JCheckBox();

jCheckBox4 = new javax.swing.JCheckBox();

jCheckBox5 = new javax.swing.JCheckBox();

jCheckBox6 = new javax.swing.JCheckBox();


jLabel2 = new javax.swing.JLabel();

jTextField1 = new javax.swing.JTextField();

jLabel3 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item


2", "Item 3", "Item 4" }));

jComboBox1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jComboBox1ActionPerformed(evt);

});

jButton1.setText("Enviar");

jButton1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton1ActionPerformed(evt);

});

jLabel1.setText("Seleccione características");

jCheckBox1.setText("C1");

jCheckBox1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jCheckBox1ActionPerformed(evt);

});

jCheckBox2.setText("C2");

jCheckBox3.setText("C3");
jCheckBox4.setText("C4");

jCheckBox5.setText("C5");

jCheckBox6.setText("C6");

jLabel2.setText("Cantidad");

jTextField1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jTextField1ActionPerformed(evt);

});

jLabel3.setText("Tipo:");

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addContainerGap()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jCheckBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 85,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jCheckBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 85,


javax.swing.GroupLayout.PREFERRED_SIZE))

.addGap(42, 42, 42)


.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jCheckBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 85,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jCheckBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 85,


javax.swing.GroupLayout.PREFERRED_SIZE))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 55,
Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jCheckBox5, javax.swing.GroupLayout.PREFERRED_SIZE, 85,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jCheckBox6, javax.swing.GroupLayout.PREFERRED_SIZE, 85,


javax.swing.GroupLayout.PREFERRED_SIZE)))

.addGroup(layout.createSequentialGroup()

.addGap(0, 0, Short.MAX_VALUE)

.addComponent(jButton1))

.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()

.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 144,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addGap(0, 0, Short.MAX_VALUE)))

.addGap(42, 42, 42))

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jLabel2)

.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 71,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 37,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addContainerGap()

.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(jCheckBox1)

.addComponent(jCheckBox3)

.addComponent(jCheckBox5))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(jCheckBox2)

.addComponent(jCheckBox4)

.addComponent(jCheckBox6))

.addGap(18, 18, 18)

.addComponent(jLabel2)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addComponent(jLabel3)

.addGap(18, 18, 18)

.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36,
Short.MAX_VALUE)

.addComponent(jButton1)

.addGap(38, 38, 38))

);

pack();

}// </editor-fold>

private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:

private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

/**

* @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(Formulario.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(Formulario.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(Formulario.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(Formulario.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

//</editor-fold>

/* Create and display the form */

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Formulario().setVisible(true);

});

// Variables declaration - do not modify

private javax.swing.JButton jButton1;

private javax.swing.JCheckBox jCheckBox1;

private javax.swing.JCheckBox jCheckBox2;

private javax.swing.JCheckBox jCheckBox3;

private javax.swing.JCheckBox jCheckBox4;

private javax.swing.JCheckBox jCheckBox5;

private javax.swing.JCheckBox jCheckBox6;

private javax.swing.JComboBox<String> jComboBox1;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JTextField jTextField1;

// End of variables declaration

You might also like