Advertisement
julibar

Ej2 - Parte 1

Apr 25th, 2025 (edited)
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1. package Desarrollo;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.ActionListener;
  5. import javax.swing.JButton;
  6. import javax.swing.JComboBox;
  7. import javax.swing.JFrame;
  8. import javax.swing.JLabel;
  9. import javax.swing.JOptionPane;
  10. import javax.swing.JTextField;
  11. import javax.swing.border.TitledBorder;
  12. import javax.swing.JPanel;
  13. import java.awt.Font;
  14.  
  15. public class VentanaEjercicio2 extends JFrame{
  16.  
  17.     private static final long serialVersionUID = 1L;
  18.     private JTextField nota1, nota2, nota3;
  19.     private JComboBox<String> comboTP;
  20.     private JButton btnCalcular;
  21.     private JTextField txtPromedio;
  22.     private JTextField txtCondicion;
  23.  
  24.    
  25.     public VentanaEjercicio2() {
  26.         setTitle("Promedio");
  27.         setBounds(500, 250, 501, 412);
  28.         getContentPane().setLayout(null);
  29.         setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  30.        
  31.     JPanel panel = new JPanel();
  32.         panel.setBounds(42, 31, 266, 184);
  33.         panel.setBorder(new TitledBorder(null, "Notas del estudiante", TitledBorder.LEADING, TitledBorder.TOP, null, null));    
  34.        
  35.        
  36.       JLabel lbl1 = new JLabel("Nota 1:");
  37.         lbl1.setFont(new Font("Tahoma", Font.PLAIN, 12));
  38.         lbl1.setBounds(35, 32, 46, 25);
  39.         panel.add(lbl1);
  40.         panel.setLayout(null);
  41.         nota1 = new JTextField();
  42.         nota1.setBounds(91, 32, 136, 25);
  43.         panel.add(nota1);
  44.      
  45.        
  46.        
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement