LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
import java.applet.Applet;
import java.awt.*;
public class TEXTO_UNO extends JApplet implements ActionListener
{
JLabel l1;
JButton b1;
JTextField t1;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
l1=new JLabel("NOMBRE: ");
t1=new JTextField(30);
b1=new JButton("SALUDOS");
c.add(l1);
c.add(t1);
c.add(b1);
b1.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
t1.setText("BIENVENIDO A SWING");
}
}
}
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
import java.applet.Applet;
import java.awt.*;
public class L1 extends JApplet
{
JLabel nom,dir,tel;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
nom=new JLabel("rodrigo villanueva ");
dir=new JLabel("aragon");
tel=new JLabel("6798798");
c.add(nom);
c.add(dir);
c.add(tel);
}
}
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
import java.applet.Applet;
import java.awt.*;
public class L1 extends JApplet
{
JLabel nom,dir,tel;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
nom=new JLabel("rodrigo villanueva ");
dir=new JLabel("aragon");
tel=new JLabel("6798798");
c.add(nom);
c.add(dir);
c.add(tel);
}
}
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
import java.applet.Applet;
import java.awt.*;
public class L1 extends JApplet
{
JLabel e1;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
e1=new JLabel("ESTA ES MI PRIMER ETIQUETA");
c.add(e1);
}
}
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
import java.applet.Applet;
import java.awt.*;
public class L1 extends JApplet
{
JLabel e1;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
e1=new JLabel("ESTA ES MI PRIMER ETIQUETA");
c.add(e1);
}
}
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.util.*;
public class PEDIR
{
public static void main(String args[])
{
double a,b,c,r;
a=pj();
b=pj();
c=pj();
r=raiz(a,b,c);
imp("LA RAIZ ES: "+r);
imj("LA RAIZ ES: "+r);
}
public static void imp(String x)
{
System.out.print(x);
}
public static void imj(String x)
{
JOptionPane.showMessageDialog(null, x);
}
public static double p()
{
double x;
Scanner m=new Scanner(System.in);
imp("DAME UN NUMERO: ");
x=m.nextDouble();
return x;
}
public static double pj()
{
double x;
x=Double.parseDouble(JOptionPane.showInputDialog("DAME UN VALOR: "));
return x;
}
public static double raiz(double a,double b,double c )
{
return Math.sqrt(a+b+c);
}
}//clase
import javax.swing.*;
import java.util.*;
public class PEDIR
{
public static void main(String args[])
{
double a,b,c,r;
a=pj();
b=pj();
c=pj();
r=raiz(a,b,c);
imp("LA RAIZ ES: "+r);
imj("LA RAIZ ES: "+r);
}
public static void imp(String x)
{
System.out.print(x);
}
public static void imj(String x)
{
JOptionPane.showMessageDialog(null, x);
}
public static double p()
{
double x;
Scanner m=new Scanner(System.in);
imp("DAME UN NUMERO: ");
x=m.nextDouble();
return x;
}
public static double pj()
{
double x;
x=Double.parseDouble(JOptionPane.showInputDialog("DAME UN VALOR: "));
return x;
}
public static double raiz(double a,double b,double c )
{
return Math.sqrt(a+b+c);
}
}//clase
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
double x,y,z,re;
x=Double.parseDouble(a.getText());
y=Double.parseDouble(b.getText());
z=Double.parseDouble(c.getText());
re=x+y+z;
r.setText(String.valueOf(re));
}
double x,y,z,re;
x=Double.parseDouble(a.getText());
y=Double.parseDouble(b.getText());
z=Double.parseDouble(c.getText());
re=x+y+z;
r.setText(String.valueOf(re));
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
a.setText("");
b.setText("");
c.setText("");
r.setText("");
}
// TODO add your handling code here:
a.setText("");
b.setText("");
c.setText("");
r.setText("");
}
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class SUMA extends JApplet implements ActionListener
{
JTextField t1,t2,t3;
JLabel l1,l2,l3;
JButton b1;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
l1=new JLabel("DAME EL PRIMER VALOR: ");
t1=new JTextField(20);
l2=new JLabel("DAME EL SEGUNDO VALOR: ");
t2=new JTextField(20);
l3=new JLabel("EL RESULTADO ES: ");
t3=new JTextField(20);
b1=new JButton("SUMAR");
c.add(t1);
c.add(t2);
c.add(t3);
c.add(b1);
b1.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
double a,b,r;
a=Double.parseDouble(t1.getText());
b=Double.parseDouble(t2.getText());
r=a+b;
t3.setText(String.valueOf(r));
}
}
}
import javax.swing.*;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class SUMA extends JApplet implements ActionListener
{
JTextField t1,t2,t3;
JLabel l1,l2,l3;
JButton b1;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
l1=new JLabel("DAME EL PRIMER VALOR: ");
t1=new JTextField(20);
l2=new JLabel("DAME EL SEGUNDO VALOR: ");
t2=new JTextField(20);
l3=new JLabel("EL RESULTADO ES: ");
t3=new JTextField(20);
b1=new JButton("SUMAR");
c.add(t1);
c.add(t2);
c.add(t3);
c.add(b1);
b1.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
double a,b,r;
a=Double.parseDouble(t1.getText());
b=Double.parseDouble(t2.getText());
r=a+b;
t3.setText(String.valueOf(r));
}
}
}
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.applet.Applet;
public class PEDIR_TEXTO extends JApplet implements ActionListener
{
JTextField t1;
JLabel l1;
JButton b1;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
l1=new JLabel("BIENVENIDOS A UN PROGRAMA CON UN BOTON: ");
t1=new JTextField(30);
b1=new JButton("SALUDO");
b1.addActionListener(this);
c.add(l1);
c.add(t1);
c.add(b1);
}//init
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
t1.setText("RODRIGO VILLANUEVA NIETO");
}
}
}//PRINCIPAL
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.applet.Applet;
public class PEDIR_TEXTO extends JApplet implements ActionListener
{
JTextField t1;
JLabel l1;
JButton b1;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
l1=new JLabel("BIENVENIDOS A UN PROGRAMA CON UN BOTON: ");
t1=new JTextField(30);
b1=new JButton("SALUDO");
b1.addActionListener(this);
c.add(l1);
c.add(t1);
c.add(b1);
}//init
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
t1.setText("RODRIGO VILLANUEVA NIETO");
}
}
}//PRINCIPAL
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
public class PEDIR3
{
public static void main(String args[])
{
desarrollo c1=new desarrollo();
c1.menu();
}
}
class desarrollo
{
public static void imp(String x)
{
JOptionPane.showMessageDialog(null,x);
}
public static double pd()
{
double x;
x=Double.parseDouble(JOptionPane.showInputDialog("DAME UN NUMERO: "));
return x;
}
public static double suma(double a,double b)
{
return a+b;
}
public static double resta(double a,double b)
{
return a-b;
}
public static double multi(double a,double b)
{
return a*b;
}
public static double divi(double a,double b)
{
return a/b;
}
public static double raiz(double a,double b)
{
return Math.sqrt(a+b);
}
public static double coseno(double a,double b)
{
return Math.cos(a+b);
}
public static double seno(double a,double b)
{
return Math.sin(a+b);
}
public static double tangente(double a,double b)
{
return Math.tan(a+b);
}
public static void menu()
{
int opc;
double a,b,r;
do
{
opc=Integer.parseInt(JOptionPane.showInputDialog("SELECCIONA UNA OPCION \n1.-SUMA\n2.-RESTA\n3.-MULTI\n4.-DIVI\n5RAIZ\n6.-COSENO7.-SENO\n8.-TANGETNTE\n9.-SALIR"));
switch(opc)
{
case 1:
a=pd();
b=pd();
r=suma(a,b);
imp("LA SUMA ES: "+r);
break;
case 2:
a=pd();
b=pd();
r=resta(a,b);
imp("LA RESTA ES: "+r);
break;
case 3:
a=pd();
b=pd();
r=multi(a,b);
imp("LA MULTIPLICACION ES: "+r);
break;
}//switch
}while(opc!=9);
}//desarrollo
import javax.swing.*;
public class PEDIR3
{
public static void main(String args[])
{
desarrollo c1=new desarrollo();
c1.menu();
}
}
class desarrollo
{
public static void imp(String x)
{
JOptionPane.showMessageDialog(null,x);
}
public static double pd()
{
double x;
x=Double.parseDouble(JOptionPane.showInputDialog("DAME UN NUMERO: "));
return x;
}
public static double suma(double a,double b)
{
return a+b;
}
public static double resta(double a,double b)
{
return a-b;
}
public static double multi(double a,double b)
{
return a*b;
}
public static double divi(double a,double b)
{
return a/b;
}
public static double raiz(double a,double b)
{
return Math.sqrt(a+b);
}
public static double coseno(double a,double b)
{
return Math.cos(a+b);
}
public static double seno(double a,double b)
{
return Math.sin(a+b);
}
public static double tangente(double a,double b)
{
return Math.tan(a+b);
}
public static void menu()
{
int opc;
double a,b,r;
do
{
opc=Integer.parseInt(JOptionPane.showInputDialog("SELECCIONA UNA OPCION \n1.-SUMA\n2.-RESTA\n3.-MULTI\n4.-DIVI\n5RAIZ\n6.-COSENO7.-SENO\n8.-TANGETNTE\n9.-SALIR"));
switch(opc)
{
case 1:
a=pd();
b=pd();
r=suma(a,b);
imp("LA SUMA ES: "+r);
break;
case 2:
a=pd();
b=pd();
r=resta(a,b);
imp("LA RESTA ES: "+r);
break;
case 3:
a=pd();
b=pd();
r=multi(a,b);
imp("LA MULTIPLICACION ES: "+r);
break;
}//switch
}while(opc!=9);
}//desarrollo
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.util.*;
public class FUNCION
{
public static void main(String args[])
{
double a,b,c,r;
a=p();
b=p();
c=p();
r=a+b+c;
imp("LA SUMA ES: "+r);
}
public static void imp(String x)
{
System.out.print(x);
}
public static double p()
{
Scanner m=new Scanner(System.in);
double x;
imp("DAME UN VALOR: ");
x=m.nextDouble();
return x;
}
}
import javax.swing.*;
import java.util.*;
public class FUNCION
{
public static void main(String args[])
{
double a,b,c,r;
a=p();
b=p();
c=p();
r=a+b+c;
imp("LA SUMA ES: "+r);
}
public static void imp(String x)
{
System.out.print(x);
}
public static double p()
{
Scanner m=new Scanner(System.in);
double x;
imp("DAME UN VALOR: ");
x=m.nextDouble();
return x;
}
}
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
public class pedir_caja
{
public static void main(String args[])
{
double a,b,r;
a=p();
b=p();
r=a+b;
imp("LA SUMA ES: "+r);
}
public static double p()
{
double x;
x=Double.parseDouble(JOptionPane.showInputDialog("DAME UN NUMERO: "));
return x;
}
public static void imp(String x)
{
JOptionPane.showMessageDialog(null,x);
}
}
import javax.swing.*;
public class pedir_caja
{
public static void main(String args[])
{
double a,b,r;
a=p();
b=p();
r=a+b;
imp("LA SUMA ES: "+r);
}
public static double p()
{
double x;
x=Double.parseDouble(JOptionPane.showInputDialog("DAME UN NUMERO: "));
return x;
}
public static void imp(String x)
{
JOptionPane.showMessageDialog(null,x);
}
}
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
public class IMPRIMIR
{
public static void main(String args[])
{
imp("ING RODRIGO VILLANUEVA NIETO");
jm("ING RODRIGO VILLANUEVA NIETO");
}
public static void imp(String x)
{
System.out.print(x);
}
public static void jm(String x)
{
JOptionPane.showMessageDialog(null, x);
}
}
import javax.swing.*;
public class IMPRIMIR
{
public static void main(String args[])
{
imp("ING RODRIGO VILLANUEVA NIETO");
jm("ING RODRIGO VILLANUEVA NIETO");
}
public static void imp(String x)
{
System.out.print(x);
}
public static void jm(String x)
{
JOptionPane.showMessageDialog(null, x);
}
}
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.util.*;
public class SUMA
{
public static void main(String args[])
{
double a,b,c,re,com;
Scanner p=new Scanner(System.in);
imp("DAME A: ");
a=p.nextDouble();
imp("DAME B: ");
b=p.nextDouble();
imp("DAME C: ");
c=p.nextDouble();
re=suma(a,b);
com=raiz(a,b,c)-suma(a,b);
imp("LA SUMA ES: "+re);
imp("RESULTADO ES: "+com);
}
public static double raiz(double a,double b,double c)
{
return Math.sqrt((a+b)/c);
}
public static double suma(double a, double b)
{
double r;
r=(a+b)/2;
return r;
}
public static void imp(String x)
{
System.out.print(x);
}
}
import javax.swing.*;
import java.util.*;
public class SUMA
{
public static void main(String args[])
{
double a,b,c,re,com;
Scanner p=new Scanner(System.in);
imp("DAME A: ");
a=p.nextDouble();
imp("DAME B: ");
b=p.nextDouble();
imp("DAME C: ");
c=p.nextDouble();
re=suma(a,b);
com=raiz(a,b,c)-suma(a,b);
imp("LA SUMA ES: "+re);
imp("RESULTADO ES: "+com);
}
public static double raiz(double a,double b,double c)
{
return Math.sqrt((a+b)/c);
}
public static double suma(double a, double b)
{
double r;
r=(a+b)/2;
return r;
}
public static void imp(String x)
{
System.out.print(x);
}
}
LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.io.*;
public class pedir_uno
{
public static void main(String args[]) throws Exception
{
BufferedReader p=new BufferedReader(new InputStreamReader(System.in));
double a,b,r;
System.out.print("DAME A: ");
a=Double.parseDouble(p.readLine());
System.out.print("DAME B: ");
b=Double.parseDouble(p.readLine());
r=a+b;
System.out.print("LA SUMA ES: "+r);
}
}
import javax.swing.*;
import java.io.*;
public class pedir_uno
{
public static void main(String args[]) throws Exception
{
BufferedReader p=new BufferedReader(new InputStreamReader(System.in));
double a,b,r;
System.out.print("DAME A: ");
a=Double.parseDouble(p.readLine());
System.out.print("DAME B: ");
b=Double.parseDouble(p.readLine());
r=a+b;
System.out.print("LA SUMA ES: "+r);
}
}
Suscribirse a:
Entradas (Atom)