<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-13473815328994103</id><updated>2026-08-15T14:26:46.479-07:00</updated><category term="java"/><category term="netbeans 7.1"/><category term="netbeans"/><category term="botones"/><category term="botones en java"/><category term="ventanas"/><category term="javaserver faces"/><category term="jsf"/><category term="applet"/><category term="beans"/><category term="figuras"/><category term="index.xhtml"/><category term="matlab"/><category term="opengl"/><category term="subprograma"/><category term="Button"/><category term="applets"/><category term="bean"/><category term="boton"/><category term="faces-config.xml"/><category term="gltranslatef()"/><category term="html"/><category term="inputText"/><category term="label"/><category term="web.xml"/><category term="InputStream"/><category term="android"/><category term="archivo"/><category term="archivos"/><category term="checkbox"/><category term="circulos"/><category term="clase"/><category term="dibujar"/><category term="gl.glRotatef()"/><category term="gui"/><category term="hilos"/><category term="jlabel"/><category term="menu"/><category term="opengl en java"/><category term="Socket"/><category term="Sockets"/><category term="color"/><category term="composicion"/><category term="crear"/><category term="css"/><category term="glBegin()"/><category term="glColorf()"/><category term="glrotatef"/><category term="imagenes"/><category term="javabeans"/><category term="jframe"/><category term="lista"/><category term="lista desplegable"/><category term="manejo ventanas"/><category term="objeto"/><category term="opengl en netbeans"/><category term="opengl java"/><category term="3d"/><category term="Cliente"/><category term="Cliente en Java"/><category term="File"/><category term="JButton"/><category term="JDBC"/><category term="ObjectOutputStream"/><category term="OutputStream"/><category term="Runnable"/><category term="Servidor"/><category term="Sockets Java"/><category term="addMouseListener"/><category term="agregar"/><category term="applet java"/><category term="area de texto"/><category term="axes"/><category term="botones de radio"/><category term="button group"/><category term="caracteristicas"/><category term="cargar"/><category term="dibujar figuras"/><category term="edittext"/><category term="ejemplo"/><category term="ejemplos"/><category term="escribir archivo"/><category term="esfera"/><category term="evento"/><category term="eventos"/><category term="figuras  en opengl"/><category term="formulario"/><category term="glut"/><category term="graficos"/><category term="handles"/><category term="html/css"/><category term="imagen"/><category term="images"/><category term="imread"/><category term="input"/><category term="jpanel"/><category term="layout"/><category term="matrices"/><category term="metodo run()"/><category term="mousePressed"/><category term="multithreading"/><category term="opengl 3D"/><category term="opengl netbeans"/><category term="plugin"/><category term="radio button"/><category term="random"/><category term="raton"/><category term="scanner"/><category term="serializable"/><category term="start()"/><category term="subprocesos"/><category term="textarea"/><category term="textview"/><category term="thread"/><category term="threads"/><category term="url"/><category term="view"/><category term="xml"/><category term="2d"/><category term="3d java"/><category term="AWT"/><category term="Android Studio"/><category term="Base de Datos java"/><category term="Base de datos bdd"/><category term="Checbox JSF"/><category term="Conectar"/><category term="Conexion Java con Derby"/><category term="DELETE bdd"/><category term="Derby Netbeans"/><category term="GL_POINTS() gl.glBegin()"/><category term="GL_POLYGON"/><category term="GridBagLayout()"/><category term="IDE"/><category term="INNER JOIN"/><category term="ImageIO.read(url)"/><category term="Insertar"/><category term="JComboBox"/><category term="JFileChooser"/><category term="JScrollPane"/><category term="JVM"/><category term="Log"/><category term="MVC Java"/><category term="OPTION en JSF"/><category term="ORDER BY"/><category term="ObjectInputStram"/><category term="ObjectInputStream"/><category term="Operaciones"/><category term="OutputStram"/><category term="SELECT en JSF"/><category term="ServerSocket"/><category term="String"/><category term="UPDATE"/><category term="aaceso a base de datos"/><category term="abrir archivos"/><category term="activity"/><category term="adaptadores"/><category term="alternar"/><category term="alternos"/><category term="animacion"/><category term="apache"/><category term="api"/><category term="aplicacion"/><category term="aplicacion java"/><category term="app"/><category term="app jsf"/><category term="apps"/><category term="apuntes"/><category term="archivos log"/><category term="arcos"/><category term="area"/><category term="arreglo"/><category term="base de datos"/><category term="base de datos Derby"/><category term="base de datos JDBC"/><category term="beneficios"/><category term="blog"/><category term="blogger"/><category term="blogspot"/><category term="boolean"/><category term="borderlayout"/><category term="boton derecho"/><category term="boton submit"/><category term="botones de grupo"/><category term="buscar"/><category term="busqueda"/><category term="busqueda lineal"/><category term="calendar"/><category term="cambiar"/><category term="canRead()"/><category term="cardlayout"/><category term="cargar archivo"/><category term="cargar imagenes"/><category term="chat"/><category term="check"/><category term="choice"/><category term="cilindro"/><category term="cilindro 3d"/><category term="cilindro en opengl"/><category term="cilindro opengl"/><category term="cincunferencia"/><category term="circulos opengl java"/><category term="circunferencia"/><category term="circunferencias"/><category term="clase File"/><category term="clase interna anonima"/><category term="clase thread"/><category term="clases"/><category term="click"/><category term="click derecho"/><category term="click listener"/><category term="colores"/><category term="comentarios"/><category term="comoposicion"/><category term="componentes"/><category term="componentes java"/><category term="crear objetos"/><category term="cuaadro de dialogo"/><category term="cuadros de marcacion"/><category term="delay"/><category term="derby"/><category term="derbycliente.jar"/><category term="deserealizar"/><category term="dibujar con opengl"/><category term="dibujar en opengl"/><category term="dibujar figuras geometricas opengl netbeans plugin java poligonos en opengl lineas opengl api opengl"/><category term="easings"/><category term="edit"/><category term="edit text"/><category term="efecto menu"/><category term="ejemplo bdd"/><category term="ejemplo jsf"/><category term="elipses"/><category term="en base de datos"/><category term="esfera 3D"/><category term="etiquetas jsf"/><category term="eventlisteners"/><category term="figuras en opengl"/><category term="figuras opengl"/><category term="fileinputstream"/><category term="fileoutputstream"/><category term="flowlayout"/><category term="font"/><category term="formulario jsf"/><category term="fuente"/><category term="generador de Eventos"/><category term="getInputStream"/><category term="getOutputStream"/><category term="gl.glPointSize()"/><category term="glEnd()"/><category term="glLineWidth()"/><category term="glScale"/><category term="gl_triangles"/><category term="gllightfv()"/><category term="global"/><category term="graphics2D"/><category term="gridbaglayout"/><category term="gridlayout"/><category term="horizontal"/><category term="hover"/><category term="iluminacion"/><category term="iluminar objetos"/><category term="imageicon"/><category term="implements"/><category term="imshow"/><category term="imwrite"/><category term="insertan imagenes"/><category term="intent"/><category term="ip"/><category term="item"/><category term="java EE"/><category term="java opengl"/><category term="java outpusstream"/><category term="java server pages"/><category term="java uso ventanas"/><category term="java2d"/><category term="jcolorchooser"/><category term="jcomponent"/><category term="jdialog"/><category term="jframe form"/><category term="jframe jbutton botones en java"/><category term="jsp"/><category term="jtextarea"/><category term="kinetic"/><category term="la clase File"/><category term="leer archivo"/><category term="leer imagenes"/><category term="letra"/><category term="line2d"/><category term="lineas"/><category term="linewidth"/><category term="list"/><category term="listView"/><category term="lista despegable"/><category term="listar"/><category term="listar datos"/><category term="listas"/><category term="listeners"/><category term="localhost"/><category term="log en Java"/><category term="manejador eventos"/><category term="manejadores de eventos"/><category term="manejo"/><category term="matriz"/><category term="menu emergente"/><category term="menu vertical"/><category term="menus contextuales"/><category term="metodo"/><category term="metodos"/><category term="mostrar imagen"/><category term="mouse"/><category term="mouseDragged"/><category term="movil"/><category term="movimiento"/><category term="mvc"/><category term="netbeans 7.1 jframe"/><category term="netbeans. paint en java"/><category term="nombre"/><category term="nueva"/><category term="nuevo proyecto"/><category term="opengl en java netbeans 7.1"/><category term="opengl en netbeans 7.1"/><category term="opengl y java"/><category term="option"/><category term="output"/><category term="panel"/><category term="paneles"/><category term="paquete"/><category term="passwordfield"/><category term="path"/><category term="play"/><category term="plot"/><category term="plugin netbeans"/><category term="proyecto"/><category term="puerto"/><category term="puntos"/><category term="radiobuton"/><category term="radiobutton"/><category term="rand"/><category term="randi"/><category term="randn"/><category term="read images"/><category term="rectangulos"/><category term="redimensionar"/><category term="registro en Java"/><category term="reshape"/><category term="reverse"/><category term="rotar cilindro"/><category term="rutas absolutas"/><category term="rutas relativas"/><category term="script"/><category term="scroll"/><category term="scrolling"/><category term="select"/><category term="serializacion"/><category term="serializar"/><category term="servidor en java"/><category term="servidor java"/><category term="servlet"/><category term="settypeface"/><category term="simple"/><category term="slider"/><category term="stage"/><category term="start"/><category term="static text"/><category term="stream"/><category term="style"/><category term="subclase"/><category term="submenu"/><category term="subprocesamiento multiple en java"/><category term="swing"/><category term="tablas"/><category term="text"/><category term="textfield"/><category term="texto"/><category term="therads"/><category term="threads java"/><category term="tipo"/><category term="tipos de constructores"/><category term="tomcat"/><category term="tool tips"/><category term="transformar"/><category term="transladar"/><category term="triangulos"/><category term="tweens"/><category term="type"/><category term="typeface"/><category term="variables"/><category term="variables globales"/><category term="ventana"/><category term="web"/><category term="web.cml"/><category term="whos"/><title type='text'>Apuntes de programacion en los lenguajes Java, Matlab, HTML, JavaScript y PHP.</title><subtitle type='html'>Este blog muestra diferentes códigos, apuntes y ejemplos de programación funcionales realizados en el lenguaje Java (en Netbeans), Matlab, HTML5, JavaScript y PHP.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>65</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-7058830385505374717</id><published>2017-06-29T22:41:00.001-07:00</published><updated>2017-06-29T22:41:20.452-07:00</updated><title type='text'>Como utilizar el AutoComplete en un EditText en Android con historial</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
En este corto post veremos como realizar el auto completado de palabras o frases dentro de un EditText en Android en Java&lt;br /&gt;
&lt;br /&gt;
El&amp;nbsp;AutoComplete en un EditText en Android es necesario cuando se requiere auto completar frases o palabras con las palabras que se han utilizado previamente. Para ello Android permite guardar un historial de las palabras introducidas a traves de las preferencias compartidas (SharedPreferences)&lt;br /&gt;
&lt;br /&gt;
Antes que nada definimos el elemento AutoCompleteTextView dentro de nuestro archivo *.xml&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(238, 238, 238); font-size: 0.8em; line-height: 13px; padding: 1em; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;AutoCompleteTextView&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;android:layout_width=&quot;wrap_content&quot;&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;android:layout_height=&quot;wrap_content&quot;&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;android:id=&quot;@+id/textInput&quot;&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;android:layout_marginTop=&quot;108dp&quot;&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;android:layout_alignParentTop=&quot;true&quot;&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;android:layout_alignParentLeft=&quot;true&quot;&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;android:layout_alignParentRight=&quot;true&quot;&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;android:editable=&quot;true&quot;&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;android:hint=&quot;Ingrese algo aqui&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Seguido de esto incluimos el siguiente código en la clase *.java&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(238, 238, 238); font-size: 0.8em; line-height: 13px; padding: 1em; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt; String PREFS_NAME &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&quot;PingBusPrefs&quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt; String PREFS_SEARCH_HISTORY &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&quot;SearchHistory&quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; SharedPreferences settings&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; Set&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; history&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;

&lt;center&gt;
&lt;script async src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- New2017a --&gt;
&lt;ins class=&quot;adsbygoogle&quot;
     style=&quot;display:inline-block;width:336px;height:280px&quot;
     data-ad-client=&quot;ca-pub-1329294398604545&quot;
     data-ad-slot=&quot;3854656133&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;

&lt;br/&gt;

Luego definimos el siguiente metodo:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(238, 238, 238); font-size: 0.8em; line-height: 13px; padding: 1em; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;setAutoCompleteSource&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
    AutoCompleteTextView textView &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;AutoCompleteTextView&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; findViewById&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;R&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;textInput&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
    ArrayAdapter&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; adapter &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; ArrayAdapter&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;gt;(&lt;/span&gt;
  &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; android&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;simple_list_item_1&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; history&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;toArray&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; String&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;history&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;()]));&lt;/span&gt;
    textView&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;setAdapter&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;adapter&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Guardamos cada valor introducido en el editor de texto:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(238, 238, 238); font-size: 0.8em; line-height: 13px; padding: 1em; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;addSearchInput&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;String input&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(!&lt;/span&gt;history&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;contains&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;input&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;))&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
        history&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;input&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
        setAutoCompleteSource&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Utilizamos el siguiente metodo para guardar las palabras introducidas en las preferencias compartidas:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(238, 238, 238); font-size: 0.8em; line-height: 13px; padding: 1em; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;savePrefs&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
    SharedPreferences settings &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; getSharedPreferences&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;PREFS_NAME&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
    SharedPreferences&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;Editor&lt;/span&gt; editor &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; settings&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;edit&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
    editor&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;putStringSet&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;PREFS_SEARCH_HISTORY&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; history&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;

    editor&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;commit&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Configuramos las siguientes variables:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(238, 238, 238); font-size: 0.8em; line-height: 13px; padding: 1em; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;settings &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; getSharedPreferences&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;PREFS_NAME&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
history &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; settings&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;getStringSet&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;PREFS_SEARCH_HISTORY&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; HashSet&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;gt;());&lt;/span&gt;

setAutoCompleteSource&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(238, 238, 238); font-size: 0.8em; line-height: 13px; padding: 1em; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt; AutoCompleteTextView textView &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;AutoCompleteTextView&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; findViewById&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;R&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;textInput&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
textView&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;setOnKeyListener&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; View&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;OnKeyListener&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;onKey&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;View v&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt; keyCode&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; KeyEvent event&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;font-style: italic; margin: 0px; padding: 0px;&quot;&gt;// If the event is a key-down event on the &quot;enter&quot; button&lt;/span&gt;
        &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;((&lt;/span&gt;event&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;getAction&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;==&lt;/span&gt; KeyEvent&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;ACTION_DOWN&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;
                &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;keyCode &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;==&lt;/span&gt; KeyEvent&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;KEYCODE_ENTER&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;))&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;

            addSearchInput&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;textView&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;getText&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;
            &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
        &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
        &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(238, 238, 238); font-size: 0.8em; line-height: 13px; padding: 1em; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;onStop&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;onStop&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;

    savePrefs&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;span style=&quot;margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/7058830385505374717/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2017/06/como-utilizar-el-autocomplete-en-un.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7058830385505374717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7058830385505374717'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2017/06/como-utilizar-el-autocomplete-en-un.html' title='Como utilizar el AutoComplete en un EditText en Android con historial'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-6370969390069017755</id><published>2017-06-29T21:31:00.000-07:00</published><updated>2017-06-29T21:31:30.905-07:00</updated><title type='text'>Como conectar una Base de Datos en MySQL con Netbeans 7</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
En este nuevo post veremos como conectarnos a una base de datos en MySQL desde Netbeans 7.1.&lt;br /&gt;
&lt;br /&gt;
Para poder crear la&amp;nbsp;conexion necesitaremos tener los siguientes componentes:&lt;br /&gt;
-Netbeans 7.1.&lt;br /&gt;
-Se necesitara tener instalado:&amp;nbsp;&lt;a href=&quot;http://dev.mysql.com/downloads/mysql/&quot; target=&quot;_blank&quot;&gt;MySQL.&lt;/a&gt;&lt;br /&gt;
-El driver para conectarnos a la base de datos:&lt;a href=&quot;https://www.dropbox.com/s/ra36e8q87tbdxgy/mysql-connector-java-5.0.8-bin.jar&quot; target=&quot;_blank&quot;&gt;&amp;nbsp;mysql-connector-java-5.0.8-bin.jar.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Una vez descargado el driver lo copiaremos a la carpeta donde se encuentra instalado el jdk, en mi caso es:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;C:\Program Files (x86)\Java\jdk1.6.0_31\jre\lib\ext&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
El siguiente paso es reiniciar el Netbeans.&lt;br /&gt;
&lt;br /&gt;
Ahora nos dirigimos a la pestana de netbeans llamada &lt;b&gt;Services, &lt;/b&gt;como se puede observar en la siguiente imagen y hacemos click derecho sobre &lt;b&gt;Drivers, &lt;/b&gt;y pulsamos en &lt;b&gt;New Driver&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmE5Gj1z9kaRSR731f4FJx862MYpEA1ydtah2M5btQeonSWWAW7iQE_7Q9WoNulrl_eYwxdr42EQsfgbkYPMLwjNNLEcgsD5N_LVNqh0vC0AQOZaHop-9J-LcpepJbrQz0uENx3XDX1WE/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;217&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmE5Gj1z9kaRSR731f4FJx862MYpEA1ydtah2M5btQeonSWWAW7iQE_7Q9WoNulrl_eYwxdr42EQsfgbkYPMLwjNNLEcgsD5N_LVNqh0vC0AQOZaHop-9J-LcpepJbrQz0uENx3XDX1WE/s320/1.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Luego pulsamos en &lt;b&gt;add.&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaeLq1ZSWnJxU_V8dGVJPCrYpDfBBJ4zpFGdDy_eim5_tGJjUGz8XjApg9mbauXYyh_dF3ZuyvwCAWMKiJUC-jXsWNui6xVkJCsmn-DOHE-xKjGOQUlfO0hz35I79APjsC5d1qckzQTVc/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;231&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaeLq1ZSWnJxU_V8dGVJPCrYpDfBBJ4zpFGdDy_eim5_tGJjUGz8XjApg9mbauXYyh_dF3ZuyvwCAWMKiJUC-jXsWNui6xVkJCsmn-DOHE-xKjGOQUlfO0hz35I79APjsC5d1qckzQTVc/s320/2.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Seleccionamos el archivo&amp;nbsp;&lt;b&gt;mysql-connector-java-5.0.8-bin.jar &lt;/b&gt;y pulsamos en &lt;b&gt;ok&lt;/b&gt;.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNU0zyvJxefM2TeCzh1A-FNvnDs_8jVcsf5z8mLtLs1OpquCfVQMeGpinjlX9a2RraiZ4A-mv5GopI-P-Q-4FO8qgL3Muwa1Dyfzs6FZEmXiJYRq-hmHow88dT5kWAUNzQXSBgFOvhlxI/s1600/3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;230&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNU0zyvJxefM2TeCzh1A-FNvnDs_8jVcsf5z8mLtLs1OpquCfVQMeGpinjlX9a2RraiZ4A-mv5GopI-P-Q-4FO8qgL3Muwa1Dyfzs6FZEmXiJYRq-hmHow88dT5kWAUNzQXSBgFOvhlxI/s320/3.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Deberia mostrarse de la siguiente manera:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhnXhf2uhNH0u7YOpnluU9kXpjuX9mi7x6RhUNSkwNmdXchY448JnsyWsAfcSKdf0gORQoHIk35VGqfxZcbkyjYQyAGnwylIJEtbZJ0Wmwco3jUHQW4SAsBl-OIuokVsMLMqc_qZRCLAU/s1600/4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhnXhf2uhNH0u7YOpnluU9kXpjuX9mi7x6RhUNSkwNmdXchY448JnsyWsAfcSKdf0gORQoHIk35VGqfxZcbkyjYQyAGnwylIJEtbZJ0Wmwco3jUHQW4SAsBl-OIuokVsMLMqc_qZRCLAU/s320/4.jpg&quot; width=&quot;309&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Nuestro siguiente paso es crear la conexion. Haremos click en &lt;b&gt;Connect Using &lt;/b&gt;como se observa en la siguiente imagen.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfFSPNZxXJcHplxcxqbZ-d_wqsgX8KsnUSJRyigb4AOwi3lUBKMfSmWi1LXkj_65UMrLPW7eZblQpi35xI-MthRcml1cJVGnRlvaRT-VvclbB2IhI-14pP3aJ0r5apaNo4aLlGNUHqP6E/s1600/5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfFSPNZxXJcHplxcxqbZ-d_wqsgX8KsnUSJRyigb4AOwi3lUBKMfSmWi1LXkj_65UMrLPW7eZblQpi35xI-MthRcml1cJVGnRlvaRT-VvclbB2IhI-14pP3aJ0r5apaNo4aLlGNUHqP6E/s320/5.jpg&quot; width=&quot;301&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Escribiremos los siguientes datos:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;Host:&lt;/b&gt; localhost&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;Database:&lt;/b&gt; mysql&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;Port:&lt;/b&gt; 3306&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;User Name:&lt;/b&gt; root&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;Password: &lt;/b&gt;12345&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Como se muestra a continuacion:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDdEb5XSREhwZNw-xL9TbLDv7ZoplyFqGlE7ID6sfiYnZPSGI8LlhpvcWzezzspYdUOQNlzoSpOnSmXWfHdIMGe_1lykDH_xxSbgml-ZQFV5uiKdSdnZicD1Nq9C62k2m5Ekp-TZsIeT0/s1600/6.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDdEb5XSREhwZNw-xL9TbLDv7ZoplyFqGlE7ID6sfiYnZPSGI8LlhpvcWzezzspYdUOQNlzoSpOnSmXWfHdIMGe_1lykDH_xxSbgml-ZQFV5uiKdSdnZicD1Nq9C62k2m5Ekp-TZsIeT0/s320/6.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/6370969390069017755/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2017/06/como-conectar-una-base-de-datos-en.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/6370969390069017755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/6370969390069017755'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2017/06/como-conectar-una-base-de-datos-en.html' title='Como conectar una Base de Datos en MySQL con Netbeans 7'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmE5Gj1z9kaRSR731f4FJx862MYpEA1ydtah2M5btQeonSWWAW7iQE_7Q9WoNulrl_eYwxdr42EQsfgbkYPMLwjNNLEcgsD5N_LVNqh0vC0AQOZaHop-9J-LcpepJbrQz0uENx3XDX1WE/s72-c/1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-7221533358087749001</id><published>2016-10-17T21:24:00.000-07:00</published><updated>2016-10-17T21:32:45.551-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio"/><category scheme="http://www.blogger.com/atom/ns#" term="Button"/><category scheme="http://www.blogger.com/atom/ns#" term="cambiar"/><category scheme="http://www.blogger.com/atom/ns#" term="edittext"/><category scheme="http://www.blogger.com/atom/ns#" term="font"/><category scheme="http://www.blogger.com/atom/ns#" term="fuente"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="letra"/><category scheme="http://www.blogger.com/atom/ns#" term="settypeface"/><category scheme="http://www.blogger.com/atom/ns#" term="textview"/><category scheme="http://www.blogger.com/atom/ns#" term="tipo"/><category scheme="http://www.blogger.com/atom/ns#" term="type"/><category scheme="http://www.blogger.com/atom/ns#" term="typeface"/><title type='text'>Como cambiar el tipo de letra (fuente) en una aplicacion movil para Android en Android Studio</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- octubre2016 --&gt;
&lt;br /&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;6148800538&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;

&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
En este post mostraremos como cambiar el tipo de fuente o tipo de letra de los Botones, EditText y TextView en una aplicacion movil en Android desde Android Studio. Esto es necesario cuando queremos crear una aplicacion movil personalizada y dar un toque unico.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Primero descargamos los tipos de fuentes que queramos utilizar en nuestra aplicacion movil en formato .tff. Yo los descargo de:&amp;nbsp;https://fonts.google.com/ y los colocamos dentro de la carpeta &quot;fonts&quot; (si no existe la creamos) dentro de &quot;assets&quot; en la ruta de la aplicacion. Quedando de la siguiente manera: &quot;main/assets/fonts&quot;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para este ejemplo definimos el archivo de interfaz de usuario prueba.xml:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #b0b7c1;&quot;&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;match_parent&quot; android:layout_height=&quot;match_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:background=&quot;@color/white&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Button&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:id=&quot;@+id/boton_prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:text=&quot;Boton de prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:textSize=&quot;24sp&quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;EditText&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:id=&quot;@+id/edit_text_prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:text=&quot;EditText de prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:textSize=&quot;24sp&quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;TextView&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:id=&quot;@+id/text_view_prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:text=&quot;TextView de prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:textSize=&quot;24sp&quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Luego, dentro del metodo onCreate() instanciamos los tipos de fuente agregados a la carpeta &quot;fonts&quot; previamente con la Clase &quot;Typeface&quot; y los definimos o seteamos para cada uno de los componentes del archivo prueba.xml definido anteriormente.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
protected void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // TODO Auto-generated method stub&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.prueba);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Button nameButton = (Button) findViewById(R.id.boton_prueba);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TextView nameTextView = (TextView) findViewById(R.id.text_view_prueba);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EditText nameEditText = (EditText) findViewById(R.id.edit_text_prueba);&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;Typeface face = Typeface.createFromAsset(getAssets(), &quot;fonts/JosefinSans-Regular.ttf&quot;);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;Typeface faceBold = Typeface.createFromAsset(getAssets(), &quot;fonts/JosefinSans-Bold.ttf&quot;);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;Typeface faceSemiBold = Typeface.createFromAsset(getAssets(), &quot;fonts/JosefinSans-SemiBold.ttf&quot;);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;nameButton.setTypeface(face);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;nameTextView.setTypeface(face);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;nameEditText.setTypeface(face);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
}
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/7221533358087749001/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2016/10/como-cambiar-el-tipo-de-letra-fuente-en.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7221533358087749001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7221533358087749001'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2016/10/como-cambiar-el-tipo-de-letra-fuente-en.html' title='Como cambiar el tipo de letra (fuente) en una aplicacion movil para Android en Android Studio'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-1171144134426484598</id><published>2016-10-16T21:08:00.001-07:00</published><updated>2016-10-17T10:21:24.424-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="adaptadores"/><category scheme="http://www.blogger.com/atom/ns#" term="alternar"/><category scheme="http://www.blogger.com/atom/ns#" term="alternos"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="colores"/><category scheme="http://www.blogger.com/atom/ns#" term="item"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="list"/><category scheme="http://www.blogger.com/atom/ns#" term="lista"/><category scheme="http://www.blogger.com/atom/ns#" term="listView"/><category scheme="http://www.blogger.com/atom/ns#" term="simple"/><category scheme="http://www.blogger.com/atom/ns#" term="view"/><title type='text'>Como alternar los colores de fondo en las filas de una lista (ListView) en Android</title><content type='html'>&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- octubre2016 --&gt;
&lt;br /&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;6148800538&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;br/&gt;
Cuando definimos listas en Android es muy comun encontrarnos con el problema de que los datos estan un poco desordenados y no se aprecian correctamente como deberian. Es por ello que algunos desarrolladores optan por colocar colores de fondo alternados a la lista para que la informacion se pueda apreciar de mejor manera.&lt;br /&gt;
&lt;br /&gt;
Primero tendremos que definir la lista (ListView) en la interfaz de usuario .xml. Definiremos el archivo prueba.xml:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color:#b0b7c1&quot;&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;match_parent&quot; android:layout_height=&quot;match_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:background=&quot;@color/white&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ListView&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;match_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;match_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:id=&quot;@+id/list_view_prueba&quot;&lt;br /&gt;
&amp;nbsp;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
Ahora en la clase respectiva se procede a instanciar la lista de la siguiente manera:&lt;br /&gt;
&lt;br /&gt;
ListView listaPrueba = (ListView) findById(R.id.list_view_prueba);&lt;br /&gt;
&lt;br /&gt;
Luego dentro del evento onCreate se realiza la colocacion de los colores de fondo de manera alternada:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color:#b0b7c1&quot;&gt;
protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // TODO Auto-generated method stub&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.prueba);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ListAdapter adaptador1 = new ArrayAdapter&amp;lt;String&amp;gt;(this, android.R.layout.simple_list_item_1, arrayItems){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public View getView(int position, View convertView, ViewGroup parent) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;View view = super.getView(position,convertView,parent);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (position %2 == 1) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; view.setBackgroundColor(Color.parseColor(&quot;#26CCCCCC&quot;));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; view.setBackgroundColor(Color.parseColor(&quot;#00FFFFFF&quot;));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return view;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;listaPrueba.setAdapter(adaptador1);&lt;br /&gt;
&lt;br /&gt;
}
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
donde:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;arrayItems &lt;/b&gt;es el array de elementos que estaran en la lista, por ejemplo:&lt;br /&gt;
&lt;br /&gt;
String[]&amp;nbsp;&lt;b&gt;arrayItems&amp;nbsp;&lt;/b&gt;= new String[]{&quot;item1&quot;, &quot;item2&quot;, &quot;item3&quot;, &quot;item4&quot;, &quot;item5&quot;};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Una vez realizado todo el proceso tendremos una lista con colores de fondo alternados para una mejor visualizacion de la informacion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/1171144134426484598/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2016/10/como-alternar-los-colores-de-fondo-en.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/1171144134426484598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/1171144134426484598'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2016/10/como-alternar-los-colores-de-fondo-en.html' title='Como alternar los colores de fondo en las filas de una lista (ListView) en Android'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-7159497009526510532</id><published>2016-10-16T20:52:00.002-07:00</published><updated>2016-10-17T10:27:20.420-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="boton"/><category scheme="http://www.blogger.com/atom/ns#" term="botones"/><category scheme="http://www.blogger.com/atom/ns#" term="Button"/><category scheme="http://www.blogger.com/atom/ns#" term="click"/><category scheme="http://www.blogger.com/atom/ns#" term="click listener"/><category scheme="http://www.blogger.com/atom/ns#" term="edit"/><category scheme="http://www.blogger.com/atom/ns#" term="edittext"/><category scheme="http://www.blogger.com/atom/ns#" term="eventlisteners"/><category scheme="http://www.blogger.com/atom/ns#" term="eventos"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="listeners"/><category scheme="http://www.blogger.com/atom/ns#" term="text"/><category scheme="http://www.blogger.com/atom/ns#" term="textview"/><category scheme="http://www.blogger.com/atom/ns#" term="view"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>Como habilitar los eventos de click o Click Listener de un Button, TextView o EditText en Android</title><content type='html'>&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- octubre2016 --&gt;
&lt;br /&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;6148800538&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;br/&gt;
En nuestras aplicaciones moviles es muy comun utilizar botones o campos de texto que permiten mostrar e ingresar datos para hacer mas interactiva la aplicacion.&lt;br /&gt;
&lt;br /&gt;
Los eventos desencadenados al presionar o hacer click sobre alguno de estos componentes son manejados desde la logica de la aplicacion, es decir desde los archivos .java.&lt;br /&gt;
&lt;br /&gt;
A continuacion mostraremos un boton, un editText y un textView con sus respectivos eventos click o Click Listeners.&lt;br /&gt;
&lt;br /&gt;
Primero definimos los componentes de la aplicacion en la interfaz de usuario, es decir en los archivos .xml. En este caso definiremos el archivo prueba.xml:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color:#b0b7c1&quot;&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;match_parent&quot; android:layout_height=&quot;match_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:background=&quot;@color/white&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Button&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:id=&quot;@+id/boton_prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:text=&quot;Boton de prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:textSize=&quot;24sp&quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;EditText&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:id=&quot;@+id/edit_text_prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:text=&quot;EditText de prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:textSize=&quot;24sp&quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;TextView&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:id=&quot;@+id/text_view_prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:text=&quot;TextView de prueba&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:textSize=&quot;24sp&quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
Ahora en la clase que controladora de esta interfaz colocaremos el siguiente codigo dentro del evento onCreate():&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color:#b0b7c1&quot;&gt;
protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // TODO Auto-generated method stub&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.prueba);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Button nameButton = (Button) findViewById(R.id.boton_prueba);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TextView nameTextView = (TextView) findViewById(R.id.text_view_prueba);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EditText nameEditText = (EditText) findViewById(R.id.edit_text_prueba);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;nameButton =.setOnClickListener(new View.OnClickListener() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onClick(View view) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //CODE EVENTO CLICK&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;nameTextView.setOnClickListener(new View.OnClickListener() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onClick(View view) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //CODE EVENTO CLICK&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nameEditText.setOnClickListener(new View.OnClickListener() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onClick(View view) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //CODE EVENTO CLICK&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&lt;br /&gt;
}
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Listo!! ahora podremos ejecutar cualquier codigo al presionar algun componente sobre la interfaz de usuario de Android.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/7159497009526510532/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2016/10/como-habilitar-los-eventos-de-click-o.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7159497009526510532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7159497009526510532'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2016/10/como-habilitar-los-eventos-de-click-o.html' title='Como habilitar los eventos de click o Click Listener de un Button, TextView o EditText en Android'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-2710347525561531538</id><published>2016-10-16T20:25:00.006-07:00</published><updated>2016-10-17T10:27:40.697-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="activity"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="aplicacion"/><category scheme="http://www.blogger.com/atom/ns#" term="app"/><category scheme="http://www.blogger.com/atom/ns#" term="apps"/><category scheme="http://www.blogger.com/atom/ns#" term="clase"/><category scheme="http://www.blogger.com/atom/ns#" term="intent"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="movil"/><category scheme="http://www.blogger.com/atom/ns#" term="nueva"/><category scheme="http://www.blogger.com/atom/ns#" term="start"/><category scheme="http://www.blogger.com/atom/ns#" term="ventana"/><title type='text'>Como abrir una nueva ventana o clase (Activity) in Java Android </title><content type='html'>&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- octubre2016 --&gt;
&lt;br /&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;6148800538&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;Cuando estamos empezando a programar aplicaciones moviles para Android necesitamos tener algunos conocimientos basicos de la programacion orientada a objetos y entender el funcionamiento de las clases .java (la logica de la aplicacion) y los archivos .xml (la interfaz de usuario).&lt;br /&gt;
&lt;br /&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;br/&gt;
En este post explicaremos la manera de abrir una nueva ventana, clase o Activity en Android. La manera de hacerlo en muy sencilla como se muestra en las siguientes lineas:&lt;br /&gt;
&lt;br /&gt;
Definiremos un nueva Intent y a continuacion lo iniciaremos:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color:#b0b7c1&quot;&gt;
Intent intent = new Intent(Splash.this,Tutorial.class);&lt;br /&gt;
startActivity(intent);
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
donde:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Splash&lt;/b&gt; es la clase .java actual.&lt;br /&gt;
&lt;b&gt;Tutorial&lt;/b&gt; es la clase .java que se quiere abrir.

</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/2710347525561531538/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2016/10/como-abrir-una-nueva-ventana-o-clase.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/2710347525561531538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/2710347525561531538'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2016/10/como-abrir-una-nueva-ventana-o-clase.html' title='Como abrir una nueva ventana o clase (Activity) in Java Android '/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-27970545139846367</id><published>2013-12-13T12:00:00.001-08:00</published><updated>2015-03-11T15:01:55.104-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clases"/><category scheme="http://www.blogger.com/atom/ns#" term="imagenes"/><category scheme="http://www.blogger.com/atom/ns#" term="images"/><category scheme="http://www.blogger.com/atom/ns#" term="imread"/><category scheme="http://www.blogger.com/atom/ns#" term="imshow"/><category scheme="http://www.blogger.com/atom/ns#" term="imwrite"/><category scheme="http://www.blogger.com/atom/ns#" term="matlab"/><category scheme="http://www.blogger.com/atom/ns#" term="transformar"/><category scheme="http://www.blogger.com/atom/ns#" term="whos"/><title type='text'>Como Utilizar Imagenes en Matlab</title><content type='html'>&lt;br /&gt;
En este nuevo post veremos algunas cosas muy utiles al momento que necesitemos trabajar con imagenes en matlab, aprenderemos como leer imagenes desde la computadora, como mostrarlas en un axes y como escribirlas (guardar) en la computadora.&lt;br /&gt;
&lt;br /&gt;
Una imagen en blanco/negro en matlab es representada por una matriz de dimensiones nxm, donde &quot;n&quot; representan las filas y &quot;m&quot; las columnas.&lt;br /&gt;
Para representar una imagen a color en matlab se necesitaran 3 matrices representando los colores basicos.&lt;br /&gt;
&lt;br /&gt;
Para leer una imagen desde la computadora aplicamos la siguiente sentencia:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;ruta = &#39;C:\Users\Rafa\Desktop\imagen1.jpg&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;A=imread(ruta);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
La variable &quot;A&quot; guardara la matriz de datos de la imagen. Para poder representar la imagen leida en una ventana utilizamos la siguiente sentencia:&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;imshow(A);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Para obtener el tamano de la imagen utilizamos:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;size(A);&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyM_0eWPz0Jy_5DLy5YjkJU87tpdrg9llST2JYf-CChXczWcJ3xBhf783709F8NVX9M1SwgF6F-Z30P2tQyT0Uyi4gkXuE_H8l0l6midIxxRyrZ4wHt3fLH1hIk2GrsMiKBVz-SMFMic/s1600/imag1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyM_0eWPz0Jy_5DLy5YjkJU87tpdrg9llST2JYf-CChXczWcJ3xBhf783709F8NVX9M1SwgF6F-Z30P2tQyT0Uyi4gkXuE_H8l0l6midIxxRyrZ4wHt3fLH1hIk2GrsMiKBVz-SMFMic/s1600/imag1.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
lo que representa que existen 3 matrices para cada uno de los colores basicos y el tamamo 375x600.&lt;/div&gt;
&lt;br /&gt;
Podemos aplicar la sentencia siguiente para obtener informacion detallada de la imagen leida.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;whos A;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtNYp56AbBUuavkGWA14pLj5luX6B9axz71BDwfA8fttiEcAR0hOF63tcE4QoHtrLsFBMXvydtm-8SnRcgjYy69XD-4NhL8fZqW4HopIVVfe8U0Sg3PIr0nZ0Iuzd5cBeZ0B-oF39Ynfk/s1600/imag2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtNYp56AbBUuavkGWA14pLj5luX6B9axz71BDwfA8fttiEcAR0hOF63tcE4QoHtrLsFBMXvydtm-8SnRcgjYy69XD-4NhL8fZqW4HopIVVfe8U0Sg3PIr0nZ0Iuzd5cBeZ0B-oF39Ynfk/s1600/imag2.JPG&quot; height=&quot;36&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span id=&quot;goog_1085835405&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1085835406&quot;&gt;&lt;/span&gt;Se puede observar algunos parametros obtenidos de la imagen leida como su nombre, su tamano, los bytes utilizados para representar la matriz, asi como su clase (clase de imagen) que en este caso es uint8 y sus atributos.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Clases de Imagenes:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;char: &lt;/b&gt;Para caracteres (2 bytes por elemento).&lt;br /&gt;
&lt;b&gt;double: &lt;/b&gt;Doble precision, numeros de punto flotante en un rango de -10^308 hasta 10^308 (8 bytes por elemento).&lt;br /&gt;
&lt;b&gt;int8: &lt;/b&gt;Enteros de 8 bits en el rango [-128, 127] (1 byte por elemento).&lt;br /&gt;
&lt;b&gt;int16:&amp;nbsp;&lt;/b&gt;Enteros de 16 bits en el rango [-32768, 32767] (2 byte por elemento).&lt;br /&gt;
&lt;b&gt;int32:&amp;nbsp;&lt;/b&gt;Enteros de 32 bits en el rango [-147483648,2147483647] (4 byte por elemento).&lt;br /&gt;
&lt;b&gt;logical: &lt;/b&gt;Representada por valores de 0 y 1 (1 byte por elemento).&lt;br /&gt;
&lt;b&gt;single: &lt;/b&gt;Numero de punto flotante de precision simple, con valores entre [-10^38, 10^38] (4 bytes por elemento).&lt;br /&gt;
&lt;b&gt;uint8: &lt;/b&gt;Enteros de 8 bits en el rango [0, 255] (1 byte por elemento).&lt;br /&gt;
&lt;b&gt;uint16:&amp;nbsp;&lt;/b&gt;Enteros de 16 bits en el rango [0, 65535] (2 byte por elemento).&lt;br /&gt;
&lt;b&gt;uint32:&amp;nbsp;&lt;/b&gt;Enteros de 32 bits en el rango [0, 4294967295] (4 byte por elemento).&lt;br /&gt;
&lt;br /&gt;
Para guardar una imagen en la computadora utilizaremos las siguientes sentencias:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;imwrite(f, &#39;nombre_imagen.jpeg&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Ademas se puede utilizar la sentencia siguiente para definir la calidad de la imagen que vamos a guardar, el valor de &quot;q&quot; varian de 0 a 100 representando la calidad respectivamente.&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;imwrite(A, &#39;nombre_imagen.jpeg&#39;,&#39;quality&#39;, q);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Para poder recuperar informacion correspondiente a la imagen que acabamos de guardar aplicamos lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;imfinfo nombre_imagen.jpeg;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp17Mp0qSk0uGtSEyAJuK7rwzVjekFJ_oy6ix3-5h7M1g-5MZ_P7hkzfFzCjO-jsJ7brdQ24m8oe_r2-vWOcDsefJxNgkEg_rxMCchP5xiLZ0m_5HCj59VHpU39BLX5RU8y1i4-g4dn8s/s1600/ejemploImag2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp17Mp0qSk0uGtSEyAJuK7rwzVjekFJ_oy6ix3-5h7M1g-5MZ_P7hkzfFzCjO-jsJ7brdQ24m8oe_r2-vWOcDsefJxNgkEg_rxMCchP5xiLZ0m_5HCj59VHpU39BLX5RU8y1i4-g4dn8s/s1600/ejemploImag2.JPG&quot; height=&quot;162&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Existen algunos comandos utilizados para tranformar entre las distintas clases de imagenes, como se &amp;nbsp;muestra a continuacion:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Nuestra imagen original guardada en A es:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKpO6j1WDRCVVvcDNWm59qEP2yOV_1A9Dj1_eSlTIKCm5urN9IXQYQK_SpmXt9gB8VWxcSlfARcdfvLTOHBQ2aA1FZ517Fp0_KmYrcN-R8-KdpEaMeRI47d6RU1MLtll9oM0ztn3wd0Jo/s1600/pf.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKpO6j1WDRCVVvcDNWm59qEP2yOV_1A9Dj1_eSlTIKCm5urN9IXQYQK_SpmXt9gB8VWxcSlfARcdfvLTOHBQ2aA1FZ517Fp0_KmYrcN-R8-KdpEaMeRI47d6RU1MLtll9oM0ztn3wd0Jo/s1600/pf.jpg&quot; height=&quot;216&quot; width=&quot;336&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;center&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- ClaseFile --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-slot=&quot;4804724939&quot; style=&quot;display: inline-block; height: 280px; width: 336px;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Al aplicar:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;im2bw(A)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
se obtiene:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAh_6WASWN_Nrj681iYnrI6hd8uizF4-EY95n33y6jR16GXKnZZZkRSIo4DcTGp9P21xGkPU4MgaYfOkpGr-wLYLjv1H5fQhd3cag7rowyH5MluCY08QnCecaX9GlCJcaUY_unQ3EriiY/s1600/pkbinar.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAh_6WASWN_Nrj681iYnrI6hd8uizF4-EY95n33y6jR16GXKnZZZkRSIo4DcTGp9P21xGkPU4MgaYfOkpGr-wLYLjv1H5fQhd3cag7rowyH5MluCY08QnCecaX9GlCJcaUY_unQ3EriiY/s1600/pkbinar.jpeg&quot; height=&quot;199&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Se tiene otros tipos de transformacion como:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;im2uint8(A);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;im2uint16(A);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;im2double(A);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/27970545139846367/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-manejar-imagenes-en-matlab.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/27970545139846367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/27970545139846367'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-manejar-imagenes-en-matlab.html' title='&lt;font color=&#39;#2E9AFE&#39;&gt;Como Utilizar Imagenes en Matlab&lt;/font&gt;'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyM_0eWPz0Jy_5DLy5YjkJU87tpdrg9llST2JYf-CChXczWcJ3xBhf783709F8NVX9M1SwgF6F-Z30P2tQyT0Uyi4gkXuE_H8l0l6midIxxRyrZ4wHt3fLH1hIk2GrsMiKBVz-SMFMic/s72-c/imag1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-6048146917295608905</id><published>2013-12-11T17:13:00.001-08:00</published><updated>2015-03-11T15:02:03.620-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="animacion"/><category scheme="http://www.blogger.com/atom/ns#" term="delay"/><category scheme="http://www.blogger.com/atom/ns#" term="easings"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="kinetic"/><category scheme="http://www.blogger.com/atom/ns#" term="movimiento"/><category scheme="http://www.blogger.com/atom/ns#" term="play"/><category scheme="http://www.blogger.com/atom/ns#" term="reverse"/><category scheme="http://www.blogger.com/atom/ns#" term="script"/><category scheme="http://www.blogger.com/atom/ns#" term="stage"/><category scheme="http://www.blogger.com/atom/ns#" term="texto"/><category scheme="http://www.blogger.com/atom/ns#" term="tweens"/><title type='text'>Como Hacer una Animacion de Movimiento de Texto En HTML</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
En este post mostraremos como realizar una animacion sencilla que refleje los distintos tipos de movimientos que se puede hacer con los textos.&lt;br /&gt;
&lt;br /&gt;
Crearemos un contenedor en el cual escribiremos 7 nombres que representan a: Java, Matlab, HTML, Threads, GUI, Button, JSF, cada nombre tendra un color y un efecto de movimiento diferente.&lt;br /&gt;
&lt;br /&gt;
Para este ejemplo haremos todo desde HTML y JavaScript, no utilizaremos CSS.&lt;br /&gt;
&lt;br /&gt;
Haremos uso del script &quot;&lt;a href=&quot;http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.7.4.min.js&quot; target=&quot;_blank&quot;&gt;Kinetic&lt;/a&gt;&quot;, el cual nos brindara un ambiente de javaScript, creando stages, layers y utilizaremos algunos de sus metodos para lograr los efectos que se obtuvieron en el ejemplo:&lt;br /&gt;
&lt;br /&gt;
El ejemplo se desarrollara dentro de las etiquetas &amp;lt;body&amp;gt; y &amp;lt;/body&amp;gt; y seguira de la siguiente manera:&lt;br /&gt;
&lt;br /&gt;
Para agregar el script Kinetic aplicamos la siguiente sentencia:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;script src=&quot;http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.7.4.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Una vez que se importa el script, se continua programando en JavaScript dentro de las sentencias siguientes:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.........codigo en javascript.........&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
E incluimos el siguiente codigo que permite agregar un contenedor donde incluiremos nuestros textos.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;/Creamos una nueva etapa llamada &quot;stage&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;var stage = new Kinetic.Stage({&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;container: &#39;container&#39;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;width: 600,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;height: 340&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;});&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;//Creamos nueva capa sobre la que colocaremos los easings&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;var layer = new Kinetic.Layer();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Creamos los textos al los que les pondremos los efectos de movimiento.&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;//Creamos la lista que se mostrara con su respectivo nombre,
      //color y efecto (easings).&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;var easings = [
        {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;easing:  &#39;ElasticEaseOut&#39;, name:&#39;Java&#39;, color:&#39;blue&#39;},&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp;{easing: &#39;BackEaseIn&#39;, name:&#39;Matlab&#39;, color:&#39;red&#39;},&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp;{easing: &#39;EaseOut&#39;, name:&#39;HTML&#39;,  color:&#39;green&#39;},&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp;{easing: &#39;EaseInOut&#39;, name:&#39;Threads&#39;,  color:&#39;blue&#39;},&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp;{easing: &#39;BackEaseIn&#39;, name:&#39;GUI&#39;,  color:&#39;yellow&#39;},&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp;{easing: &#39;EslasticEaseIn&#39;, name:&#39;Button&#39;,  color:&#39;red&#39;},&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp;{easing: &#39;BackEaseInOut&#39;, name:&#39;JSF&#39;,  color:&#39;orange&#39;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;]; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Como se puede observar en las sentencias anteriores los efectos vienen daros por:&amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;&#39;BackEaseIn, EaseOut, EaseInOut, etc. &lt;/span&gt;Existen otros efectos aparte de estos.&lt;br /&gt;
&lt;br /&gt;
Nuestro ejemplo se veria de la siguiente manera:&lt;br /&gt;
&lt;center&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- esferaOpenGL --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-slot=&quot;6117385065&quot; style=&quot;display: inline-block; height: 280px; width: 336px;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;div id=&quot;container&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.7.4.min.js&quot;&gt;&lt;/script&gt;
    &lt;script&gt;
      //Creamos una nueva etapa llamada &quot;stage&quot;  
      var stage = new Kinetic.Stage({
        container: &#39;container&#39;,
        width: 600,
        height: 340
      });
      
      //Creamos nueva capa sobre la que colocaremos los easings
      var layer = new Kinetic.Layer();

      //Creamos la lista que se mostrara con su respectivo nombre,
      //color y efecto (easings).
      var easings = [
        {easing:  &#39;ElasticEaseOut&#39;, name:&#39;Java&#39;, color:&#39;blue&#39;},
        {easing: &#39;BackEaseIn&#39;, name:&#39;Matlab&#39;, color:&#39;red&#39;},
        {easing: &#39;EaseOut&#39;, name:&#39;HTML&#39;,  color:&#39;green&#39;},
        {easing: &#39;EaseInOut&#39;, name:&#39;Threads&#39;,  color:&#39;blue&#39;},
        {easing: &#39;BackEaseIn&#39;, name:&#39;GUI&#39;,  color:&#39;yellow&#39;},
        {easing: &#39;BackEaseInOutCirc&#39;, name:&#39;Button&#39;,  color:&#39;red&#39;},
        {easing: &#39;Swing&#39;, name:&#39;JSF&#39;,  color:&#39;orange&#39;}
      ]; 

        var tweens = [];

      //Recorremos long de vector easings con el objetivo
      //de crear la lista, con numeracion, con especifico
      //tipo de letra y efecto.
      for(var n = 0; n &lt; easings.length; n++) {
        var separacion = 270;
        var num = n + 1;
        var ease = easings[n];
        var text = new Kinetic.Text({
          x: 10,
          y: 2 + ((n*separacion)/easings.length),
          padding: 10,
          text: num + &#39;) &#39; + ease.name,
          fontSize: 25,
          fontFamily: &#39;Calibri&#39;,
          fill: ease.color
        });

        //Agregamos el texto a la capa creada anteriormente
        layer.add(text);
        
        var tween = new Kinetic.Tween({
          node: text, 
          x: 350,
          easing: Kinetic.Easings[ease.easing],
          duration: 2
        });
        
        //Anade tween a vector tweens
        tweens.push(tween);
      }

      //Anade capa a la etapa creada al comienzo
      stage.add(layer);


        //Animacion hacia adelante
        //time: tiempo oscilacion
        function anim1(time){
            setTimeout(function(){
                for (var n=0; n&lt;tweens.length; n++) {
                    tweens[n].reverse(); 
                }
            },time);
        }
        //Animacion hacia atras
        //time: tiempo oscilacion
        function anim2(time){
            setTimeout(function(){
                for (var n=0; n&lt;tweens.length; n++) {
                    tweens[n].play(); 
                }
            },time);    
        }

        //Establece tiempos de oscilacion de las letras
        function animate (){
            for (var n=0; n&lt;tweens.length; n++) {
                tweens[n].play();
                for (var i=2000; i&lt;9000; i=i+4000) {
                    anim1(i);
                    anim2(i+2000);
                    anim1(i+4000);   
                }
            }
        }

      //Evento Boton Start
      //document.getElementById(&#39;start&#39;).addEventListener(&#39;click&#39;, function() {
        //Para establecer tiempos en los que las letras empiezan a oscilar  
        for (var i=1000; i&lt;200000; i=i+20000) {
            setTimeout(animate, i);           
        }  
                   
      //}, false); 

    &lt;/script&gt;

Para descargar el proyecto completo seguir los siguientes enlaces:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZbGRrdnpDQ2Q2ekE/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;DESCARGAR&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.dropbox.com/s/4bpkt4cgp51lli1/OscilacionLetrasHorizontal2.html&quot; target=&quot;_blank&quot;&gt;DESCARGAR&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/6048146917295608905/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-hacer-una-animacion-de-movimiento.html#comment-form' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/6048146917295608905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/6048146917295608905'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-hacer-una-animacion-de-movimiento.html' title='&lt;font color=&#39;#2E9AFE&#39;&gt;Como Hacer una Animacion de Movimiento de Texto En HTML&lt;/font&gt;'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-1822691592413020823</id><published>2013-12-08T11:13:00.001-08:00</published><updated>2015-03-11T15:02:11.046-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apuntes"/><category scheme="http://www.blogger.com/atom/ns#" term="css"/><category scheme="http://www.blogger.com/atom/ns#" term="hover"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="html/css"/><category scheme="http://www.blogger.com/atom/ns#" term="menu"/><category scheme="http://www.blogger.com/atom/ns#" term="menu vertical"/><category scheme="http://www.blogger.com/atom/ns#" term="style"/><title type='text'>Como Crear Menu Vertical en HTML y Decorar con CSS</title><content type='html'>&lt;br /&gt;
En este post ensenaremos como crear un menu vertical en html y decorarlo con css a partir de una lista simple creada con el siguiente codigo que lo colocaremos entre las etiquetas &amp;lt;body&amp;gt; y &amp;lt;/body&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;div id=&quot;menuVertical&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ul&amp;gt; &amp;nbsp; &amp;lt;!--Define la lista en&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;nbsp;&amp;nbsp;&amp;lt;!--Define cada elemento de la lista--&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/search/label/java&quot;&amp;gt; &amp;nbsp;Java &amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/search/label/matlab&quot;&amp;gt; Matlab &amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/search/label/html&quot;&amp;gt; &amp;nbsp;HTML &amp;nbsp;&amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;center&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- html3 --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-slot=&quot;5661576531&quot; style=&quot;display: inline-block; height: 250px; width: 300px;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
Lo cual se vera de la siguiente manera:&lt;br /&gt;
&lt;div id=&quot;menuVertical1&quot;&gt;
&lt;ul&gt;   &lt;!--Define la lista en si--&gt; 
                &lt;!--
&lt;li&gt;  Define cada elemento de la lista--&gt;
&lt;li&gt; &lt;a href=&quot;http://aflrovvs.blogspot.com/search/label/java&quot;&gt;&amp;nbsp; Java &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://aflrovvs.blogspot.com/search/label/matlab&quot;&gt; Matlab &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://aflrovvs.blogspot.com/search/label/html&quot;&gt;  HTML &amp;nbsp;&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
Para hacer que la lista luzca como un verdadero menu vertical aplicaremos algunos estilos con css, en los que se incluye codigo para eliminar las vinetas, eliminar el subrayado, colocar paneles detras de cada elemento, entr otros.
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para poder eliminar las vinetas colocaremos:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;list-style-type:none;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Dentro de la funcion&amp;nbsp;&lt;b&gt; #menuVertical ul{..}&lt;/b&gt; en la plantilla de nuestro blog dentro de la funcion &lt;b&gt;body {..}&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
En esta misma funcion definimos el color de fondo de cada elemento de menu y el color de los bordes de los paneles de los elementos de menu respectivamente:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;background:#CEFBF6;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;border:solid 5px #7FFEF1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
El radio de borde viene dado por:&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;border-radius:9px;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Para eliminar el subrayado colocaremos la sentencia siguiente:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;text-decoration: none;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Dentro de la funcion &lt;b&gt;#menuVertical ul a{..} &lt;/b&gt;en la plantilla de nuestro blog dentro de la funcion &lt;b&gt;body{...} &lt;/b&gt;debajo de la funcion&amp;nbsp; &lt;b&gt;#menuVertical ul {..}.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
En esta misma funcion colocamos el tamano de la fuente que viene definida por:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;font-size: 20px;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para crear el efecto de cambio de contraste al colocar el mouse sobre el menu aplicamos el siguiente codigo que lo unico que hace es mostrar una inversion de los colores para cada caso, es decir cuando no se coloca el mouse sobre el menu el color de cada elemento de menu esta variando de negro hasta blanco y al colocar el mouse sobre el elemento de menu, este varia de blanco a negro, lo que da el efecto de seleccionar tal elemento de menu.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;#menuVertical li a{&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; color:#06F;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; margin:0px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; background:linear-gradient(#fff 0%,#dedede 100%);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; background:-moz-linear-gradient(#fff 0%,#dedede 100%);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; background:-ms-linear-gradient(#fff 0%,#dedede 100%);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; background:-o-linear-gradient(#fff 0%,#dedede 100%);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; background:-webkit-linear-gradient(#fff 0%,#dedede 100%);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; border:solid 1px #f9f9f9;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; border-radius:15px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; padding:10px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;#menuVertical li a:hover{&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;background:linear-gradient(#DEDEDE 0%, #FFF 100%);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;background:-moz-linear-gradient(#DEDEDE 0%, #FFF 100%);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;background:-ms-linear-gradient(#DEDEDE 0%, #FFF 100%);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;background:-o-linear-gradient(#DEDEDE 0%, #FFF 100%);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;background:-webkit-linear-gradient(#DEDEDE 0%, #FFF 100%);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;border-radius:15px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;border:solid 4px #333;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;color: red;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Al aplicar estas sentencias y las demas que vienen incluidas en la carpeta del proyecto, nuestro menu deberia verse de la siguiente manera:&lt;/div&gt;
&lt;div id=&quot;menuVertical&quot;&gt;
&lt;ul&gt;   &lt;!--Define la lista en si--&gt; 
                &lt;!--
&lt;li&gt;  Define cada elemento de la lista--&gt;
&lt;li&gt;&lt;a href=&quot;http://aflrovvs.blogspot.com/search/label/java&quot;&gt;Java &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://aflrovvs.blogspot.com/search/label/matlab&quot;&gt; Matlab &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://aflrovvs.blogspot.com/search/label/html&quot;&gt;  HTM&lt;/a&gt;L&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Ademas se lo puede apreciar en la parte izquierda de nuestro blog.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Para descargar el proyecto seguir los enlaces siguientes:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.dropbox.com/s/ydp1427amt1vyjh/indexVertical1.html&quot; target=&quot;_blank&quot;&gt;DESCARGAR&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZaHdWVkUwUUU0X3c/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;DESCARGAR&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/1822691592413020823/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-crear-menu-vertical-en-html-y.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/1822691592413020823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/1822691592413020823'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-crear-menu-vertical-en-html-y.html' title='&lt;font color=&#39;#2E9AFE&#39;&gt;Como Crear Menu Vertical en HTML y Decorar con CSS&lt;/font&gt;'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-5818306989204944276</id><published>2013-12-07T17:39:00.000-08:00</published><updated>2015-03-11T15:02:20.461-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="css"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="html/css"/><category scheme="http://www.blogger.com/atom/ns#" term="listas"/><category scheme="http://www.blogger.com/atom/ns#" term="menu"/><category scheme="http://www.blogger.com/atom/ns#" term="submenu"/><title type='text'>Como crear un Menu con Submenus en HTML decorado con CSS</title><content type='html'>&lt;br /&gt;
En este nuevo post crearemos un menu que contenga submenus, cada uno de los cuales estara enlazado a paginas de este blog.&lt;br /&gt;
Utilizaremos herramientas de html/css para poder dar ciertos efectos a los menus.&lt;br /&gt;
&lt;br /&gt;
Para crear el menu utilizaremos el siguiente codigo, que estara dentro de la etiqueta &amp;lt;body&amp;gt;.&lt;br /&gt;
&lt;center&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- matlab5 --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-slot=&quot;3840092933&quot; style=&quot;display: inline-block; height: 250px; width: 300px;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;div id=&#39;subMenu&#39;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;ul&amp;gt; &amp;nbsp; &amp;lt;!--Define la lista en si--&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/&quot;&amp;gt; &amp;nbsp;Inicio &amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/p/descargas.html&quot;&amp;gt; Descargas &amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;ul&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt; &amp;lt;a href=&quot;https://skydrive.live.com/#cid=CB2C976AE9CB5D07&amp;amp;id=CB2C976AE9CB5D07%21278&quot;&amp;gt; SkyDrive &amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt; &amp;lt;a href=&quot;https://www.dropbox.com/sh/kotx2ml5a097vlv/C1YPyPd7QL&quot;&amp;gt; DropBox &amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/ul&amp;gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/p/sobre-mi.html&quot;&amp;gt; &amp;nbsp;Sobre Mi &amp;nbsp;&amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/p/contacto.html&quot;&amp;gt; &amp;nbsp;Contacto &amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
El cual contendra los submenus con sus respectivos enlaces y quedara de la siguiente manera:&lt;br /&gt;
&lt;div id=&quot;subMenu&quot;&gt;
&lt;ul&gt;   &lt;!--Define la lista en si--&gt;
&lt;li&gt; &lt;a href=&quot;http://aflrovvs.blogspot.com/&quot;&gt;&amp;nbsp; Inicio &lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
                   &lt;a href=&quot;http://aflrovvs.blogspot.com/p/descargas.html&quot;&gt; Descargas &lt;/a&gt;
                    &lt;ul&gt;
&lt;li&gt; &lt;a href=&quot;https://skydrive.live.com/#cid=CB2C976AE9CB5D07&amp;amp;id=CB2C976AE9CB5D07%21278&quot;&gt; SkyDrive &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;https://www.dropbox.com/sh/kotx2ml5a097vlv/C1YPyPd7QL&quot;&gt; DropBox &lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://aflrovvs.blogspot.com/p/sobre-mi.html&quot;&gt;  Sobre Mi  &lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://aflrovvs.blogspot.com/p/contacto.html&quot;&gt;  Contacto&lt;/a&gt;&lt;a href=&quot;http://aflrovvs.blogspot.com/p/contacto.html&quot;&gt;&amp;nbsp;&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Para colocarlo de una manera horizontal debemos colocar un codigo extra entre las etiquetas &amp;lt;style&amp;gt; por debajo de &amp;lt;title&amp;gt;, el cual se incluira en el archivo del proyecto que esta disponible para descargar en el siguiente enlace:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
El menu se vara asi:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyatNcd4OMXzfInGbRFShOuztMMA0fI3f7ldcaA6kxiKy8brRc2RZ44bRnl0GhZSGg5djX3ZmidYrVq-AM8Z-OI2ILcqvjOLIe8vyVI4dOxuRZyiXOkpZ6bZbU7xk1DKdKrBO0YSxlE7c/s1600/submenu1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyatNcd4OMXzfInGbRFShOuztMMA0fI3f7ldcaA6kxiKy8brRc2RZ44bRnl0GhZSGg5djX3ZmidYrVq-AM8Z-OI2ILcqvjOLIe8vyVI4dOxuRZyiXOkpZ6bZbU7xk1DKdKrBO0YSxlE7c/s400/submenu1.JPG&quot; height=&quot;50&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.dropbox.com/s/qdrg04xm8pnnjmg/MenSubMenu.rar&quot; target=&quot;_blank&quot;&gt;DESCARGAR&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZd1Z6QnlxWXZiZ28/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;DESCARGAR&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/5818306989204944276/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-crear-un-menu-con-submenus-en-html.html#comment-form' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/5818306989204944276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/5818306989204944276'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-crear-un-menu-con-submenus-en-html.html' title='&lt;font color=&#39;#2E9AFE&#39;&gt;Como crear un Menu con Submenus en HTML decorado con CSS&lt;/font&gt;'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyatNcd4OMXzfInGbRFShOuztMMA0fI3f7ldcaA6kxiKy8brRc2RZ44bRnl0GhZSGg5djX3ZmidYrVq-AM8Z-OI2ILcqvjOLIe8vyVI4dOxuRZyiXOkpZ6bZbU7xk1DKdKrBO0YSxlE7c/s72-c/submenu1.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-8584544310474418094</id><published>2013-12-07T16:27:00.001-08:00</published><updated>2015-03-11T15:02:28.213-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blog"/><category scheme="http://www.blogger.com/atom/ns#" term="blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="blogspot"/><category scheme="http://www.blogger.com/atom/ns#" term="css"/><category scheme="http://www.blogger.com/atom/ns#" term="efecto menu"/><category scheme="http://www.blogger.com/atom/ns#" term="horizontal"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="imagenes"/><category scheme="http://www.blogger.com/atom/ns#" term="images"/><category scheme="http://www.blogger.com/atom/ns#" term="insertan imagenes"/><category scheme="http://www.blogger.com/atom/ns#" term="menu"/><title type='text'>Como Insertar Imagenes y Crear Menus Horizontales con HTML/CSS</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
El primer post dedicado al lenguaje HTML es sobre como insertar imagenes que esten alojadas en internet y la creacion de menus horizontales disenados con herramientas de CSS.&lt;br /&gt;
&lt;br /&gt;
Este post en particular muestra el diseno del banner principal y del menu horizontal alojado en este blog.&lt;br /&gt;
&lt;center&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- matlab5 --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-slot=&quot;3840092933&quot; style=&quot;display: inline-block; height: 250px; width: 300px;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
El codigo consta de 3 partes: la primera es la colocacion del banner principal, seguida de la creacion del menu , para luego agregar ciertas caracteristicas de diseno al menu creado.&lt;br /&gt;
&lt;br /&gt;
Para Insertar la Imagen utilizaremos el codigo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;center&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;div id=&quot;carga&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;img src=&quot;http://drive.google.com/uc?export=view&amp;amp;id=0B1kFwZU59fWZYVRKMWUycFlJenM&quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bord &amp;nbsp;=&quot;0&quot; height=&quot;197&quot; width=&quot;1000&quot; &quot;&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Estas lineas se colocan debajo de donde empieza &amp;lt;body&amp;gt;, la direccion de la imagen es insertada justo en medio de las comillas de la seguiente sentencia &amp;lt;img src=&quot; &quot;&amp;gt;. La altura y ancho de la imagen se controlan con &quot;height&quot; y &quot;width&quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; y &amp;lt;/center&amp;gt; son utilizadas para centrar la imagen.&lt;br /&gt;
&lt;br /&gt;
Para la creacion del menu se utilizan las siguientes lineas de codigo, las cuales se colocan abajo del codigo utilizado para insertar la imagen, dentro de la etiqueta &amp;lt;body&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;div id=&#39;cssmenu&#39;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;ul&amp;gt; &amp;nbsp; &amp;lt;!--Define la lista en si--&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/&quot;&amp;gt; &amp;nbsp;Inicio &amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/p/descargas.html&quot;&amp;gt; Descargas &amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/p/sobre-mi.html&quot;&amp;gt; &amp;nbsp;Sobre Mi &amp;nbsp;&amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt; &amp;lt;a href=&quot;http://aflrovvs.blogspot.com/p/contacto.html&quot;&amp;gt; &amp;nbsp;Contacto &amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
En la primera linea colocamos el nombre de nuestro menu: &quot;cssmenu&quot;.&lt;br /&gt;
En la segunda linea creamos la lista que contendra cada elemento del meno con la etiqueta &quot;&amp;lt;ul&amp;gt;&quot;.&lt;br /&gt;
Desde la tercera linea a traves de la etiqueta &quot;&amp;lt;li&amp;gt;&quot; se puede crear cada uno de los elementos del menu, sobre los cuales se colocan su respectivo nombre y su enlace al cual nos dirigiremos al hacer click. En nuestro caso cada uno de los enlaces son paginas creadas previamente en mi blog.&lt;br /&gt;
&lt;br /&gt;
Quedando de la siguiente manera:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVIoBO1s8nnYKc6peSTeWdEsbQNrZYBIPHNLniHSx4p6HkLh_EkpkJAhH86bz1gtfc2JiNzXu6f_rqvY49vyqduedm9YJElHTeNGpkbGvVIM1TAeoQt1gfLBgqIuMAJ0N0YPDM-EnczQ8/s1600/imagenMenu1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVIoBO1s8nnYKc6peSTeWdEsbQNrZYBIPHNLniHSx4p6HkLh_EkpkJAhH86bz1gtfc2JiNzXu6f_rqvY49vyqduedm9YJElHTeNGpkbGvVIM1TAeoQt1gfLBgqIuMAJ0N0YPDM-EnczQ8/s400/imagenMenu1.JPG&quot; height=&quot;121&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Como se observa el menu se crea de una manera simpre y en forma vertical, para convertir el menu a una forma horizontal y con colores y sombras aplicamos las siguientes sentencias:&lt;br /&gt;
&lt;br /&gt;
Estas funciones se colocan entre las etiquetas&amp;nbsp;&amp;lt;style type=&quot;text/css&quot;&amp;gt; y &amp;nbsp;&amp;lt;/style&amp;gt; por debajo de &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;.&lt;br /&gt;
Esta primera funcion pinta del color azul el panel de fondo donde colocaremos el menu, ademas redondea el panel creado pintado de azul.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;#cssmenu {        
        width:100%;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp;background-color: #62a8f6;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp;border-top-left-radius:34px;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp;border-top-right-radius:34px;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp;border-bottom-left-radius:34px;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp;border-bottom-right-radius:34px;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
Esta funcion acompanada de la siguiente colocan la lista de una forma horizontal, ademas colocan las coordenas donde se situara el menu y tamano de paneles que lo contendran.&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;#cssmenu ul {&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; list-style-type:none;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; height: 40px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; width: 534px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; margin: auto;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; position:relative;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; display:block;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
Esta funcion en la 3 linea coloca el color de cada elemento de menu, el la 4 linea asigna la separacion que mantendran los elementos del menu, en la 5 linea pondremo un borde a cada elemento de menu con su repectivo color y en la ultima linea redondeamos las esquinas de los paneles que contienen a lso elementos de menu.&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;#cssmenu li a{&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; float: left;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; background-color: #d4eaff;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; margin:0px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; border:solid 1px #f9f9f9;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; border-radius:15px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
Esta funcion es la encargada de crear el efecto de cambiar de color que realiza el menu al colocar el puntero sobre cada uno de los elementos de menu.&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
En la segunda linea asignamos el color al que cambiara, en nuestro caso sera el azul de fondo.&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
En la tercera linea asignamos el nivel de redondeado.&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
En la ultima linea colocamos un borde de color negro.&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;#cssmenu li a:hover {&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; background-color: #6285f5;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; border-radius:15px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; border:solid 1px #000;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
Esta ultima funcion se encarga de realizar algunas funciones como quitar el subrayado con la linea 5.&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
Ademas en las lineas 2 y 3 controlamos el largo de los paneles de cada unos de los elementos de menu.&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
En la linea 4 establecemos el ancho de los paneles que contiene los elementos de menu.&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;#cssmenu ul a {&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; padding-right: 32px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; padding-left: 32px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; display: block;
        line-height: 40px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; text-decoration: none; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; font-family: Georgia, &quot;Times New Roman&quot;, Times, serif, fantasy;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; font-size: 18px;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; color: #FC4A04;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
El programa quedara de la siguiente manera:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjofMSJxP5LPS1yoGWO8-4vdViXMrASW1ODbhA7Dh1a4tBA2WUf1QszhQr4lzt7z8BwB1Bez6ewSouwcdZJfBa9HLII9y0nxWoKLazgRXd1l5pHZLdAc2a6OicCUxlVu4EUIzDXYvbYpfc/s1600/imagenMenu2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjofMSJxP5LPS1yoGWO8-4vdViXMrASW1ODbhA7Dh1a4tBA2WUf1QszhQr4lzt7z8BwB1Bez6ewSouwcdZJfBa9HLII9y0nxWoKLazgRXd1l5pHZLdAc2a6OicCUxlVu4EUIzDXYvbYpfc/s400/imagenMenu2.JPG&quot; height=&quot;80&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
Para &lt;span style=&quot;font-size: large;&quot;&gt;descargar&lt;/span&gt; el proyecto completo seguir cualquiera de los enlaces siguientes:&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.dropbox.com/s/745du07wd1cbu0v/Menu11.rar&quot; target=&quot;_blank&quot;&gt;Dropbox&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZME9Ybi1JLW4tb3c/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Google Drive&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;carga&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/8584544310474418094/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-insertar-imagenes-y-crear-menus.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/8584544310474418094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/8584544310474418094'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-insertar-imagenes-y-crear-menus.html' title='&lt;font color=&#39;#2E9AFE&#39;&gt;Como Insertar Imagenes y Crear Menus Horizontales con HTML/CSS&lt;/font&gt;'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVIoBO1s8nnYKc6peSTeWdEsbQNrZYBIPHNLniHSx4p6HkLh_EkpkJAhH86bz1gtfc2JiNzXu6f_rqvY49vyqduedm9YJElHTeNGpkbGvVIM1TAeoQt1gfLBgqIuMAJ0N0YPDM-EnczQ8/s72-c/imagenMenu1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-1282296850271018580</id><published>2013-12-07T11:44:00.001-08:00</published><updated>2015-03-11T15:02:35.633-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="axes"/><category scheme="http://www.blogger.com/atom/ns#" term="botones"/><category scheme="http://www.blogger.com/atom/ns#" term="cargar imagenes"/><category scheme="http://www.blogger.com/atom/ns#" term="imread"/><category scheme="http://www.blogger.com/atom/ns#" term="leer imagenes"/><category scheme="http://www.blogger.com/atom/ns#" term="matlab"/><category scheme="http://www.blogger.com/atom/ns#" term="matrices"/><category scheme="http://www.blogger.com/atom/ns#" term="read images"/><category scheme="http://www.blogger.com/atom/ns#" term="static text"/><title type='text'>Como cargar Imagenes en Axes en GUI en Matlab y convertirlas en Matrices de datos</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
En este post leeremos y cargaremos 2 imagenes ubicadas en la carpeta donde se encuentran los archivos .m y .fig del programa.&lt;br /&gt;
Ambas imagenes seran leidas por la funcion imread() para luego ser mostradas en los axes.&lt;br /&gt;
Las imagenes son leidas como una matriz de datos binarios (En este caso ya que solo se trabaja con valores de 0=negro, 1=blanco).&lt;br /&gt;
Las imagenes son de tamano 8x8, por lo tanto cada matriz sera de dimensiones 8x8, donde cada posicion de la matriz contendra valores entre 0 y 1.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB4FD9ydoFohNqGLLlKI1HUlO4pFT98qNrRV2nYE-_z13rDxPWaKH8vp6JWy2jvAU5WMiNKcp2-h3QcIs5GufplZhKlVZ8lo_EeXDRTT5ZdasWfVNgl8XyEXp9CgxRQZGeVYTcTqa2TnQ/s1600/images1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB4FD9ydoFohNqGLLlKI1HUlO4pFT98qNrRV2nYE-_z13rDxPWaKH8vp6JWy2jvAU5WMiNKcp2-h3QcIs5GufplZhKlVZ8lo_EeXDRTT5ZdasWfVNgl8XyEXp9CgxRQZGeVYTcTqa2TnQ/s320/images1.JPG&quot; height=&quot;250&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;center&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- matlab5 --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-slot=&quot;3840092933&quot; style=&quot;display: inline-block; height: 250px; width: 300px;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
Las siguientes lineas de codigo representan el evento que se realizara al presionar sobre el boton &quot;Cargar Images&quot;.&lt;br /&gt;
&lt;br /&gt;
Seleccionamos el axes1.&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;axes(handles.axes1);&lt;/span&gt;&lt;br /&gt;
Guardamos el parth de la primera imagen&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;path = &#39;\MATLAB\a2.bmp&#39;;&lt;/span&gt;&lt;br /&gt;
Leemos la imagen convirtiendola en una matriz&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;imag = imread(path);&lt;/span&gt;&lt;br /&gt;
Mostramos la imagen en el axes&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;imshow(imag);&lt;/span&gt;&lt;br /&gt;
Desabilitamos los ejes vertical y horizontal&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;axis off;&lt;/span&gt;&lt;br /&gt;
Mostramos la matriz que representa la primera&lt;br /&gt;
imagen y mostramos en un static text.&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;set(handles.text1,&#39;String&#39;,num2str(imag));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Repetimos el procedimiento para la segunda&lt;br /&gt;
imagen que sera mostrada sobre el axes2.&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;axes(handles.axes2);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;path = &#39;\MATLAB\e0.bmp&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;imag = imread(path);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;imshow(imag);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;axis off;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;set(handles.text2,&#39;String&#39;,num2str(imag));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Otra cosa importante que se debe de tomar en cuenta es que los &quot;Static Text&quot; deber ser modificados desde la GUI haciendo click derecho sobre cada static text y variando el valor de &quot;max&quot; hasta 10.&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4Mg2Mb9VWFgEpqAcNaZRgHhOv1LQ4V6g6tq36Fzr7ccfhQjKawBaYwrXBEP69LGA71cs29kcjlQBBFJD0pp_QpDMjamHCPJzfMWJkLxh0gMEZBORaZsq2tnR9oSGPftNAhaf909D5zxE/s1600/images2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4Mg2Mb9VWFgEpqAcNaZRgHhOv1LQ4V6g6tq36Fzr7ccfhQjKawBaYwrXBEP69LGA71cs29kcjlQBBFJD0pp_QpDMjamHCPJzfMWJkLxh0gMEZBORaZsq2tnR9oSGPftNAhaf909D5zxE/s320/images2.JPG&quot; height=&quot;316&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
A continuacion en los enlaces siguientes se puede descargar los archivos e imagenes utilizados en el programa.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZb01qdjVSTFBIX1E/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Archivo.m&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZUGY0SDhlNVFSejQ/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Archivo.fig&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZNWozY056dmhFTmc/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Imagen1&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZaVV5OE9lbnA0amM/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Imagen2&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/1282296850271018580/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-cargar-imagenes-en-axes-en-gui-en.html#comment-form' title='3 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/1282296850271018580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/1282296850271018580'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-cargar-imagenes-en-axes-en-gui-en.html' title='&lt;font color=&#39;#2E9AFE&#39;&gt;Como cargar Imagenes en Axes en GUI en Matlab y convertirlas en Matrices de datos&lt;/font&gt;'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB4FD9ydoFohNqGLLlKI1HUlO4pFT98qNrRV2nYE-_z13rDxPWaKH8vp6JWy2jvAU5WMiNKcp2-h3QcIs5GufplZhKlVZ8lo_EeXDRTT5ZdasWfVNgl8XyEXp9CgxRQZGeVYTcTqa2TnQ/s72-c/images1.JPG" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-950296479604883787</id><published>2013-12-07T09:38:00.003-08:00</published><updated>2013-12-07T12:12:09.703-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="axes"/><category scheme="http://www.blogger.com/atom/ns#" term="botones"/><category scheme="http://www.blogger.com/atom/ns#" term="Button"/><category scheme="http://www.blogger.com/atom/ns#" term="gui"/><category scheme="http://www.blogger.com/atom/ns#" term="handles"/><category scheme="http://www.blogger.com/atom/ns#" term="linewidth"/><category scheme="http://www.blogger.com/atom/ns#" term="matlab"/><category scheme="http://www.blogger.com/atom/ns#" term="plot"/><title type='text'>Como Utilizar y Elegir los Axes en GUI en Matlab</title><content type='html'>&lt;br /&gt;
En este nuevo sencillo ejemplo mostraremos como utilizar los axes en la gui de matlab, graficando algunas funciones sobre los mismos.&lt;br /&gt;
Utilizaremos un boton para mandar a graficar las diferentes funciones sobre los 3 axes.&lt;br /&gt;
Ademas resolveremos el problema de no saber seleccionar el axes sobre el cual se requiere trabajar, para solucionar este problema utilizaremos la sentencia siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3ryogMnUN2cTdL6drr_qrONJUVPwYTxqbcxLpVY1FUMtmjZcuEbspZIQMKmH8O-cl1k3dNxsnIcmvmKdpS3f9-LRnHQ62xpv66cc5zX1C5QA5IoJFo0OhG5F_UGMOV0F5yJoDr4UgIx4/s1600/axes1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3ryogMnUN2cTdL6drr_qrONJUVPwYTxqbcxLpVY1FUMtmjZcuEbspZIQMKmH8O-cl1k3dNxsnIcmvmKdpS3f9-LRnHQ62xpv66cc5zX1C5QA5IoJFo0OhG5F_UGMOV0F5yJoDr4UgIx4/s320/axes1.JPG&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;center&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- matlab5 --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-slot=&quot;3840092933&quot; style=&quot;display: inline-block; height: 250px; width: 300px;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;axes(handles.axes1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Esta sentencia permite seleccionar el axes sobre el que se va a trabajar en ese instante.&lt;br /&gt;
En las siguientes lineas de codigo observamos que en la linea 4 se graficara sobre el axes1 que se selecciono con anterioridad en la linea 1.&lt;br /&gt;
Asimismo en la linea 9 se graficara sobre el axes 2 ya que se selecciono con anterioridad en la linea 6.&lt;br /&gt;
&lt;br /&gt;
Las lineas 2 y 7 crean una variable que va desde 1 hasta 10/15 variando cada 0.001 para ser utilizada para graficar.&lt;br /&gt;
&lt;br /&gt;
Las funciones plot() sirven para graficar sobre los axes seleccionados, permite colocar parametros como el LineWidth, el cual establece el ancho de la linea que se grafica.&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;axes(handles.axes1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;x1 = [1:0.001:10];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;x2 = 2-x1*3;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;plot(x1,x2,&#39;red&#39;,&#39;LineWidth&#39;, 2.5);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;axes(handles.axes2);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;x1 = [1:0.001:15];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;x2 = x1*3/9;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;plot(x1,x2,&#39;LineWidth&#39;, 2.5);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_5AOMr8q2nX7KCarHBrnGQo3isz4fCyq3sdTv9fTqX6n52TCHs4A7H5c6XydPXhKmpZezamrBB4b38bFimEoXNwH1FNBfXI6FUwG5V8aRz-V21735PeQPNDguqQegoFCEY1sB0GW8pZc/s1600/axes2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;224&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_5AOMr8q2nX7KCarHBrnGQo3isz4fCyq3sdTv9fTqX6n52TCHs4A7H5c6XydPXhKmpZezamrBB4b38bFimEoXNwH1FNBfXI6FUwG5V8aRz-V21735PeQPNDguqQegoFCEY1sB0GW8pZc/s320/axes2.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
Para descargar los archivos del programa seguir los enlaces siguientes:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZR0NRR2J0alA0QnM/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Archivo.m&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZbUl6aXg3TC1TbFE/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Archivo.fig&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/950296479604883787/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-utilizar-y-elegir-los-axes-en-gui.html#comment-form' title='6 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/950296479604883787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/950296479604883787'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-utilizar-y-elegir-los-axes-en-gui.html' title='Como Utilizar y Elegir los Axes en GUI en Matlab'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3ryogMnUN2cTdL6drr_qrONJUVPwYTxqbcxLpVY1FUMtmjZcuEbspZIQMKmH8O-cl1k3dNxsnIcmvmKdpS3f9-LRnHQ62xpv66cc5zX1C5QA5IoJFo0OhG5F_UGMOV0F5yJoDr4UgIx4/s72-c/axes1.JPG" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-3596209351022116552</id><published>2013-12-07T09:02:00.005-08:00</published><updated>2013-12-07T09:02:53.684-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="global"/><category scheme="http://www.blogger.com/atom/ns#" term="matlab"/><category scheme="http://www.blogger.com/atom/ns#" term="matrices"/><category scheme="http://www.blogger.com/atom/ns#" term="rand"/><category scheme="http://www.blogger.com/atom/ns#" term="randi"/><category scheme="http://www.blogger.com/atom/ns#" term="randn"/><category scheme="http://www.blogger.com/atom/ns#" term="redimensionar"/><category scheme="http://www.blogger.com/atom/ns#" term="reshape"/><category scheme="http://www.blogger.com/atom/ns#" term="variables"/><category scheme="http://www.blogger.com/atom/ns#" term="variables globales"/><title type='text'>Como utilizar Global, Rand, Reshape en Matlab</title><content type='html'>&lt;br /&gt;
Este post pretende explicar algunas sentencias muy basicas pero que a la vez son muy utiles a lo hora que se necesita trabajar con Matlab, nos concentramos en los siguientes conceptos:&lt;br /&gt;
&lt;br /&gt;
Trabajar con variables tipo &quot;global&quot; en Matlab.&lt;br /&gt;
Genear numeros, matrices aleatorias con la funcion &quot;rand&quot;.&lt;br /&gt;
Redimensionar el tamano de una matriz con la funcion &quot;reshape&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Variables Globales:&lt;/b&gt;&lt;br /&gt;
Son variables que se puede utilizar en cualquier momento y desde cualquier funcion definida en el archivo .m.&lt;br /&gt;
El unico requisito es declarar las variables en cada una de las funciones donde se la vaya a utilizar.&lt;br /&gt;
&lt;br /&gt;
A continuacion planteamos un ejemplo:&lt;br /&gt;
Tenemos 2 funciones en un archivo .m en matlab, lo cual quedaria asi:&lt;br /&gt;
&lt;center&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- matlab4 --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-slot=&quot;8968296532&quot; style=&quot;display: inline-block; height: 250px; width: 300px;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;function func1(hObject, eventdata, handles)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;global var2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;var1 = [1:1:10];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;var2 = sum(var1/(7-var1));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;function func2(hObject, eventdata, handles)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;global var2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;disp(var2);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
En el ejemplo anterior se puede observar que gracias a la definicion de la variable global var2 se puede utilizar esta variable en ambas funciones.&lt;br /&gt;
En la primera funcion definimos &quot;var1&quot; como una variable que varia de uno en uno desde 1 hasta 10 y la variable &quot;var2&quot; realiza la suma para todos los valores de &quot;var1&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Funcion Rand:&lt;/b&gt;&lt;br /&gt;
Esta funcion nos permite generar numeros aleatorios en intervalos determinados, ademas nos permite crear vectores y matrices de numeros aleatorios, para lo cual se puede utilizar las siguientes sentencias:&lt;br /&gt;
&lt;br /&gt;
rand(1) --&amp;gt; genera un numero aleatorio entre 0 y 1.&lt;br /&gt;
rand(5,1) --&amp;gt; genera un vector de numeros aleatorios de 5x1.&lt;br /&gt;
rand(1,3) --&amp;gt; genera un vector de numeros aleatorios de 1x3.&lt;br /&gt;
rand(2,3) --&amp;gt; genera una matriz de numeros aleatorios de 2x3.&lt;br /&gt;
rand(2,3,2) --&amp;gt; genera 2 matrices de numeros aleatorios de 2x3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Existen otras funciones para generar valores aleatorios como las siguientes: randi(), randn().&lt;br /&gt;
&lt;br /&gt;
La función randi() devuelve valores enteros dobles extraídas de una distribución uniforme discreta.&lt;br /&gt;
randi(2,10,1);&lt;br /&gt;
&lt;br /&gt;
La función randn() devuelve matrices de números en coma flotante reales que se dibujan de una distribución normal estándar.&lt;br /&gt;
randn(10,1);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Funcion Reshape:&lt;/b&gt;&lt;br /&gt;
Esta funcion nos permite redimensionar matrices, por ejemplo se puede cambiar una matriz que representa valores para x,y,z en una matriz que represente valores solamente en x,y. Se aprecia mejor en el siguiente ejemplo:&lt;br /&gt;
&lt;br /&gt;
Tenemos una matriz compuesta de los siguientes datos:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBVkJcP5e3UvufC814tmITsv7eoLQC-dtxlMPQD8iaY0qKz02e5CbXEnbeg6yVp61qDucpPfF-a8MsnMNBElbMyZCuPLDCtrZwiEIr_Kq3hAPDNEjQdWPFJGgnVXhz77heBDhYZHBAV2s/s1600/apuntes1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBVkJcP5e3UvufC814tmITsv7eoLQC-dtxlMPQD8iaY0qKz02e5CbXEnbeg6yVp61qDucpPfF-a8MsnMNBElbMyZCuPLDCtrZwiEIr_Kq3hAPDNEjQdWPFJGgnVXhz77heBDhYZHBAV2s/s320/apuntes1.JPG&quot; width=&quot;93&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Podemos redimensionar con:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;&amp;gt;&amp;gt; B = reshape(A(:, :, :), 24, 1)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Con este comando logramos crear un solo vector de datos de 24x1, en el cual contenga en sus filas cada uno de los valores de las matrices anteriores a la redimension.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/3596209351022116552/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-utilizar-global-rand-reshape-en.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/3596209351022116552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/3596209351022116552'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-utilizar-global-rand-reshape-en.html' title='Como utilizar Global, Rand, Reshape en Matlab'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBVkJcP5e3UvufC814tmITsv7eoLQC-dtxlMPQD8iaY0qKz02e5CbXEnbeg6yVp61qDucpPfF-a8MsnMNBElbMyZCuPLDCtrZwiEIr_Kq3hAPDNEjQdWPFJGgnVXhz77heBDhYZHBAV2s/s72-c/apuntes1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-7751186563156190452</id><published>2013-12-06T15:48:00.000-08:00</published><updated>2013-12-07T12:18:13.623-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="botones"/><category scheme="http://www.blogger.com/atom/ns#" term="Button"/><category scheme="http://www.blogger.com/atom/ns#" term="edit text"/><category scheme="http://www.blogger.com/atom/ns#" term="gui"/><category scheme="http://www.blogger.com/atom/ns#" term="handles"/><category scheme="http://www.blogger.com/atom/ns#" term="matlab"/><category scheme="http://www.blogger.com/atom/ns#" term="slider"/><title type='text'>Como Utilizar el Slider, Button, Edit Text en GUI en Matlab</title><content type='html'>&lt;br /&gt;
En este ejemplo mostraremos como utilizar el componente Slider de la GUI de Matlab, su utilizacion es muy sencilla. En primer lugar creamos un nuevo archivo tipo fig y colocaremos lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmHkW6WtL-mEeRh6i1C4ygjkUrG5dZHtwq8UaL64UJbHkGkeEk37BuBbFalP7vxzUz6yVoCYostOFmo7XczOyxojW1vT18L0dn4DAZCQF9I9D5mirKLY-1Ni1X8lRyFhWgXkxAfBxBO_g/s1600/slider1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmHkW6WtL-mEeRh6i1C4ygjkUrG5dZHtwq8UaL64UJbHkGkeEk37BuBbFalP7vxzUz6yVoCYostOFmo7XczOyxojW1vT18L0dn4DAZCQF9I9D5mirKLY-1Ni1X8lRyFhWgXkxAfBxBO_g/s320/slider1.JPG&quot; width=&quot;250&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;center&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- MAtalb1 --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-slot=&quot;3994870138&quot; style=&quot;display: inline-block; height: 250px; width: 250px;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
a continuacion hacemos click en View Callbacks--&amp;gt;Callbacks sobre el Slider y colocamos el siguiente codigo:&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;handles.slider1 = get(hObject,&#39;Value&#39;);&lt;/span&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;indSlide = round(handles.slider1);&lt;/span&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;set(handles.salidaSlider,&#39;String&#39;,indSlide);&lt;/span&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
En indSlide capturamos la posicion del slider y la mostramos en uns static text en la siguiente linea.&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
Por defecto el intervalo de variacion del Slider es de 0 a 1, para cambiar estos parametro tendremos que ingresar a la GUI en Property Inspector sobre el Slider y encontrar los valores de maximo y minimo para su modificacion; en nuestro caso hemos colocado min = 0 y max = 10.&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
La siguiente parte del programa es establecer un valor al Slider al colocar un valor determinado sobre un Edit Text, es decir setear un determinado valor sobre un slider, lo cual se vera de la siguiente manera:&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD1NlYlbIJErSd_XSSZz05_4CWHkoRTBPgnmyMXkRzJqhIpx03HvCEAy0WLOeaAMgFR_0V5r1U9v7-IlkdWFU_CHgnfs907_d92eFf-2D4Nb5XcOgw3FBGLmgZhHjschaQRBI6E4y6T7E/s1600/slider2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD1NlYlbIJErSd_XSSZz05_4CWHkoRTBPgnmyMXkRzJqhIpx03HvCEAy0WLOeaAMgFR_0V5r1U9v7-IlkdWFU_CHgnfs907_d92eFf-2D4Nb5XcOgw3FBGLmgZhHjschaQRBI6E4y6T7E/s320/slider2.JPG&quot; width=&quot;306&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
El codigo utilizado al presionar el boton &quot;Aceptar&quot; es el siguiente:&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;dato = str2num(get(handles.txtIn, &#39;String&#39;));&lt;/span&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;set(handles.slider1, &#39;Value&#39;, fix(dato));&lt;/span&gt;&lt;/center&gt;
&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
En la primera linea obtenemos el valor de entrada y los transformamos a formato de numeros.&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
En la segunda linea colocamos el valor obtenido del edit text sobre el slider.&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
Para descargar los archivos del programa seguir los enlaces siguientes:&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZSk9HSmdieUtYNWs/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Archivo.m&lt;/a&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZMEMzUVZBN29oSms/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Archivo.fig&lt;/a&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/center&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/7751186563156190452/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-utilizar-el-slider-button-edit.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7751186563156190452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7751186563156190452'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-utilizar-el-slider-button-edit.html' title='Como Utilizar el Slider, Button, Edit Text en GUI en Matlab'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmHkW6WtL-mEeRh6i1C4ygjkUrG5dZHtwq8UaL64UJbHkGkeEk37BuBbFalP7vxzUz6yVoCYostOFmo7XczOyxojW1vT18L0dn4DAZCQF9I9D5mirKLY-1Ni1X8lRyFhWgXkxAfBxBO_g/s72-c/slider1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-491806038414848647</id><published>2013-12-06T14:59:00.002-08:00</published><updated>2013-12-07T12:22:35.649-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="botones"/><category scheme="http://www.blogger.com/atom/ns#" term="Button"/><category scheme="http://www.blogger.com/atom/ns#" term="check"/><category scheme="http://www.blogger.com/atom/ns#" term="checkbox"/><category scheme="http://www.blogger.com/atom/ns#" term="gui"/><category scheme="http://www.blogger.com/atom/ns#" term="matlab"/><title type='text'>Como utilizar CheckBox y Button en GUI en Matlab</title><content type='html'>&lt;br /&gt;
Este es un sencillo ejemplo que abarca la utilizacion de los checkbox en matlab, los checkbox permiten la seleccion de multiples opciones simultaneamente, lo cual los hace muy utiles para muchisimas aplicaciones que se crean dia a dia.&lt;br /&gt;
&lt;br /&gt;
El primer paso es dirigirse a la gui y crear un nuevo documento sobre el cual pondremos los elementos que se muestran en la siguiente figura:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBjLn8UgK-ONPNp0k4v7JiTog_EAZbmTPQ0e94OExmFLziPjXcbwgMltr-p772H8apcvpExq66rCUCaVL-p_28VIpDvQh-tS3YiaMBOKvzxfz9RCBTGF0Om4OviniZLXzSubOpgkGOd9E/s1600/CheckButton1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBjLn8UgK-ONPNp0k4v7JiTog_EAZbmTPQ0e94OExmFLziPjXcbwgMltr-p772H8apcvpExq66rCUCaVL-p_28VIpDvQh-tS3YiaMBOKvzxfz9RCBTGF0Om4OviniZLXzSubOpgkGOd9E/s1600/CheckButton1.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; width:310px; text-align: center;&quot; &gt;
&lt;/div&gt;
&lt;center&gt;
&lt;script async src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- matlab5 --&gt;
&lt;ins class=&quot;adsbygoogle&quot;
     style=&quot;display:inline-block;width:300px;height:250px&quot;
     data-ad-client=&quot;ca-pub-1329294398604545&quot;
     data-ad-slot=&quot;3840092933&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;estado = get(handles.checkbox1,&#39;Value&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;if estado==1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;&amp;nbsp; &amp;nbsp; set(handles.txtSalida1,&#39;String&#39;,&#39;Opcion1&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
En la variable estado almacenaremos el valor de cada checkbox, siendo (1--&amp;gt; Seleccionado y 0--&amp;gt; No Seleccionado).&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfOboAmGK2P844yhpp8Qp9qg6OubAnZv7l6z81gmZW9ugE1hMeLMpjR0zFYO44Ixl7399GP71HQobFjn882viz78V4eM_QKfkaqBSWxL0LPwAV7qefNGKh00q4daM0Gwk-8A_YsuwhQvw/s1600/checkbox2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfOboAmGK2P844yhpp8Qp9qg6OubAnZv7l6z81gmZW9ugE1hMeLMpjR0zFYO44Ixl7399GP71HQobFjn882viz78V4eM_QKfkaqBSWxL0LPwAV7qefNGKh00q4daM0Gwk-8A_YsuwhQvw/s320/checkbox2.JPG&quot; width=&quot;205&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Se puede descargar los archivos del programa de los siguientes enlaces:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZY0lIbzh6ZVFDYlk/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Archivo.m&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZeEd3SS1aSXltd2s/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Archivo.fig&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/491806038414848647/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-utilizar-checkbox-y-button-en-gui.html#comment-form' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/491806038414848647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/491806038414848647'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-utilizar-checkbox-y-button-en-gui.html' title='Como utilizar CheckBox y Button en GUI en Matlab'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBjLn8UgK-ONPNp0k4v7JiTog_EAZbmTPQ0e94OExmFLziPjXcbwgMltr-p772H8apcvpExq66rCUCaVL-p_28VIpDvQh-tS3YiaMBOKvzxfz9RCBTGF0Om4OviniZLXzSubOpgkGOd9E/s72-c/CheckButton1.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-6547365554100001431</id><published>2013-12-06T14:31:00.001-08:00</published><updated>2013-12-07T12:17:47.247-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="botones"/><category scheme="http://www.blogger.com/atom/ns#" term="button group"/><category scheme="http://www.blogger.com/atom/ns#" term="gui"/><category scheme="http://www.blogger.com/atom/ns#" term="matlab"/><category scheme="http://www.blogger.com/atom/ns#" term="paneles"/><category scheme="http://www.blogger.com/atom/ns#" term="radio button"/><title type='text'>Como usar Radio Button, Button Group y Button en GUI en Matlab</title><content type='html'>&lt;br /&gt;
En esta ocasión mostramos un programa sencillo realizado en matlab, el mismo que contendra un panel Button Group sobre el cual estaran alguno Radio Button.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTCiYzHTja7MBYehNjIPlNnRdT7Y7WaoQWpO5ik8MIqga3W_VOLysTu3-ddh_k6RCz7bjefUd2jriOzcXfWtV4o69rogu8oLp65CrjI_J-fm_z6AAC0oMv1rWkd_RyIHaLif_Om0DyRmQ/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTCiYzHTja7MBYehNjIPlNnRdT7Y7WaoQWpO5ik8MIqga3W_VOLysTu3-ddh_k6RCz7bjefUd2jriOzcXfWtV4o69rogu8oLp65CrjI_J-fm_z6AAC0oMv1rWkd_RyIHaLif_Om0DyRmQ/s320/1.JPG&quot; width=&quot;250&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;center&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- MAtalb1 --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-1329294398604545&quot; data-ad-slot=&quot;3994870138&quot; style=&quot;display: inline-block; height: 250px; width: 250px;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
Gracias a este panel Button Group, los radio button que se encuentren dentro del panel podran seleccionarse solamente uno a la vez haciendolo muy util para los casos en los cuales e necesitan presentar una de varias opciones en la GUI.&lt;br /&gt;
&lt;br /&gt;
Ademas este sencillo programa a traves de un boton muestra en un static text la opcion que se ha seleccionado.&lt;br /&gt;
&lt;br /&gt;
Para poder determinar si algun radio button especifico esta seleccionado o no se aplica la siguiente sentencia:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;estado = get(handles.radiobt1,&#39;Value&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;if estado == 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;&amp;nbsp; &amp;nbsp; set(handles.txtSalida,&#39;String&#39;, &#39;Opcion 1&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;end &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
radiobt1 es el nombre del primer radio button sobre la GUI, guardamos en la variable estado el estado del radio button (1--&amp;gt; Seleccionado, 0--&amp;gt;No Seleccionado).&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipOGEiGGcMososXSmG2KbOulG-tUi4T_3pZGaEFMtgtkrwOOFxyCXfCOGurC1u395VPzkoVuU-xck5_kCTtj5WLwKMeAELKtFMCauTBr0LEOZVo86qexGFGXzJGwJ4tyGd8gyoL15jtyQ/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipOGEiGGcMososXSmG2KbOulG-tUi4T_3pZGaEFMtgtkrwOOFxyCXfCOGurC1u395VPzkoVuU-xck5_kCTtj5WLwKMeAELKtFMCauTBr0LEOZVo86qexGFGXzJGwJ4tyGd8gyoL15jtyQ/s320/2.JPG&quot; width=&quot;237&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Se puede descargar los archivos siguiendo el enlace siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZb0VzNmpKbGItR00/edit?usp=sharing&quot;&gt;Archivo.m&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B1kFwZU59fWZTGNRdGcyM1RwbDg/edit?usp=sharing&quot;&gt;Archivo.fig&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/6547365554100001431/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-usar-radio-button-button-group-y.html#comment-form' title='2 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/6547365554100001431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/6547365554100001431'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/12/como-usar-radio-button-button-group-y.html' title='Como usar Radio Button, Button Group y Button en GUI en Matlab'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTCiYzHTja7MBYehNjIPlNnRdT7Y7WaoQWpO5ik8MIqga3W_VOLysTu3-ddh_k6RCz7bjefUd2jriOzcXfWtV4o69rogu8oLp65CrjI_J-fm_z6AAC0oMv1rWkd_RyIHaLif_Om0DyRmQ/s72-c/1.JPG" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-5996533540867418066</id><published>2013-03-23T18:56:00.000-07:00</published><updated>2013-07-28T22:05:49.146-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="botones"/><category scheme="http://www.blogger.com/atom/ns#" term="botones de grupo"/><category scheme="http://www.blogger.com/atom/ns#" term="botones de radio"/><category scheme="http://www.blogger.com/atom/ns#" term="button group"/><category scheme="http://www.blogger.com/atom/ns#" term="jframe form"/><category scheme="http://www.blogger.com/atom/ns#" term="jpanel"/><category scheme="http://www.blogger.com/atom/ns#" term="panel"/><category scheme="http://www.blogger.com/atom/ns#" term="radio button"/><title type='text'>Como utilizar Button Group y Radio Button en Netbeans en Java</title><content type='html'>&lt;div 0px=&quot;&quot; 10px=&quot;&quot; style=&quot;display: block; float: right;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-1329294398604545&quot;;
/* JSF */
google_ad_slot = &quot;9669516273&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;
Este post muestra un ejemplo sencillo de la utilizacion de Button Group y Radio Button en Netbeans en Java.&lt;br /&gt;
&lt;br /&gt;
Para nuestro ejemplo crearemos una clase tipo &lt;b&gt;JFrame Form, &lt;/b&gt;sobre esta colocaremos un &lt;b&gt;Panel&lt;/b&gt;, lo vamos a llamar &lt;b&gt;panel.&lt;/b&gt;&lt;br /&gt;
Ahora, sobre el panel colocaremos tres botones tipo radio (radio button), que indicaran los colores: &quot;Verde&quot;, &quot;Amarillo&quot; y &quot;Rojo&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Colocamos un boton, lo llamaremos btAceptar. Ademas colocaremos tres paneles llamados: panel1, panel2, y panel3.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Al presionar el boton se verificara la seleccion y dependiendo de eso se continuara a pintar los colores sobre los paneles colocados sobre el panel principal.&lt;br /&gt;
&lt;br /&gt;
Nuestra ventana se vera mas o menos asi:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZTj-0OrNNPYNq61fQs55XECMiXMfgVCYvJ55MEi8vOVssFMhEVXgkhUjEqd0U7egS118RRqSq1mzbbGYTwWQ4WQfGDCyh7_ql3XjRgu0oFRyaOIUUOzt3c-Uz6etGCa1zmfhuwZJvH_0/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;230&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZTj-0OrNNPYNq61fQs55XECMiXMfgVCYvJ55MEi8vOVssFMhEVXgkhUjEqd0U7egS118RRqSq1mzbbGYTwWQ4WQfGDCyh7_ql3XjRgu0oFRyaOIUUOzt3c-Uz6etGCa1zmfhuwZJvH_0/s320/1.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Continuaremos agregando un boton tipo &lt;b&gt;Button Group&lt;/b&gt;, el mismo que no lo veremos en el panel, sino en la pestana &lt;b&gt;Navigator &lt;/b&gt;en la parte superior izquierda&amp;nbsp;de Netbeans. El boton de grupo permite agregar ciertos botones tipo radio a un grupo, para que solo se permita seleccionar solo un radio button a la vez.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Empezamos seleccionando todos los botones tipo radio y haremos click derecho y entramos a propiedades, nos dirigimos a la fila llamada &lt;b&gt;buttonGroup&lt;/b&gt; y escogemos group1 (que es el nombre que pusimos a nuestro Button Group) como podemos ver en la siguiente imagen.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4_E4hCqbZEgjkGEMIho095K77XrX_D3Hxz_fNmy_qOKMI6SiPwtZ30ApvXXqgahGPaDTU-lpMqrwdozjDuVoPhCCnYmBOGSSx7GUbir-bn4YdPNylPYbZTmuGe29Dc7DD82iVsId0rPc/s1600/2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;248&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4_E4hCqbZEgjkGEMIho095K77XrX_D3Hxz_fNmy_qOKMI6SiPwtZ30ApvXXqgahGPaDTU-lpMqrwdozjDuVoPhCCnYmBOGSSx7GUbir-bn4YdPNylPYbZTmuGe29Dc7DD82iVsId0rPc/s320/2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
En el constructor inicializamos el color de los paneles como blanco.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Por el hecho de haber creado el Button Group y haber anadido los tres radio button, el programa permitira solamente seleccionar un boton tipo radio a la vez, por lo tanto se pintara un solo color a la vez sobre los paneles.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Tambien se puede agregar solo dos radio button al button group en vez de los tres, de esta manera podra hacerse algunas combinaciones, pero no se permitira que esos dos radio button esten marcados al mismo tiempo.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihE-j4YTGgKEehDsgncishMmH51EmKDTh55_pQiHtCFnneJ8uolefKzHb6w0VmxGGJ7tTMfGHH76fftuE4qS-cNufxzhmYlZUGl7e_oqFWvc63V-PG8udKOu5CoxoeTIhidCooBru7wc4/s1600/33.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;237&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihE-j4YTGgKEehDsgncishMmH51EmKDTh55_pQiHtCFnneJ8uolefKzHb6w0VmxGGJ7tTMfGHH76fftuE4qS-cNufxzhmYlZUGl7e_oqFWvc63V-PG8udKOu5CoxoeTIhidCooBru7wc4/s320/33.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
En el caso de no utilizarse un Button Group, el programa permitira que se presione dos o tres radio button a la vez y el programa se ejecutara normalmente.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Quedando de la siguiente manera:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhANoLgMuxYf0-_6uNJqHeC-HbxTh8BlSOYqcxBI3dL8toMPwUP7Rm4E610ha8JMqeoeIyBo_Rwu9P5ytEE_265XV-fWFr9VcBdB-T2LmqCcd6rjbMTMEWWDSVhVTfnAVmgA0vsNduSD98/s1600/4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;242&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhANoLgMuxYf0-_6uNJqHeC-HbxTh8BlSOYqcxBI3dL8toMPwUP7Rm4E610ha8JMqeoeIyBo_Rwu9P5ytEE_265XV-fWFr9VcBdB-T2LmqCcd6rjbMTMEWWDSVhVTfnAVmgA0vsNduSD98/s320/4.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
El codigo del programa se muestra a continuacion:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=hFri3isa&quot; style=&quot;border: none; width: 100%;&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
Si desean descargar el proyecto completo click en la siguiente imagen:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.dropbox.com/s/nkvl65kxzvo40ve/BotonGroup.rar&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjdrLYk_Th1K11E9WQvMQUxK3c2s4gT5ntuoy-E4yXmqOhQfqtqH73eG9iTlkMVwVgb90EZfMqPyGkgYEfTIdl2ads4uA6zntUO3cAkBVf_Mj3HcTPDcKcjHjNWG2Cr9LD-IJPzWLO69Y/s1600/descargar.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/5996533540867418066/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/03/como-utilizar-button-group-y-radio.html#comment-form' title='9 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/5996533540867418066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/5996533540867418066'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/03/como-utilizar-button-group-y-radio.html' title='Como utilizar Button Group y Radio Button en Netbeans en Java'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZTj-0OrNNPYNq61fQs55XECMiXMfgVCYvJ55MEi8vOVssFMhEVXgkhUjEqd0U7egS118RRqSq1mzbbGYTwWQ4WQfGDCyh7_ql3XjRgu0oFRyaOIUUOzt3c-Uz6etGCa1zmfhuwZJvH_0/s72-c/1.JPG" height="72" width="72"/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-5083656614777028836</id><published>2013-03-16T17:51:00.000-07:00</published><updated>2013-03-16T19:13:34.982-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hilos"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="matriz"/><category scheme="http://www.blogger.com/atom/ns#" term="metodo run()"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="random"/><category scheme="http://www.blogger.com/atom/ns#" term="Runnable"/><category scheme="http://www.blogger.com/atom/ns#" term="threads"/><title type='text'>Como usar Threads (hilos) en Java</title><content type='html'>En este ejemplo se realizara la suma de todos los numeros de una matriz. La dimension de la matriz es de 6000 x 6000.&lt;br /&gt;
&lt;br /&gt;
La suma se realizara de dos formas diferentes:&lt;br /&gt;
En primer lugar se realiza la suma secuencial de los valores de la matriz.&lt;br /&gt;
En segundo lugar se crean 6 threads, cada uno se encargara de sumar los valores de una fila de la matriz. Luego de esto se calcula la suma de los valores de la filas, obteniendo la suma total de la matriz.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
El ejemplo pretende demostrar que la utilizacion de threads es muy importante, ya que mejora el desempeno de los programas que los utilizan.&lt;br /&gt;
&lt;br /&gt;
Para ello hemos calculado el tiempo que tarda en realizarse la suma de los valores de la matriz mediante la utilizacion de thread y si ellos.&lt;br /&gt;
&lt;br /&gt;
En la salida de nuestro programa podremos ver que el tiempo que demora realizarse la suma utilizando threads es menor que cuando no se los utiliza.&lt;br /&gt;
&lt;br /&gt;
El programa se ha dividido en en tres clases:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Clase Matriz:&lt;/b&gt;&lt;br /&gt;
En esta clase creamos algunas variables como son matriz, suma, tamano.&lt;br /&gt;
Ademas se crea un objeto tipo Random para generar numeros aleatorios para llenar la matriz.&lt;br /&gt;
En el contructor se crea la matriz con dimensiones establecidas en la clase&amp;nbsp;&lt;b&gt;Main.&lt;/b&gt;&lt;br /&gt;
En el metodo llenarMatriz() generamos numeros aleatorios entre 0 y 20 y los guardamos en cada una de las posiciones de la matriz.&lt;br /&gt;
El metodo synchronized se encarga de guardar en la variable suma los valores obtenidos de las filas de la matriz.
&lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=Sk329Tgs&quot; style=&quot;border: none; width: 100%;&quot;&gt;&lt;/iframe&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Clase ThreadSuma:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
Esta clase es un thread que se encarga de realizar la suma de los valores de la matriz, para ello se debe especificar de donde a donde se quiere sumar utilizando los parametros&amp;nbsp;&lt;b&gt;inicio&lt;/b&gt; y &lt;b&gt;fin.&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
El metodo &lt;b&gt;run() &lt;/b&gt;del thread es el proceso que se realizara cuando se ejecute el o los threads en la clase &lt;b&gt;Main&lt;/b&gt;.&lt;br /&gt;
&lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=AGWJWcQz&quot; style=&quot;border: none; width: 100%;&quot;&gt;&lt;/iframe&gt;&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Clase Main:&lt;/b&gt;&lt;br /&gt;
En esta clase realizamos la suma sin threads, calculamos el tiempo que demora el realizar la suma y mostramos en pantalla el valor de la suma y el tiempo demorado.&lt;br /&gt;
Ademas creamos los threads que se encargaran de sumar los valores de las filas de la matriz, seguido de esto ejecutamos todos los 6 threads con el objeto&amp;nbsp;&lt;b&gt;execute, &lt;/b&gt;de la misma manera calculamos el tiempo que demora en sumar y mostramos en pantalla.&lt;br /&gt;
&lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=3yGyyafJ&quot; style=&quot;border: none; width: 100%;&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
La salida de nuestro programa nos quedara de la siguiente manera:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZb9sBvxqLnBZeN4xFXi8flRPHBTMRUQUcVu_2SK0Q3UCHaLc3nmyDUpGcMcdKCK3AgrNt6JnS0a1MCJykz_vh-cpEJppYo3-qvxq3BNKwBMy0UW__dy6SO-XBwCgT_4W-_VsdsA31RPc/s1600/SumaThreads.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;135&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZb9sBvxqLnBZeN4xFXi8flRPHBTMRUQUcVu_2SK0Q3UCHaLc3nmyDUpGcMcdKCK3AgrNt6JnS0a1MCJykz_vh-cpEJppYo3-qvxq3BNKwBMy0UW__dy6SO-XBwCgT_4W-_VsdsA31RPc/s400/SumaThreads.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Como podemos ver, el tiempo utilzando threads es menor al tiempo si utilizar threads.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Para descargar el proyecto hacer click en la siguiente imagen!!&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.dropbox.com/s/s9jhzm8hth6yp7x/Threads.rar&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqekpX4r-wfoIwxv1MGbFnTxaT9x1PvhlFZpsvyTKCM2hw9Dq1r9gBwC-H4QxltSYyOyMpMF2SMIVcuZzri7L691_SQyhJpb64BJpIa0_rqvj00fVvUs1BZ3QMzqLxAyBBzPTRi4Zy4J8/s1600/descargar.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/5083656614777028836/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2013/03/como-usar-threads-hilos-en-java.html#comment-form' title='2 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/5083656614777028836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/5083656614777028836'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2013/03/como-usar-threads-hilos-en-java.html' title='Como usar Threads (hilos) en Java'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZb9sBvxqLnBZeN4xFXi8flRPHBTMRUQUcVu_2SK0Q3UCHaLc3nmyDUpGcMcdKCK3AgrNt6JnS0a1MCJykz_vh-cpEJppYo3-qvxq3BNKwBMy0UW__dy6SO-XBwCgT_4W-_VsdsA31RPc/s72-c/SumaThreads.JPG" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-2636050731413444540</id><published>2012-10-28T14:22:00.000-07:00</published><updated>2012-10-28T14:31:12.089-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arreglo"/><category scheme="http://www.blogger.com/atom/ns#" term="buscar"/><category scheme="http://www.blogger.com/atom/ns#" term="busqueda"/><category scheme="http://www.blogger.com/atom/ns#" term="busqueda lineal"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans 7.1"/><category scheme="http://www.blogger.com/atom/ns#" term="random"/><category scheme="http://www.blogger.com/atom/ns#" term="scanner"/><title type='text'>Algoritmo de busqueda Lineal en Java Netbeans 7.1</title><content type='html'>&lt;br /&gt;
El &lt;b&gt;algoritmo de busqueda lineal &lt;/b&gt;busca por cada elemento de un arreglo en forma secuencial. El algoritmo evalua cada elemento del arreglo y si no hay coincidencias,&amp;nbsp;cuando llega al final informa que no hay coincidencias.&lt;br /&gt;
Si hay coincidencias con los elementos del arreglo, el algoritmo devuelve el indice de ese elemento.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Consideremos un arreglo representado de la siguiente manera:&lt;br /&gt;
12 &amp;nbsp; 23 &amp;nbsp; 56 &amp;nbsp; 54 &amp;nbsp; 65 &amp;nbsp; 45 &amp;nbsp; 76&lt;br /&gt;
&lt;br /&gt;
Si el algortimo esta buscando el numero 56 comprobara primero con el valor de la primera posicion que es 12, luego con el de la segunda posicion hasta encontrar coincidencia.&lt;br /&gt;
&lt;center&gt;
&lt;a href=&quot;http://gan.doubleclick.net/gan_click?lid=41000613802347703&amp;pubid=21000000000590379&quot;&gt;Up to 10% OFF Android Tablet PCs&lt;/a&gt;
&lt;/center&gt;
Una vez que el algoritmo encuentre coincidencias, el programa nos mostrara la posicion del elemento encontrado.&lt;br /&gt;
&lt;br /&gt;
Si no se encuentran coincidencias con los elementos del arreglo, el programa mostrara que no se ha encontrado coincidencias.&lt;br /&gt;
&lt;br /&gt;
El codigo del programa se muestra a continuacion:&lt;br /&gt;
&lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=9Hcw6piy&quot; style=&quot;border: none; width: 100%;&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDEvp9kbRqqayXF9T23v1yIqS1tJHJT5e-Q_ETlhmc6qbgYEe-ybqS_dmJ5E8l4Ui9xIRY2sc41GFda2vy8nhb08PDRjhynrxAoIdOfh1gJ8XjaGdHfAIh75CZDS9Y6rLzo5OTDwAL0DQ/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;233&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDEvp9kbRqqayXF9T23v1yIqS1tJHJT5e-Q_ETlhmc6qbgYEe-ybqS_dmJ5E8l4Ui9xIRY2sc41GFda2vy8nhb08PDRjhynrxAoIdOfh1gJ8XjaGdHfAIh75CZDS9Y6rLzo5OTDwAL0DQ/s320/1.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Si desea descargar el proyecto click en la siguiente imagen:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://skydrive.live.com/#cid=CB2C976AE9CB5D07&amp;amp;id=CB2C976AE9CB5D07%21351&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE90a2eaaVxwFOmMBlIYxVSaIXGgCg-_qDN5pAN-Gjrl2n2EJUeQsnEcUrvJPU4HmcozWBkc8EB_PGOZolt1MHfamvPSo9hbbaqUuhuf3ZnRngk1XtL-MAT_wKX0sZl_dUR7ZnvivHiuQ/s1600/descargar.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/2636050731413444540/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/algoritmo-de-busqueda-lineal-en-java.html#comment-form' title='6 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/2636050731413444540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/2636050731413444540'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/algoritmo-de-busqueda-lineal-en-java.html' title='Algoritmo de busqueda Lineal en Java Netbeans 7.1'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDEvp9kbRqqayXF9T23v1yIqS1tJHJT5e-Q_ETlhmc6qbgYEe-ybqS_dmJ5E8l4Ui9xIRY2sc41GFda2vy8nhb08PDRjhynrxAoIdOfh1gJ8XjaGdHfAIh75CZDS9Y6rLzo5OTDwAL0DQ/s72-c/1.JPG" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-4479295291416051960</id><published>2012-10-27T18:01:00.002-07:00</published><updated>2013-02-11T07:02:06.025-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clase thread"/><category scheme="http://www.blogger.com/atom/ns#" term="hilos"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="JVM"/><category scheme="http://www.blogger.com/atom/ns#" term="metodo run()"/><category scheme="http://www.blogger.com/atom/ns#" term="multithreading"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans 7.1"/><category scheme="http://www.blogger.com/atom/ns#" term="Runnable"/><category scheme="http://www.blogger.com/atom/ns#" term="start()"/><category scheme="http://www.blogger.com/atom/ns#" term="subprocesamiento multiple en java"/><category scheme="http://www.blogger.com/atom/ns#" term="subprocesos"/><category scheme="http://www.blogger.com/atom/ns#" term="thread"/><category scheme="http://www.blogger.com/atom/ns#" term="threads"/><category scheme="http://www.blogger.com/atom/ns#" term="threads java"/><title type='text'>Creacion y Ejecucion de Subprocesos en Java Netbeans 7.1</title><content type='html'>La inerfaz &lt;b&gt;Runnable &lt;/b&gt;es el medio preferido para crear aplicaciones en &lt;b&gt;Java &lt;/b&gt;con &lt;b&gt;subprocesamiento multiple.&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
Un objeto Runnable representa una tarea, la misma que puede ejecutarse concurrentemente con otras tareas.&lt;br /&gt;
La interfaz Runnable declara un solo metodo, &lt;b&gt;run(), &lt;/b&gt;el cual contiene el codigo que define la tarea que debe realizar un objeto Runnable. Cuando se crea e inicia un subproceso que ejecuta un objeto Runnable, el subproceso llama al metodo run del objeto Runnable, el cual se ejecuta en el nuevo subproceso.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Objetos Runnable y la Clase Thread:&lt;/b&gt;&lt;br /&gt;
La clase MultiplesProcesos implementa a Runnable, de manera que pueden ejecutarse varios objetos MultiplesProcesos de manera concurrente.&lt;br /&gt;
La variable tmpInactivo almacena un valor entero aleatorio de 0 a 5 segundos.&lt;br /&gt;
Cada subproceso que ejecuta a un objeto MultiplesProcesos permanece inactivo la cantidad de tiempo especificado por la variable tmpInactivo.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=E62yn6yr&quot; style=&quot;border: none; width: 100%;&quot;&gt;&lt;/iframe&gt;
&lt;br /&gt;
&lt;br /&gt;
Un objeto MultiplesProcesos se ejecuta cuando un subproceso llama al metodo run de MultiplesProcesos.&lt;br /&gt;
En la linea 27 se invoca al metodo static &lt;b&gt;sleep()&lt;/b&gt; de la clase &lt;b&gt;Thread, &lt;/b&gt;para colocar al subproceso en estado de espera sincronizada durante la cantidad especificada de tiempo. Asi, el subproceso pierde el procesador y el sistema permite que otro subproceso se ejecute.&lt;br /&gt;
&lt;br /&gt;
En las lineas 38, 39, 40 se crean 3 subprocesos, cada uno de los cuales especifica un nuevo objeto MultiplesProcesos a ejecutar.&lt;br /&gt;
En las lineas 45, 46, 47 se hace una llamada al metodo &lt;b&gt;start() &lt;/b&gt;de la clase &lt;b&gt;Thread &lt;/b&gt;en cada uno de los subprocesos; cada llamada invoca al metodo &lt;b&gt;run() &lt;/b&gt;del objeto &lt;b&gt;Runnable &lt;/b&gt;correspondiente para ejecutar la tarea.&lt;br /&gt;
&lt;br /&gt;
La salida de nuestra aplicacion se vera asi:&lt;br /&gt;
&lt;center&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-1329294398604545&quot;;
/* puntos */
google_ad_slot = &quot;3985680133&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPqU6aEImZdp6D4QaXh_XBvYuZX3YiBZdQa0wD75RBSGAd0rL4gMHMrZU07ucKGHwlRrup-W1dMbHUbTJPyMGvq85JZk_8duslKUt-yWjad531mn38Zto_lAkQeRqokVN9ZQ7WpjUaa04/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPqU6aEImZdp6D4QaXh_XBvYuZX3YiBZdQa0wD75RBSGAd0rL4gMHMrZU07ucKGHwlRrup-W1dMbHUbTJPyMGvq85JZk_8duslKUt-yWjad531mn38Zto_lAkQeRqokVN9ZQ7WpjUaa04/s640/1.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoYx7hGgjLaQyYlAEXFVd1ABoN-LljDR7li-gGWW2-XZM6PJi5ftjsm6T9jYlcz2yqBlXnQqBplW20EyhP8MYxRR4eaOMGYYEeb0hdjZOUM8M4GLFp5-KSB0H1SRPArqpGlsP7EkyXzig/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;129&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoYx7hGgjLaQyYlAEXFVd1ABoN-LljDR7li-gGWW2-XZM6PJi5ftjsm6T9jYlcz2yqBlXnQqBplW20EyhP8MYxRR4eaOMGYYEeb0hdjZOUM8M4GLFp5-KSB0H1SRPArqpGlsP7EkyXzig/s640/2.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
El codigo en el metodo &lt;b&gt;main() &lt;/b&gt;se ejecuta en el subproceso principal, un subproceso creado por la &lt;b&gt;JVM.&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
El codigo en el metodo &lt;b&gt;run() &lt;/b&gt;de MultiplesProcesos se ejecuta en los subprocesos creados. Cuando termina el metodo main, el programa en si continua ejecutandos, ya que aun hay subprocesos vivos. El programa no terminara hasta que el ultimo subproceso termine de ejecutarse, de esta manera la JVM tambien lo hara.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
El subproceso con el tiempo de inactividad mas corto es el que normalmente se despierta primero, indicando que acaba de estar inactivo y terminan.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Si desea descargar el proyecto click en la siguiente imagen:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://aflrovvs.blogspot.com/&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;163&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFA5WxSNu9KYXb8N6uuzk6ePPYTt_gPXOlR4Yr5BAolkOoE-2Wo-pYqTdg5T5yGU0NEEjhAOz10GznngXZWcDwwenqILEpmPQwvsbvKQBLkSdM5zi6UQZlapWxkR3tAtzApTBPykGiT4o/s200/bannerCuadrado.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://skydrive.live.com/?cid=CB2C976AE9CB5D07#cid=CB2C976AE9CB5D07&amp;amp;id=CB2C976AE9CB5D07%21349&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;64&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYHsDh1asAGxqlzW1LrNAXKBakbxs_DRim_5tMWj7bhotUMazHSTfcweBww-Rbu64S-0osIR61tADCkhd7tYWTp0cWrc8zik50DlX_spPbRoWhwwJOAhCFv584vZ9Ujqaafeh3NRh9dwk/s200/descargar.JPG&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/4479295291416051960/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/creacion-y-ejecucion-de-subprocesos-en.html#comment-form' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/4479295291416051960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/4479295291416051960'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/creacion-y-ejecucion-de-subprocesos-en.html' title='Creacion y Ejecucion de Subprocesos en Java Netbeans 7.1'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPqU6aEImZdp6D4QaXh_XBvYuZX3YiBZdQa0wD75RBSGAd0rL4gMHMrZU07ucKGHwlRrup-W1dMbHUbTJPyMGvq85JZk_8duslKUt-yWjad531mn38Zto_lAkQeRqokVN9ZQ7WpjUaa04/s72-c/1.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-1709072314662194982</id><published>2012-10-27T09:00:00.000-07:00</published><updated>2012-10-28T10:50:22.600-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="circulos"/><category scheme="http://www.blogger.com/atom/ns#" term="circunferencia"/><category scheme="http://www.blogger.com/atom/ns#" term="dibujar"/><category scheme="http://www.blogger.com/atom/ns#" term="figuras"/><category scheme="http://www.blogger.com/atom/ns#" term="gl.glPointSize()"/><category scheme="http://www.blogger.com/atom/ns#" term="gl.glRotatef()"/><category scheme="http://www.blogger.com/atom/ns#" term="GL_POINTS() gl.glBegin()"/><category scheme="http://www.blogger.com/atom/ns#" term="glBegin()"/><category scheme="http://www.blogger.com/atom/ns#" term="glColorf()"/><category scheme="http://www.blogger.com/atom/ns#" term="gltranslatef()"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl en java netbeans 7.1"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl java"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="puntos"/><title type='text'>Como hacer una circunferencia con Puntos en OpenGL en Java Netbeans 7.1</title><content type='html'>En este post haremos alugunas circunferencias hechas con puntos, utilizando la clase &lt;b&gt;Math&lt;/b&gt; en &lt;b&gt;Java &lt;/b&gt;en &lt;b&gt;Netbeans 7.1.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Antes que nada es importante saber que para poder utilizar opengl en netbeans se debe tener instalado el plugin que permite hacer esto.&lt;br /&gt;
&lt;center&gt;
&lt;/center&gt;
Para saber como utilizar opengl en netbeans seguir el siguiente enlace:&lt;br /&gt;
&lt;a href=&quot;http://aflrovvs.blogspot.com/2012/09/como-agregar-plugin-de-opengl-netbeans.html&quot; target=&quot;_blank&quot;&gt;Como Agregar Plugin de OpenGL a Netbeans.&lt;/a&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Para poder dibujar los puntos utilizaremos la siguiente funcion:&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glBegin();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //codigo de vertices, colores, etc para el dibujado&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glEnd();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Utilizamos la funcion &lt;b&gt;gl.glPointSize(&lt;/b&gt;float size&lt;b&gt;) &lt;/b&gt;para establecer el tamano de los puntos que se dibujaran seguidos de esta funcion.&lt;br /&gt;
&lt;br /&gt;
Se utiliza la funcion &lt;b&gt;gl.glRotatef(&lt;/b&gt;float angle, float x, float y, float z&lt;b&gt;) &lt;/b&gt;para rotar los puntos en alguna direccion, se coloca antes de dibujar los puntos.&lt;br /&gt;
&lt;br /&gt;
A traves de la funcion &lt;b&gt;gl.glTranslatef(&lt;/b&gt;float x,&amp;nbsp;float y,&amp;nbsp;float z&lt;b&gt;)&lt;/b&gt;&amp;nbsp;se puede enfocar los puntos en pantalla, esta funcion permite transladar una figura manejando sus parametros.&lt;br /&gt;
&lt;br /&gt;
Se dibuja la esfera a partir del siguiente codigo:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glTranslatef(0.0f, 0.0f, -4.0f); //Permite enfocar la esfera&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt; //Dibuja circunferencia grande&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glPointSize(5);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glColor3f(1.0f, 0.4f, 0.8f);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glBegin(gl.GL_POINTS);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(float angul = 0.0f; angul&amp;lt;2*Pi; angul +=0.1){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float x = (float) ((float) 1.5*Math.sin(angul));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float y = (float) ((float) 1.5*Math.cos(angul));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glVertex2f(x,y);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glEnd();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
El incremento en el for permite controlar el numero de puntos que se dibujaran, mientras menor sea el incremento se dibujara un mayor numero de puntos y mientras mayor sea el incremento se dibujaran menos puntos.&lt;br /&gt;
&lt;br /&gt;
Nuestro ejemplo se vera asi:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYQbSghIHiVNqZSKPxUQiFaezo-b-Aly8k7htg-zzrxBuVAqPBoUclrSTtIitABays3J7OIMsP7Zfie8bdNa2OJeFCWHA9Bqt496vpwiCr0eN6vFxKiDUXcqVlhmREf02zNLg8hYkFbP0/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;270&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYQbSghIHiVNqZSKPxUQiFaezo-b-Aly8k7htg-zzrxBuVAqPBoUclrSTtIitABays3J7OIMsP7Zfie8bdNa2OJeFCWHA9Bqt496vpwiCr0eN6vFxKiDUXcqVlhmREf02zNLg8hYkFbP0/s320/1.JPG&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3fAPcACQXWMjc5s0GJs8BhOkN14rIqgKEsaFeDGKBd_9urPeVqCMHrTcJcs0FKULKyddTqzmeFQ5WqRUTpoT3D6qx-gqy-VpFhuppBoIa6geSgoTTDiKyQAeKtp2gXGx7mWpz-bKbPas/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;270&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3fAPcACQXWMjc5s0GJs8BhOkN14rIqgKEsaFeDGKBd_9urPeVqCMHrTcJcs0FKULKyddTqzmeFQ5WqRUTpoT3D6qx-gqy-VpFhuppBoIa6geSgoTTDiKyQAeKtp2gXGx7mWpz-bKbPas/s200/2.JPG&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;center&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-1329294398604545&quot;;
/* puntos */
google_ad_slot = &quot;3985680133&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/center&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfQzmel5nmO-KsaFyQFYzPmNfcK_UVYG4ElJECKmeETBH9Z9kJZ9-uzN4mkBydFPIDOK6st1UFhaYFjBRYt5PdCqxkCqSBboQ2NwgvzciR9E4AJh-WUkpLkprj4Pt8VgzFdVj0zCI2jHg/s1600/3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;280&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfQzmel5nmO-KsaFyQFYzPmNfcK_UVYG4ElJECKmeETBH9Z9kJZ9-uzN4mkBydFPIDOK6st1UFhaYFjBRYt5PdCqxkCqSBboQ2NwgvzciR9E4AJh-WUkpLkprj4Pt8VgzFdVj0zCI2jHg/s400/3.JPG&quot; width=&quot;336&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
El codigo del ejemplo quedara de la siguiente manera:&lt;br /&gt;
&lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=eXpM2HMG&quot; style=&quot;border: none; width: 100%;&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCiy3IyBYmxkrRCMzLNg_aNOzRYaTsbKP2bwwudrflJHR8O_Y3jHrli2mY4oWU_b_0J0aSrsBVe-9Z4225v36UCgcxPcoLOL6GSukBLEY9jjBvMdWs05KIlblRXpB_NIHQgsjGDEiypSM/s1600/4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;280&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCiy3IyBYmxkrRCMzLNg_aNOzRYaTsbKP2bwwudrflJHR8O_Y3jHrli2mY4oWU_b_0J0aSrsBVe-9Z4225v36UCgcxPcoLOL6GSukBLEY9jjBvMdWs05KIlblRXpB_NIHQgsjGDEiypSM/s400/4.JPG&quot; width=&quot;336&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: start;&quot;&gt;
Si desea descargar el proyecto click en la siguiente imagen:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://skydrive.live.com/#cid=CB2C976AE9CB5D07&amp;amp;id=CB2C976AE9CB5D07%21347&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikIBJqYGySZF9eZzDlzLsM-ZNLpN1z46gOAXSayZXPUAwrdHYBp3wJM22_QkMrQX8AISBD5vrIm3d2kJcx8wEtfM-0tPOfVPhtBaYmryj18g4HXDY3hLEcPAqc-5_ErImy1KMC17ki4Gg/s1600/descargar.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/1709072314662194982/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/como-hacer-una-circunferencia-con.html#comment-form' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/1709072314662194982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/1709072314662194982'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/como-hacer-una-circunferencia-con.html' title='Como hacer una circunferencia con Puntos en OpenGL en Java Netbeans 7.1'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYQbSghIHiVNqZSKPxUQiFaezo-b-Aly8k7htg-zzrxBuVAqPBoUclrSTtIitABays3J7OIMsP7Zfie8bdNa2OJeFCWHA9Bqt496vpwiCr0eN6vFxKiDUXcqVlhmREf02zNLg8hYkFbP0/s72-c/1.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-7127354098501367507</id><published>2012-10-25T21:32:00.003-07:00</published><updated>2012-11-05T06:22:50.674-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="3d"/><category scheme="http://www.blogger.com/atom/ns#" term="ejemplos"/><category scheme="http://www.blogger.com/atom/ns#" term="esfera"/><category scheme="http://www.blogger.com/atom/ns#" term="gl.glRotatef()"/><category scheme="http://www.blogger.com/atom/ns#" term="gllightfv()"/><category scheme="http://www.blogger.com/atom/ns#" term="glrotatef"/><category scheme="http://www.blogger.com/atom/ns#" term="gltranslatef()"/><category scheme="http://www.blogger.com/atom/ns#" term="glut"/><category scheme="http://www.blogger.com/atom/ns#" term="iluminacion"/><category scheme="http://www.blogger.com/atom/ns#" term="iluminar objetos"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans 7.1"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl 3D"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl en java"/><title type='text'>Como iluminar una esfera en OpenGL en Java Netbeans</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
En este ejemplo mostraremos como iluminar una esfera en OpenGL en Java utilizando la IDE Netbeans 7.1.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Para crear la esfera se hace uso de la libreria GLUT, la cual permite dibujar diversas primitivas&amp;nbsp;geometricas.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
Antes que nada es importante saber que para poder utilizar opengl en netbeans se debe tener instalado el plugin que permite hacer esto.&lt;br /&gt;
&lt;center&gt;
&lt;/center&gt;
Para saber como utilizar opengl en netbeans seguir el siguiente enlace:&lt;br /&gt;
&lt;a href=&quot;http://aflrovvs.blogspot.com/2012/09/como-agregar-plugin-de-opengl-netbeans.html&quot; target=&quot;_blank&quot;&gt;Como Agregar Plugin de OpenGL a Netbeans.&lt;/a&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Se utiliza la funcion&amp;nbsp;&lt;b&gt;gl.glLightfv() &lt;/b&gt;para crear una fuente de luz, la misma que ilumina cualquier objeto a su alrededor.&lt;br /&gt;
Al crear una fuente de luz se deben de tener en cuenta algunas propiedades como color, posicion, direccion de la que proviene.&lt;br /&gt;
&lt;br /&gt;
Una vez definida la fuente de luz, se la activa con &lt;b&gt;gl.glEnable().&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Nuestra esfera iluminada se vera asi:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibMoGWcMr1-anJTWUOZX6503ZGCCtruet6tPJBh1QWbJJca4_2euRn8517vypIZqJUgCmesoVi4-_79zK-Ikwt73GMWLeqOVmBMHnXvqjsgI6MIkcEzKjyhyphenhyphenwrw7341FLpaFeA9ukNr1g/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;273&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibMoGWcMr1-anJTWUOZX6503ZGCCtruet6tPJBh1QWbJJca4_2euRn8517vypIZqJUgCmesoVi4-_79zK-Ikwt73GMWLeqOVmBMHnXvqjsgI6MIkcEzKjyhyphenhyphenwrw7341FLpaFeA9ukNr1g/s320/2.JPG&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1yDD9PTZzVpcd6IPqcNPcjfuLOS8uZ_XayOzMS0kJuQIiU8cT_pHPG3IU3Lsbm1LUfKZPS27-fK_NyZwRp22O-5dpVTNwJAk5XaNeBQXwkK0sLs_iCsokkbvziL40C_5s1SXGBAXS8-g/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;273&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1yDD9PTZzVpcd6IPqcNPcjfuLOS8uZ_XayOzMS0kJuQIiU8cT_pHPG3IU3Lsbm1LUfKZPS27-fK_NyZwRp22O-5dpVTNwJAk5XaNeBQXwkK0sLs_iCsokkbvziL40C_5s1SXGBAXS8-g/s320/1.JPG&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;center&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-1329294398604545&quot;;
/* iluminacion */
google_ad_slot = &quot;6250181305&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/center&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5sTL2VGb8hSUfp7eEd2L0LJvEDw1wBZzGpYgojfj8v-gKMRMEyNz8pLKm5nIAig4j__zyOFbXAakwzlgw8n6ZrxRA7VEazgf6Ti3sXWxgIism-7Rad5zGrMaoj1_kxnGAX_tZtIt4smY/s1600/3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;280&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5sTL2VGb8hSUfp7eEd2L0LJvEDw1wBZzGpYgojfj8v-gKMRMEyNz8pLKm5nIAig4j__zyOFbXAakwzlgw8n6ZrxRA7VEazgf6Ti3sXWxgIism-7Rad5zGrMaoj1_kxnGAX_tZtIt4smY/s400/3.JPG&quot; width=&quot;336&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
El codigo de la aplicacion es el siguiente:&lt;/div&gt;
&lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=XTQ2caUz&quot; style=&quot;border: none; width: 100%;&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;br /&gt;
Si se desea descargar el proyecto completo click en la siguiente imagen!&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://skydrive.live.com/#cid=CB2C976AE9CB5D07&amp;amp;id=CB2C976AE9CB5D07%21345&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ2VCxsYWh_Sn7-olOFMwkyEWwl9wH8P_n0R09mvTdosw55N7WKoxqL4gHoAspnf7wcgad_Uj_5pX4SxdvnhMfFn4U84ZxNDYuleesJJNQCKxZGUzGMHOadhUz1p3za_2ffKZNKh-GHNs/s1600/descargar.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/7127354098501367507/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/como-iluminar-una-esfera-en-opengl-en.html#comment-form' title='4 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7127354098501367507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7127354098501367507'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/como-iluminar-una-esfera-en-opengl-en.html' title='Como iluminar una esfera en OpenGL en Java Netbeans'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibMoGWcMr1-anJTWUOZX6503ZGCCtruet6tPJBh1QWbJJca4_2euRn8517vypIZqJUgCmesoVi4-_79zK-Ikwt73GMWLeqOVmBMHnXvqjsgI6MIkcEzKjyhyphenhyphenwrw7341FLpaFeA9ukNr1g/s72-c/2.JPG" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-1136624640657080055</id><published>2012-10-23T16:32:00.001-07:00</published><updated>2015-03-26T17:30:58.896-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="circulos"/><category scheme="http://www.blogger.com/atom/ns#" term="dibujar en opengl"/><category scheme="http://www.blogger.com/atom/ns#" term="figuras"/><category scheme="http://www.blogger.com/atom/ns#" term="figuras opengl"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl 3D"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl en java"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl en netbeans 7.1"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl java"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl netbeans"/><title type='text'>Como Dibujar Figuras con OpenGL en Java Netbeans 7.1</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
En este nuevo post mostraremos como dibujar diferentes figuras en &lt;b&gt;OpenGL&lt;/b&gt; en &lt;b&gt;Java&lt;/b&gt; utilizando la IDE &lt;b&gt;Netbeans 7.1&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
Antes que nada es importante saber que para poder utilizar opengl en netbeans se debe tener instalado el plugin que permite hacer esto.&lt;br /&gt;
&lt;center&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-1329294398604545&quot;;
google_ad_host = &quot;pub-1556223355139109&quot;;
/* piePag! */
google_ad_slot = &quot;7294031664&quot;;
google_ad_width = 468;
google_ad_height = 60;
//&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/center&gt;
Para poder utilizar opengl en netbeans seguir el siguiente enlace:&lt;br /&gt;
&lt;a href=&quot;http://aflrovvs.blogspot.com/2012/09/como-agregar-plugin-de-opengl-netbeans.html&quot; target=&quot;_blank&quot;&gt;Como Agregar Plugin de OpenGL a Netbeans.&lt;/a&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Este ejemplo tiene distintas figuras geometricas, en conjunto forman un cuarto con una ventana en el fondo, en la cual se puede visualizar al sol y un cuadro en la pared de la izquierda.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
En si, la aplicacion es muy sencilla. Se ha utilizado algunas figuras que en entradas anteriores se explico como dibujarlas y utilizarlas para realizar cualquier funcion posible.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Para poder dibujar el &#39;sol&#39;que esta fuera de la ventana se utilizo el siguiente codigo, el mismo que esta sobre el metodo: &lt;b&gt;display().&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; //Dibuja el sol&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glBegin(gl.GL_POLYGON);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(int i=0; i&amp;lt;100; i++){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;float x = (float) Math.cos(i*2*Pi/100);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;float y = (float) Math.sin(i*2*Pi/100);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;gl.glVertex2f(x, y);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glEnd();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Se debe declarar la constante &#39;Pi&#39; al inicio de la clase! asi:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #e69138;&quot;&gt; public static final double Pi = 3.14159265358979323846;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Se ha utilizado los metodos &lt;b&gt;gl.glTranslatef(), &lt;/b&gt;el cual permite transladar (ubicar) las figuras geometricas sobre la ventana de opengl.&lt;/div&gt;
&lt;div&gt;
Tambien se ha utilizado el metodo &lt;b&gt;gl.glRotatef(), &lt;/b&gt;el cual permite rotar las figuras para obtener el angulo de rotacion deseado.&lt;/div&gt;
&lt;br /&gt;
El codigo utilizado para la aplicacion es el siguiente:&lt;br /&gt;
&lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=saPLkTeS&quot; style=&quot;border: none; width: 100%;&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;br /&gt;
Como se puede observar en el codigo, es muy simple la creacion del cuarto en 3D; lo unico que hay que hacer es ubicar bien los componentes para que nos de la impresion de estar en un cuarto en 3 dimensiones.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Nuestro programa quedaria asi:&lt;br /&gt;
&lt;center&gt;
&lt;script async src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- new006 --&gt;
&lt;ins class=&quot;adsbygoogle&quot;
     style=&quot;display:inline-block;width:250px;height:250px&quot;
     data-ad-client=&quot;ca-pub-1329294398604545&quot;
     data-ad-slot=&quot;9582941334&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/center&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7XEQiWXVOesfggZLZdamFyFgvP8qzgKaetjlbPvejow8qo22tcBuy4oFxQcgdhOgowQbhE_7uosr5PVmB9xw4ywWBA4KF2yghBbxuzTRXfbSL5EmRba6fL4RwmOFQWboo1bvytvspqW4/s1600/circunferencia_OpenGL.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;340&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7XEQiWXVOesfggZLZdamFyFgvP8qzgKaetjlbPvejow8qo22tcBuy4oFxQcgdhOgowQbhE_7uosr5PVmB9xw4ywWBA4KF2yghBbxuzTRXfbSL5EmRba6fL4RwmOFQWboo1bvytvspqW4/s400/circunferencia_OpenGL.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Si se desea descargar el proyecto completo click en la siguiente imagen:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://skydrive.live.com/#cid=CB2C976AE9CB5D07&amp;amp;id=CB2C976AE9CB5D07%21343&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIaQX80xUmQpz47HtwVwPvFhsP6jTY0AsGjNBnYFJ-dTqmbrMbNtRiR-MweGyLqkTsaN0NUyf4kmpzOBzMsjawAxAL9le71PQeblPlnDdAxviPxflX-uE5DZym9kFfeJa6C_cyHrmXMbY/s1600/descargar.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/1136624640657080055/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/como-dibujar-figuras-con-opengl-en-java.html#comment-form' title='3 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/1136624640657080055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/1136624640657080055'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/como-dibujar-figuras-con-opengl-en-java.html' title='Como Dibujar Figuras con OpenGL en Java Netbeans 7.1'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7XEQiWXVOesfggZLZdamFyFgvP8qzgKaetjlbPvejow8qo22tcBuy4oFxQcgdhOgowQbhE_7uosr5PVmB9xw4ywWBA4KF2yghBbxuzTRXfbSL5EmRba6fL4RwmOFQWboo1bvytvspqW4/s72-c/circunferencia_OpenGL.JPG" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13473815328994103.post-7787478215088609838</id><published>2012-10-21T22:05:00.000-07:00</published><updated>2012-10-28T12:25:53.696-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cincunferencia"/><category scheme="http://www.blogger.com/atom/ns#" term="circulos"/><category scheme="http://www.blogger.com/atom/ns#" term="dibujar con opengl"/><category scheme="http://www.blogger.com/atom/ns#" term="dibujar figuras"/><category scheme="http://www.blogger.com/atom/ns#" term="GL_POLYGON"/><category scheme="http://www.blogger.com/atom/ns#" term="glBegin()"/><category scheme="http://www.blogger.com/atom/ns#" term="glEnd()"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl en java"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl en netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="opengl y java"/><title type='text'>Como dibujar Circunferencias en OpenGL en Java Netbeans 7.1</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
En esta nueva entrada veremos como dibujar una circunferencia y una semicircunferencia a traves de &lt;b&gt;opengl &lt;/b&gt;en &lt;b&gt;Java&lt;/b&gt;&amp;nbsp;utilizando la &lt;b&gt;IDE&lt;/b&gt;&amp;nbsp;Netbeans 7.1.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Para poder dibujar una circunferencia hacemos uso de la funcion &lt;b&gt;gl.GL_POLYGON.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
Antes que nada es importante saber que para poder utilizar opengl en netbeans se debe tener instalado el plugin que permite hacer esto.&lt;br /&gt;
&lt;br /&gt;
Para poder utilizar opengl en netbeans seguir el siguiente enlace:&lt;br /&gt;
&lt;a href=&quot;http://aflrovvs.blogspot.com/2012/09/como-agregar-plugin-de-opengl-netbeans.html&quot; target=&quot;_blank&quot;&gt;Como Agregar Plugin de OpenGL a Netbeans.&lt;/a&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
El dibujo de una circunferencia es muy sencillo y se logra a traves del siguiente codigo:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #e69138;&quot;&gt; //Dibuja circunferencia&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glBegin(gl.GL_POLYGON);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(int i=0; i&amp;lt;100; i++){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;float x = (float) Math.cos(i*2*Pi/100);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;float y = (float) Math.sin(i*2*Pi/100);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;gl.glVertex2f(x, y); gl.glColor3f(1.0f, 0.8f, 0.2f);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glEnd();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glFlush();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Como se puede observar, se dibuja un poligono de muchisimos lados, lo que da la impresion que se esta dibujando una circunferencia.&lt;br /&gt;
&lt;br /&gt;
Para el dibujo de la semicircunferencia el codigo es muy parecido, la unica diferencia esta en que la variable &quot;i&quot; recorre hasta el numero 51, en vez de recorrer hasta el numero 100 como es el caso de la circunferencia.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #e69138;&quot;&gt;//dibuja semiCircunferencia&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glBegin(gl.GL_POLYGON);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(int i=0; i&amp;lt;51; i++){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;float x = (float) Math.cos(i*2*Pi/100);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;float y = (float) Math.sin(i*2*Pi/100);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;gl.glVertex2f(x, y); gl.glColor3f(0.0f, 1.0f, 1.0f);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glEnd();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gl.glFlush();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Para poder utilizar este codigo se debe declarar la variable &lt;b&gt;&quot;Pi&quot; &lt;/b&gt;con anterioridad al inicio de la clase:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp;public static final double Pi = 3.14159265358979323846;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
El codigo completo utilizado para nuestra aplicacion es el siguiente:&lt;br /&gt;
&lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=Rg6pvpWX&quot; style=&quot;border: none; width: 100%;&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;br /&gt;
La salida de nuestra aplicacion se vera de la siguiente manera:&lt;br /&gt;
&lt;center&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-1329294398604545&quot;;
/* triangulosOpenGL */
google_ad_slot = &quot;4421441991&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/center&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiP4FqvZKiP_Uw9R3zE9w8I-L9Z2DBGGG0MLAibN6JIsUamVZOiStfYcGkCKSlWFGuboz0LeC4M6sqwFJSNX3eyv8g6hSQQaINcFlIzTP90kbSLbMLfaTMqjLEIC_3quJ0Z9zH80dk9Bs/s1600/circunferencia_OpenGL.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;280&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiP4FqvZKiP_Uw9R3zE9w8I-L9Z2DBGGG0MLAibN6JIsUamVZOiStfYcGkCKSlWFGuboz0LeC4M6sqwFJSNX3eyv8g6hSQQaINcFlIzTP90kbSLbMLfaTMqjLEIC_3quJ0Z9zH80dk9Bs/s400/circunferencia_OpenGL.JPG&quot; width=&quot;336&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Si se desea descargar el proyecto completo click en la siguiente imagen:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://skydrive.live.com/#cid=CB2C976AE9CB5D07&amp;amp;id=CB2C976AE9CB5D07%21341&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtMzmxxjRRiOqXX9PhyKhYdXHZaMFIiv0zb_ZE0HMK1JCj1XxYXa5Jy81wtPrjSrVNnddgn0ghuihyphenhyphent9qJagPe-DA8XK5iDCZGnOjIczudvFC01PlnnWoczSQv9PQvcHDgmVhuaB-WN10/s1600/descargar.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://aflrovvs.blogspot.com/feeds/7787478215088609838/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/como-dibujar-circunferencias-en-opengl.html#comment-form' title='8 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7787478215088609838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13473815328994103/posts/default/7787478215088609838'/><link rel='alternate' type='text/html' href='http://aflrovvs.blogspot.com/2012/10/como-dibujar-circunferencias-en-opengl.html' title='Como dibujar Circunferencias en OpenGL en Java Netbeans 7.1'/><author><name>Rafael Gallardo</name><uri>http://www.blogger.com/profile/09121172338506081415</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiP4FqvZKiP_Uw9R3zE9w8I-L9Z2DBGGG0MLAibN6JIsUamVZOiStfYcGkCKSlWFGuboz0LeC4M6sqwFJSNX3eyv8g6hSQQaINcFlIzTP90kbSLbMLfaTMqjLEIC_3quJ0Z9zH80dk9Bs/s72-c/circunferencia_OpenGL.JPG" height="72" width="72"/><thr:total>8</thr:total></entry></feed>