Advertisement
Inag28

CódigoInventario2

Feb 16th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. package inventario;
  2. public class mas extends javax.swing.JFrame {
  3.  
  4. public mas() {
  5. initComponents();
  6. }
  7.  
  8. ventana ventana = new ventana();
  9. @SuppressWarnings("unchecked")
  10. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  11. private void initComponents() {
  12.  
  13. btnsi = new javax.swing.JButton();
  14. btnno = new javax.swing.JButton();
  15. jLabel1 = new javax.swing.JLabel();
  16.  
  17. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  18.  
  19. btnsi.setText("SÍ");
  20. btnsi.addActionListener(new java.awt.event.ActionListener() {
  21. public void actionPerformed(java.awt.event.ActionEvent evt) {
  22. btnsiActionPerformed(evt);
  23. }
  24. });
  25.  
  26. btnno.setText("NO");
  27. btnno.addActionListener(new java.awt.event.ActionListener() {
  28. public void actionPerformed(java.awt.event.ActionEvent evt) {
  29. btnnoActionPerformed(evt);
  30. }
  31. });
  32.  
  33. jLabel1.setText("Desea realizar más compras?");
  34.  
  35. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  36. getContentPane().setLayout(layout);
  37. layout.setHorizontalGroup(
  38. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  39. .addGroup(layout.createSequentialGroup()
  40. .addContainerGap()
  41. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  42. .addGroup(layout.createSequentialGroup()
  43. .addComponent(btnsi)
  44. .addGap(48, 48, 48)
  45. .addComponent(btnno))
  46. .addComponent(jLabel1))
  47. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  48. );
  49. layout.setVerticalGroup(
  50. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  51. .addGroup(layout.createSequentialGroup()
  52. .addGap(24, 24, 24)
  53. .addComponent(jLabel1)
  54. .addGap(38, 38, 38)
  55. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  56. .addComponent(btnsi)
  57. .addComponent(btnno))
  58. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  59. );
  60.  
  61. pack();
  62. }// </editor-fold>
  63.  
  64. private void btnsiActionPerformed(java.awt.event.ActionEvent evt) {
  65. ventana.cambiarvalores();
  66. ventana open=new ventana();
  67. open.setVisible(true);
  68. open.setLocationRelativeTo(null);
  69. dispose();
  70. }
  71.  
  72. private void btnnoActionPerformed(java.awt.event.ActionEvent evt) {
  73. System.exit(0);
  74. }
  75.  
  76. public static void main(String args[]) {
  77.  
  78. java.awt.EventQueue.invokeLater(() -> {
  79. new mas().setVisible(true);
  80. });
  81. }
  82.  
  83. // Variables declaration - do not modify
  84. private javax.swing.JButton btnno;
  85. private javax.swing.JButton btnsi;
  86. private javax.swing.JLabel jLabel1;
  87. // End of variables declaration
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement