1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99100101102103104105106107108109110111112113114115116117118119120121122123124 | import javax.swing.*;import java.awt.event.*; // agregamos esto tambien para el boton.public class Operar extends JFrame implements ActionListener { private JTextField operando1, operando2, resultado; private JButton restar, sumar, multiplicar, dividir, cerrar, acerca; private JLabel titulo, texto1, texto2, result; public Operar(){ setLayout(null); //text fields operando1 = new JTextField(); operando1.setBounds(100, 100, 100, 20); add(operando1); operando2 = new JTextField(); operando2.setBounds(100, 130, 100, 20); add(operando2); resultado = new JTextField(); resultado.setBounds(100, 160, 100, 20); add(resultado); //buttons restar = new JButton("Restar"); restar.setBounds(220, 100, 100, 50); add(restar); restar.addActionListener(this); sumar = new JButton("Sumar"); sumar.setBounds(220, 160, 100, 50); add(sumar); sumar.addActionListener(this); multiplicar = new JButton("Multiplicar"); multiplicar.setBounds(220, 220, 100, 50); add(multiplicar); multiplicar.addActionListener(this); dividir = new JButton("Dividir"); dividir.setBounds(220, 280, 100, 50); add(dividir); dividir.addActionListener(this); cerrar = new JButton("Salir"); cerrar.setBounds(100, 200, 100, 50); add(cerrar); cerrar.addActionListener(this); acerca = new JButton("About"); acerca.setBounds(100, 260, 100, 50); add(acerca); acerca.addActionListener(this); //labels titulo = new JLabel("Calculadora francves v1.0"); titulo.setBounds(130, 40, 200, 30); add(titulo); texto1 = new JLabel("Primer Valor: "); texto1.setBounds(10, 95, 200, 30); add(texto1); texto2 = new JLabel("Segundo Valor: "); texto2.setBounds(10, 125, 200, 30); add(texto2); result = new JLabel("Resultado: "); result.setBounds(10, 155, 200, 30); add(result); } public void actionPerformed(ActionEvent e) { if(e.getSource() == restar){ String oper1=operando1.getText(); String oper2=operando2.getText(); int num1=Integer.parseInt(oper1); int num2=Integer.parseInt(oper2); int resul=num1-num2; String total=String.valueOf(resul); resultado.setText(total); } if(e.getSource() == sumar){ String oper1=operando1.getText(); String oper2=operando2.getText(); int num1=Integer.parseInt(oper1); int num2=Integer.parseInt(oper2); int resul=num1+num2; String total=String.valueOf(resul); resultado.setText(total); } if(e.getSource() == multiplicar){ String oper1=operando1.getText(); String oper2=operando2.getText(); int num1=Integer.parseInt(oper1); int num2=Integer.parseInt(oper2); int resul=num1*num2; String total=String.valueOf(resul); resultado.setText(total); } if(e.getSource() == dividir){ String oper1=operando1.getText(); String oper2=operando2.getText(); int num1=Integer.parseInt(oper1); int num2=Integer.parseInt(oper2); int resul=num1/num2; String total=String.valueOf(resul); resultado.setText(total); } if(e.getSource() == cerrar){ System.exit(0); } if(e.getSource() == acerca){ JOptionPane.showMessageDialog(null, "Calculadora francves v1.0 \n Sigueme en twitter @francves"); } } public static void main(String[] ar){ Operar ope = new Operar(); ope.setBounds(10, 10, 400, 400); ope.setResizable(false); ope.setVisible(true); }} |
importjavax.swing.*;importjava.awt.event.*;
restar.setBounds(220, 100, 100, 50);
if(e.getSource()== restar){Stringoper1=operando1.getText();String oper2=operando2.getText();int num1=Integer.parseInt(oper1);int num2=Integer.parseInt(oper2);int resul=num1-num2;String total=String.valueOf(resul);resultado.setText(total);}
1 ope.setBounds(10,10,400,400);2 ope.setResizable(false);3 ope.setVisible(true);
Motor Replacements Make money online Australia Asbestos Lung Cancer Massage School Dallas Texas MESOTHELIOMA LAW FIRM federal criminal defense attorney benchmark lending CRIMINAL DEFENSE ATTORNEYS FLORIDA Casino Sell Annuity Payment Donate Cars in MA Online casino Business Voip Solutions asbestos lung cancer personal injury law firm Online Stock Trading Html email Annuity Settlements hair removal washington dc Car Insurance Quotes MN Casino reviews DALLAS MESOTHELIOMA ATTORNEYS CAR DONATE email bulk service Donate your car for money Life insurance co Lincoln HARDDRIVE DATA RECOVERY SERVICES Mobile casino car insurance quotes colorado ASBESTOS LAWYERS Futuristic Architecture LIFE INSURANCE CO LINCOLN Criminal lawyer cheap car insurance in virginia Mesothelioma Law Firm Dwi lawyer Insurance Donate a Car in Maryland Adobe illustrator classes Bankruptcy lawyer california law lemon Donate Your Car for Kids structure settlements Tech school motorcycle accident lawyer california mesothelioma attorney illinois DONATE OLD CARS TO CHARITY Data Recovery Raid Custom WordPress theme designer Register Free Domains Learning adobe illustrator canada personals yahoo Live casino Hire php developers donate old cars to charity st louis mesothelioma attorney yahoo web hosting california mesothelioma attorney compare life assurance Cheap Auto Insurance in VA DUI lawyer Email Bulk Service georgia truck accident lawyer ONLINE COLLEDGES structured settlement annuity companies houston mesothelioma attorney Cheap car insurance in Virginia Business finance group Home Phone Internet Bundle mortgage adviser DONATE CARS IN MA dallas mesothelioma attorneys refinance with bad credit Seo company MET AUTO Hire php developer Christmas cards paperport promotional code Hire php programmers Paperport Promotional Code asbestos lawyers ROYALTY FREE IMAGES STOCK buy structured settlements personal injury attorney torrance Personal Injury Law Firm CHEAP AUTO INSURANCE IN VA Automobile Accident Attorney Psd to html Social media platforms for business Service business software Best social media platforms for business personal injury attorney springfield mo Criminal defense lawyer selling annuity REGISTER FREE DOMAINS Neuson MASSAGE SCHOOL DALLAS TEXAS Cheap Domain Registration Hosting mesothelioma attorney florida google affiliate Php programmers for hire Custom Christmas cards Best Criminal Lawyers in Arizona Computer science classes online PHD IN COUNSELING EDUCATION mesothelioma litigation Php programmers Seo companies Car Donate mesotheolima New social media platforms Social media campaigns STRUCTURED ANNUITY SETTLEMENT Car insurance quotes Utah bowne virtual data room structured settlemen Insurance Companies Motor Insurance Quotes Seo services DONATE YOUR CAR SACRAMENTO WordPress theme designers online motor insurance quotes illinois law lemon Online Motor Insurance Quotes integrated ehr Best Seo company cash out structured settlement Business management software CAR INSURANCE QUOTES UTAH Car insurance quotes pa mesothelioma symptoms Car Insurance Quotes Colorado Proud Italian cook Best social media platforms Online Christmas cards structured settlement brokers Dayton Freight Lines Social media tools best accident attorneys Psd to WordPress Royalty Free Images Stock Car insurance quotes MN Photo Christmas cards WordPress themes for designers mesothelioma attorney DONATING USED CARS TO CHARITY Social media management PAPERPORT PROMOTIONAL CODE WordPress hosting DONATE YOUR CAR FOR KIDS Social media examiner Psychic for Free Psychic for free Paperport promotional code Cheap Car Insurance in Virginia DONATE A CAR IN MARYLAND Social media platforms diagnosed with mesothelioma sell annuity payment Life Insurance Co Lincoln Donate your car for kids Italian cooking school Forensics Online Course Auto Mobile Shipping Quote Low Credit Line Credit Cards mesothelioma survival rates structured settlements annuities Social media strategies royalty free images stock home phone internet bundle Hard drive Data Recovery Services Auto Mobile Insurance Quote Donate Car to Charity California auto insurance cost by state Donate Car for Tax Credit Donate Your Car Sacramento World Trade Center Footage World trade center footage new york mesothelioma law firm miami personal injury attorney ONLINE MOTOR INSURANCE QUOTES How to Donate A Car in California Dayton freight lines new mexico mesothelioma lawyer uk homeowner loans Asbestos Lawyers Structures Annuity Settlement buyers of structured settlements Car insurance quotes Colorado CAR ACCIDENT LAWYERS auto accident attorney structured settlement cash out Nunavut Culture PHD on Counseling Education car insurance quotes WebEx costs mesothelioma claims structured settlement company mesothelioma law firm Donating a Car in Maryland Donate Cars Illinois structured settlement buyers Criminal Defense Attorneys Florida accident car florida lawyer Car Insurance Quotes Utah mesothelioma lawsuit FUTURISTIC ARCHITECTURE Holland Michigan College NUNAVUT CULTURE mesothelioma lawyers san diego Online Colleges Online Classes car accident lawyers los angeles CAR INSURANCE IN SOUTH DAKOTA supportpeachtreecom Donate Old Cars to Charity better conferencing calls Dallas Mesothelioma Attorneys Donate your Car for Money Met Auto mesothelioma cases CHEAP DOMAIN REGISTRATION HOSTING Donating Used Cars to Charity Car Insurance Quotes PA Car Insurance Companies Claim lawyers accidents Car Insurance in South Dakota Webex Costs Cheap Car Insurance for Ladies criminal defense attorneys florida fortis health insurance temporary Better Conference Calls virtual data rooms Mortgage Adviser most profitable internet business Futuristic architecture structured settlement need cash now seattle mesothelioma lawyer car accident lawyer in san diego Virtual Data Rooms Online College Course small business administration sba Auto Accident Attorney Car Accident Lawyers online criminal justice degree los angeles auto accident attorneys Criminal lawyer Miami mesothelioma lawyer california WEBEX COSTS
Tourism or Travel structured settlements annuities small business administration sba Classes Donate Donate your car for kids Donate Car to Charity California Loans Insurance Data Recovery Services Blogs Based On Donations domain name yahoo Fashion and Design mesothelioma survival rates Treatment Mortgage ANNUITY SETTLEMENT Credit Software mesothelioma suit Hosting Gas/Electricity Donate your car Sacramento Recovery Transfer · Futuristic Architecture Lawyer Degree Trading DUI ATTORNEY ORLANDO Digital Photography Politics Cord Blood Automobile Accident Attorney Online Classes Claim Rehab Conference Call · Online Colleges NUNAVUT CULTURE Online casino Health STRUCTURED ANNUITY SETTLEMENT Attormey Auto insurance affiliate program Mesothelioma Law Firm Attomey Donate car to charity California MOTORCYCLE ACCIDENT ATTORNEY LOS ANGLES Blogging Making Money online Donate Car for Tax Credit Technology ACCIDENT AND INJURY ATTORNEY CRIMINAL DEFENSE ATTORNEY PALM BEACH Technology Blogs DAYTON FREIGHT LINES structured settlement annuity companies Bluehost mesothelioma attorneys california structured settlement buyer mesothelioma claim
No hay comentarios:
Publicar un comentario