Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pakete;
- import java.awt.BorderLayout;
- import java.awt.EventQueue;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.border.EmptyBorder;
- import javax.swing.JLabel;
- import java.awt.Font;
- import javax.swing.JButton;
- import java.awt.Color;
- import javax.swing.ImageIcon;
- import java.awt.event.ActionListener;
- import java.awt.event.ActionEvent;
- import java.awt.Toolkit;
- import javax.swing.JTextField;
- public class MOT05 extends JFrame {
- private JPanel contentPane;
- private JTextField costo;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- MOT05 frame = new MOT05();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the frame.
- */
- public MOT05() {
- setIconImage(Toolkit.getDefaultToolkit().getImage("\\\\10.0.29.228\\Docentes\\Nora Hernandez 2019\\Iconos\\EmojiOne_3.0_64x64_png\\1f3cd.png"));
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setBounds(100, 100, 800, 632);
- contentPane = new JPanel();
- contentPane.setBackground(Color.WHITE);
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(contentPane);
- contentPane.setLayout(null);
- JLabel lblNewLabel = new JLabel("TALLER DE MOTONETAS\r\n");
- lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 17));
- lblNewLabel.setBounds(303, 11, 204, 21);
- contentPane.add(lblNewLabel);
- JButton button = new JButton("");
- button.setBorderPainted(false);
- button.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- }
- });
- button.setIcon(new ImageIcon("C:\\Users\\aVA\\Desktop\\los-deportes-de-motor.png"));
- button.setBackground(Color.WHITE);
- button.setBounds(20, 71, 176, 177);
- contentPane.add(button);
- JButton button_1 = new JButton("");
- button_1.setBorderPainted(false);
- button_1.setIcon(new ImageIcon("C:\\Users\\aVA\\Desktop\\los-deportes-de-motor.png"));
- button_1.setBackground(Color.WHITE);
- button_1.setBounds(589, 71, 176, 177);
- contentPane.add(button_1);
- costo = new JTextField();
- costo.setBackground(Color.LIGHT_GRAY);
- costo.setFont(new Font("Tahoma", Font.BOLD, 15));
- costo.setBounds(247, 235, 285, 20);
- contentPane.add(costo);
- costo.setColumns(10);
- JLabel lblIngreseCostoDe = new JLabel("Ingrese costo de reparacion");
- lblIngreseCostoDe.setFont(new Font("Tahoma", Font.BOLD, 17));
- lblIngreseCostoDe.setBounds(247, 203, 240, 21);
- contentPane.add(lblIngreseCostoDe);
- JButton btnEnviaru = new JButton("Enviar :3\r\n");
- btnEnviaru.setBounds(338, 281, 89, 23);
- contentPane.add(btnEnviaru);
- JLabel resultado = new JLabel("Su costo total es:");
- resultado.setFont(new Font("Tahoma", Font.BOLD, 17));
- resultado.setBounds(24, 385, 240, 21);
- contentPane.add(resultado);
- JButton btnLimpiar = new JButton("Limpiar");
- btnLimpiar.setBounds(676, 560, 89, 23);
- contentPane.add(btnLimpiar);
- btnEnviaru.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- resultado.setText(String.valueOf(linus(costo.getText())));
- }
- });
- }
- public static int linus(String luke) {
- int dennis=0;
- dennis=Integer.parseInt(luke)+(Integer.parseInt(luke)*20)/100;
- dennis=dennis+(dennis*22)/100;
- return dennis;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement