<?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-707635783452779018</id><updated>2025-01-09T14:06:18.716-05:00</updated><category term="java"/><category term="aplicacion"/><category term="jar"/><category term="programa"/><category term="arreglo"/><category term="coneccion"/><category term="programacion"/><category term="sql"/><category term="sun"/><category term="base"/><category term="base de datos"/><category term="cadena"/><category term="clase"/><category term="datos"/><category term="imagen"/><category term="jdbc"/><category term="metodo"/><category term="nuevo"/><category term="numero"/><category term="número"/><category term="objetos"/><category term="opcion"/><category term="orden"/><category term="ordenamiento"/><category term="primos"/><category term="sql 2008"/><category term="2008"/><category term="2d"/><category term="Action"/><category term="ActionListener"/><category term="Asccess"/><category term="Frame"/><category term="JFrame"/><category term="JoptionPane"/><category term="PopupMenu"/><category term="RUT"/><category term="SystemTray"/><category term="Trayicon"/><category term="actualizacion"/><category term="aleatorio"/><category term="algoritmo"/><category term="amenidades"/><category term="aplicación"/><category term="aplicativo"/><category term="archivos"/><category term="arraylist"/><category term="arreglos"/><category term="ascii"/><category term="ayuda"/><category term="basico"/><category term="bidimensional"/><category term="burbuja"/><category term="buscado"/><category term="bytecode"/><category term="capicua"/><category term="carpetas"/><category term="centrar"/><category term="cesar"/><category term="char"/><category term="cheque"/><category term="codigo"/><category term="columnas"/><category term="conectar php y sql"/><category term="conector"/><category term="consola"/><category term="convertir"/><category term="criptografia"/><category term="código"/><category term="deporte"/><category term="desocultar"/><category term="digito"/><category term="documento"/><category term="driver"/><category term="ejecutar"/><category term="ejemplo"/><category term="elegir"/><category term="elemento"/><category term="entretenimiento"/><category term="escala"/><category term="español"/><category term="estadisticas"/><category term="eventos"/><category term="exec"/><category term="extender"/><category term="externo"/><category term="factura"/><category term="forma"/><category term="hex"/><category term="identificar"/><category term="imprimir"/><category term="ingles"/><category term="instanciar"/><category term="intervalo"/><category term="javascript"/><category term="jonathan"/><category term="juego"/><category term="juegos"/><category term="julio"/><category term="letra"/><category term="menor"/><category term="minimizar"/><category term="mssql"/><category term="nueva"/><category term="número a texto"/><category term="ordeniamiento"/><category term="otros"/><category term="pantalla"/><category term="parametros"/><category term="php"/><category term="principal"/><category term="problema"/><category term="properties"/><category term="propiedades"/><category term="recibos"/><category term="reloj"/><category term="runtime"/><category term="salida"/><category term="server"/><category term="servidor"/><category term="sodoku"/><category term="solucion"/><category term="sql server"/><category term="swing"/><category term="tecnica"/><category term="trabajo"/><category term="traduccion"/><category term="uso"/><category term="utilizar"/><category term="validacion"/><category term="venta"/><category term="windows"/><category term="zoom"/><title type='text'>Programación fácil con JAVA</title><subtitle type='html'>Desde lo básico a lo avanzado veras que sencillo es programar en java</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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>69</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-4691889187924587791</id><published>2016-06-03T11:55:00.001-05:00</published><updated>2016-06-03T12:01:47.463-05:00</updated><title type='text'>Spring Framework  y el ciclo de vida MVC</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Spring Framerowk se adhiere el paradigma de programación Modelo-Vista-Controlador (MVC) para el desarrollo de sus proyectos.&lt;br /&gt;
Cuando se crea una aplicacion Java SE web todo se hace en torno a un Servlet central, que es el encargado de seleccionar 
que controlador se encarga de cada respuesta, y dentro de cada uno de 
estos controladores se realizan las tareas necesarias para servirla.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Spring Framework nos provee para desempeñar la tarea de Servlet central de &lt;a href=&quot;http://static.springsource.org/spring/docs/4.0.x/javadoc-api/org/springframework/web/servlet/DispatcherServlet.html&quot; target=&quot;_blank&quot; title=&quot;DispatcherServlet&quot;&gt;DispatcherServlet&lt;/a&gt;,
 lo que hace especial a este Servlet, es que aparte de desempeñar las 
tareas de comunes de despachador, tiene una completa integración con 
Spring IoC.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;img alt=&quot;&quot; height=&quot;410&quot; src=&quot;https://static.springsource.org/spring/docs/4.0.x/spring-framework-reference/html/images/mvc.png&quot; width=&quot;640&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Tal y como podemos ver en la imagen anterior, &lt;a href=&quot;http://static.springsource.org/spring/docs/4.0.x/javadoc-api/org/springframework/web/servlet/DispatcherServlet.html&quot; target=&quot;_blank&quot; title=&quot;DispatcherServlet&quot;&gt;DispatcherServlet&lt;/a&gt;
 realiza las tareas de Controlador Frontal, delega en el Controlador de 
cada llamada las operaciones internas requeridas para realizar la 
respuesta y una vez que este le devuelve la información necesaria para 
emitir dicha respuesta &lt;a href=&quot;http://static.springsource.org/spring/docs/4.0.x/javadoc-api/org/springframework/web/servlet/DispatcherServlet.html&quot; target=&quot;_blank&quot; title=&quot;DispatcherServlet&quot;&gt;DispatcherServlet&lt;/a&gt; delega en un ViewResolver el renderizado de la respuesta.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Típicamente esta acción se realizada con
 la clase ModelAndView, en dicha clase el Controlador cargaba los datos y
 el nombre de la vista para que esta fuera renderizada.&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Map&lt;string object=&quot;&quot;&gt; myModel= new HashMap&lt;string object=&quot;&quot;&gt;();
miModelo.put(&quot;integer_value&quot;, 500);
miModelo.put(&quot;string_value&quot;, &quot;cadena aleatoria&quot;);
ModelAndView miMAV = new ModelAndView();
miMAV.setViewName(&quot;my_currently_view&quot;);
miMAV.addObject(myModel);
return miMAV;
}
&lt;/string&gt;&lt;/string&gt;&lt;/pre&gt;



Con la aparición de los Controladores por anotaciones (@Controller), esta operación ha variado significativamente, utilizandose la clase Model a través del Controlador para registrar los datos que serán utilizados por la vista, la cual es devuelta en el retorno del método del controlador.</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/4691889187924587791/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2016/06/spring-framework-y-el-ciclo-de-vida-mvc.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/4691889187924587791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/4691889187924587791'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2016/06/spring-framework-y-el-ciclo-de-vida-mvc.html' title='Spring Framework  y el ciclo de vida MVC'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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-707635783452779018.post-5953859122691533792</id><published>2012-12-04T17:04:00.001-05:00</published><updated>2012-12-06T17:47:21.838-05:00</updated><title type='text'>Leer Excel desde Java con POI</title><content type='html'>Hola&amp;nbsp;tal&amp;nbsp;vez alguna ves hemos necesitado leer un archivo excel desde java y no hemos tenido idea de como hacerlo.&lt;br /&gt;
Bueno les traigo un&amp;nbsp;método&amp;nbsp;bien&amp;nbsp;fácil&amp;nbsp;y practico para esto necesitamos usar la api Apache POI.&lt;br /&gt;
Adjunto el&amp;nbsp;código&amp;nbsp;para que puedan observarlo.&lt;br /&gt;
Admite tanto Xls como Xlsx ,estan separados en&amp;nbsp;métodos&amp;nbsp;distintos para que observen las diferencias.&lt;br /&gt;
Para esto necesitaran los siguientes plugins:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;xbean.jar&lt;/li&gt;
&lt;li&gt;dom4j-2.0.0-ALPHA-2.jar ( o la version1.4 da lo mismo)&lt;/li&gt;
&lt;li&gt;poi-ooxml-schemas-3.8-20120326.jar&lt;/li&gt;
&lt;li&gt;poi-ooxml-3.8-20120326.jar&lt;/li&gt;
&lt;li&gt;poi-3.8-20120326.jar&lt;/li&gt;
&lt;/ul&gt;
CODIGO EJEMPLO:&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;

import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

/**

 * @author jonathan-palomino.blogspot.com

 */

public class LectorExcel {

 boolean antiguo = false;
 /**

  * Este metodo es usado para leer archivos Excel

  *

  * @param Nombre_Archivo

  *            - Nombre de archivo Excel.

  */
 private void Leer_Archivo_Excel(String Nombre_Archivo) {

  /**

   * Crea una nueva instancia de Lista_Datos_Celda

   */

  List Lista_Datos_Celda = new ArrayList();

  if (Nombre_Archivo.contains(&quot;.xlsx&quot;)) {

   GENERAR_XLSX(Nombre_Archivo, Lista_Datos_Celda);

   antiguo = false;

  } else if (Nombre_Archivo.contains(&quot;.xls&quot;)) {

   GENERAR_XLS(Nombre_Archivo, Lista_Datos_Celda);

   antiguo = true;

  }

  /**

   * Llama el metodo Imprimir_Consola para imprimir los datos de la celda

   * en la consola.

   */

  Imprimir_Consola(Lista_Datos_Celda);

 }

 private void GENERAR_XLSX(String Nombre_Archivo, List Lista_Datos_Celda) {

  try {

   /**

    * Crea una nueva instancia de la clase FileInputStream

    */

   FileInputStream fileInputStream = new FileInputStream(

     Nombre_Archivo);

   /**

    * Crea una nueva instancia de la clase XSSFWorkBook

    */

   XSSFWorkbook Libro_trabajo = new XSSFWorkbook(fileInputStream);

   XSSFSheet Hoja_hssf = Libro_trabajo.getSheetAt(0);

   /**

    * Iterar las filas y las celdas de la hoja de cálculo para obtener

    * toda la data.

    */

   Iterator Iterador_de_Fila = Hoja_hssf.rowIterator();

   while (Iterador_de_Fila.hasNext()) {

    XSSFRow Fila_hssf = (XSSFRow) Iterador_de_Fila.next();

    Iterator iterador = Fila_hssf.cellIterator();

    List Lista_celda_temporal = new ArrayList();

    while (iterador.hasNext()) {

     XSSFCell Celda_hssf = (XSSFCell) iterador.next();

     Lista_celda_temporal.add(Celda_hssf);

    }

    Lista_Datos_Celda.add(Lista_celda_temporal);

   }

  } catch (Exception e) {

   e.printStackTrace();

  }

 }

 private void GENERAR_XLS(String Nombre_Archivo, List Lista_Datos_Celda) {

  try {

   /**

    * Crea una nueva instancia de la clase FileInputStream

    */

   FileInputStream fileInputStream = new FileInputStream(

     Nombre_Archivo);

   /**

    * Crea una nueva instancia de la clase POIFSFileSystem

    */

   POIFSFileSystem fsFileSystem = new POIFSFileSystem(fileInputStream);

   /**

    * Crea una nueva instancia de la clase HSSFWorkBook

    */

   HSSFWorkbook Libro_trabajo = new HSSFWorkbook(fsFileSystem);

   HSSFSheet Hoja_hssf = Libro_trabajo.getSheetAt(0);

   /**

    * Iterar las filas y las celdas de la hoja de cálculo para obtener

    * toda la data.

    */

   Iterator Iterador_de_Fila = Hoja_hssf.rowIterator();

   while (Iterador_de_Fila.hasNext()) {

    HSSFRow Fila_hssf = (HSSFRow) Iterador_de_Fila.next();

    Iterator iterador = Fila_hssf.cellIterator();

    List Lista_celda_temporal = new ArrayList();

    while (iterador.hasNext()) {

     HSSFCell Celda_hssf = (HSSFCell) iterador.next();

     Lista_celda_temporal.add(Celda_hssf);

    }

    Lista_Datos_Celda.add(Lista_celda_temporal);

   }

  } catch (Exception e) {

   e.printStackTrace();

  }

 }

 /**

  * Este método se utiliza para imprimir los datos de la celda a la consola.

  *

  * @param Datos_celdas

  *            - Listado de los datos que hay en la hoja de cálculo.

  */

 private void Imprimir_Consola(List Datos_celdas) {

  String Valor_de_celda;

  for (int i = 0; i &lt; Datos_celdas.size(); i++) {

   List Lista_celda_temporal = (List) Datos_celdas.get(i);

   for (int j = 0; j &lt; Lista_celda_temporal.size(); j++) {

    if (antiguo) {

     HSSFCell hssfCell = (HSSFCell) Lista_celda_temporal.get(j);

     Valor_de_celda = hssfCell.toString();

    } else {

     XSSFCell hssfCell = (XSSFCell) Lista_celda_temporal.get(j);

     Valor_de_celda = hssfCell.toString();

    }

    System.out.print(Valor_de_celda + &quot;\t&quot;);

   }

   System.out.println();

  }

 }

 public static void main(String[] args) {

  String fileName = &quot;C:&quot; + File.separator + &quot;Users&quot; + File.separator

    + &quot;synccon&quot; + File.separator + &quot;Desktop&quot; + File.separator

    + &quot;abc.xls&quot;;

  System.out.println(fileName);

  new LectorExcel().Leer_Archivo_Excel(fileName);

 }

}

&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/5953859122691533792/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/12/leer-excel-desde-java-con-poi.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/5953859122691533792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/5953859122691533792'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/12/leer-excel-desde-java-con-poi.html' title='Leer Excel desde Java con POI'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-8191213181967781444</id><published>2012-07-10T17:00:00.001-05:00</published><updated>2012-12-06T17:58:43.553-05:00</updated><title type='text'>Estructuras dinámicas</title><content type='html'>Hola ,hace mucho tiempo que tenemos estructuras optimas para guardar datos como las listas genéricas o los treemap pero a modo de ejemplo vamos a reinventar la rueda.&lt;br /&gt;
Lo que intentaremos haces es una estructura doble con 2 apuntadores en memoria para que así puedas ir de derecha a izquierda y viceversa en cualquier momento.&lt;br /&gt;
Nos referimos a un nodo doble aquí unas imágenes para obtener una idea.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7d97t5fHTHLKiYsc2Nev4HSD-0cJHa4H8hIM1vUDltz1aZQCZ4MxYhTiE96gbemXAF1nEo9RyTu2Mecx9sMavfNpsnP-KHciCCzhfFq6GH6l3cptzr_MpR0hjtNY4jAhFji51pOulV4A/s1600-h/inicio%25255B2%25255D.png&quot;&gt;&lt;img alt=&quot;inicio&quot; border=&quot;0&quot; height=&quot;57&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-Kvmmg7FRKm97dHMPPJqpV2WG5TCwRGH-2gsxQkhA2o6ZuNpGDRnoCRB322OZpHikGG4OYF-G4eqJCOob-FqrT1BNlahkvB8JAmzr0bfBMKSr8PI7_bmEzZNQLQ8qpNC-T7-hFLgu-dU/?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px 4px 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;inicio&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Nodo inicial con 2 apuntadores inicialmente a null&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtapv0HnJo5DyjW6t9mOv7Nz-2SZli_LBHvx5cNzDhskTsPNVbpWXybE0yzMvHUz7DTv17rGbLN3bgDNvYgHQVjtN_FsrVhHyAkvP4Z5NKp4fd_wpF6Ss53QwwB0qZQ7IeM_QEJMmwBrE/s1600-h/fin%25255B2%25255D.png&quot;&gt;&lt;img alt=&quot;fin&quot; border=&quot;0&quot; height=&quot;42&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih7mF0IPIGtgQqGGZ9hMAzZHvg6aELNNU6bvrQJrjrA5A6vjJUnJKnji9QucOIhBPnOszmghstq1sfRGBFKH7tuKWeCUOBekw_2dqtoWsra94fX-h2Hw-luj9yK6wFhA_cIuKoU7Fp0XE/?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px 4px 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;fin&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
El nodo final con la misma idea.&lt;br /&gt;
Agreguemos una estructura nueva se vería así:&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLe6rQpxY1xQWzD_F4IqBc8X5UascgOQDkgBHdWnPrlqHeYGTuT4a7hoe5-XiG2Z_e-1Qkbj_pbbRNnUIAd-MJ19FQT6fWY_AybbqSL4cu6VaQvFuEgB4N_4PrO7T_WM2q_9XQ0gNQCrk/s1600-h/nodo1%25255B2%25255D.png&quot;&gt;&lt;img alt=&quot;nodo1&quot; border=&quot;0&quot; height=&quot;108&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyQXfrNKjxLDSPmgZkThKp1iNr-JFbGeDY0XN8RRMbnoii1uyCAxt9U6aDQcHhv-MuKGAIStW8I6LcManoADgYx-N-tnn7GyChbWitVFqW3k5hylTnDhwNPWGxcyjXfOKNUg8SQfo9NMI/?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px 4px 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;nodo1&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Aqui vemos un nodo inicio apuntando hacia un nodo con datos.&lt;br /&gt;
Si aplicamos la misma idea tendremos lo siguiente:&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTnw1_KJzF_sxPPzt0nf44PtpWfkbyjZv05nu6b6enLnfVFHRS8DD96cqbJ1cQVEEgNZDd9efb-FjVivvd_Ui6hmoBdYsMvzdI1Tkecf-vc1DpNbToGrCOi9e3tIVHroM0NlQdXaQq3ds/s1600-h/nodo%252520n%25255B4%25255D.png&quot;&gt;&lt;img alt=&quot;nodo n&quot; border=&quot;0&quot; height=&quot;120&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB9TrmWrxz390QH9a_IxN2y82q64CkQFnYCHDwTwjQZSVN9jl9NqXNeaVeXMfwo7DRR42NOjwX7Yw8lPUMhzxN0eKSKNh00B0vScmtG70HjL8Ll3PoZXPDln9EhFI2tVdBiycFub__504/?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px 4px 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;nodo n&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Entonces tenemos una estructura dinámica en memoria ya que los datos se pierden al cerrar el programa o si es que apuntan los nodos inicio y fin a nulo así el recolector de basura los elimina.&lt;br /&gt;
Vamos de plano al&amp;nbsp;código:&lt;br /&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
/**
 *
 * @author jonathan-palomino.blogspot.com
 */
//Clase para una lista doble :
public class NodoDoble {
	private Productos Producto;// informacion
	private NodoDoble ApuntAnt;	// enlace con el anterior
	private NodoDoble ApuntSgte;// enlace con el siguiente

	// constructor
	NodoDoble(Productos Producto){this.Producto=Producto;}
//Esta clase productos será una clase que podrá contener N datos que se podrán setear desde un aplicativo algo así como capas.
	// get/set
        void setPro(Productos Producto){this.Producto=Producto;}
	void setApuntSgte(NodoDoble ApuntSgte){this.ApuntSgte=ApuntSgte;}
	void setApuntAnt(NodoDoble ApuntAnt){this.ApuntAnt = ApuntAnt;}

	Productos getPro(){return Producto;	}
	NodoDoble getApuntSgte(){return ApuntSgte;	}
	NodoDoble getApuntAnt(){return ApuntAnt;	}
}// fin de la clase de nodo doble
&lt;/pre&gt;

&lt;pre&gt;Para la clase enlazadora donde podremos poner la lógica de agregación para que trabaje.&lt;/pre&gt;
&lt;br /&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
/**
 *
 * @author jonathan-palomino.blogspot.com
 */
public class ListaDobleConOrden{
	private NodoDoble inicio;
	private NodoDoble fin;

	// constructor
	ListaDobleConOrden(){inicio=null; fin=null;}

	// get/set
	void setInicio(NodoDoble inicio){this.inicio=inicio;	}
	void setFin(NodoDoble fin){this.fin=fin;	}
	NodoDoble getInicio(){return inicio;	}
	NodoDoble getFin(){ return fin;	}

	// metodos de administracion
	void agrega(Productos Producto){
		NodoDoble nuevo, auxiliar;

		//...preparar nuevo nodo ...
 		nuevo = new NodoDoble(Producto);
		nuevo.setApuntSgte(null);
		nuevo.setApuntAnt(null);

		//...adicionar nuevo nodo a la lista...
		if(inicio == null) {
			//primer nodo
			inicio = nuevo;
			fin = inicio;
		} else //Por codigo orden
                if(Producto.getCodigo().compareTo(
                    inicio.getPro().getCodigo())&lt;0) {
                    //antes del primer nodo
                    nuevo.setApuntSgte(inicio);
                    inicio.setApuntAnt(nuevo);
                    inicio = nuevo;
                } else
                if(Producto.getCodigo().compareTo(
                    fin.getPro().getCodigo())&gt;0 ||
			Producto.getCodigo().compareTo(
                    fin.getPro().getCodigo())==0)	{
                    //después del último nodo
                    nuevo.setApuntAnt(fin);
                    fin.setApuntSgte(nuevo);
                    fin = nuevo;
		} else {
                    //entre dos nodos ya existentes
                    auxiliar = inicio;

                    // ubica el anterior
                    while(Producto.getCodigo().compareTo(
			auxiliar.getPro().getCodigo())&gt;0||
			Producto.getCodigo().compareTo(
			auxiliar.getPro().getCodigo())==0) {
                auxiliar = auxiliar.getApuntSgte();
            }

                    // enlaza
                    nuevo.setApuntSgte(auxiliar);
                    nuevo.setApuntAnt(auxiliar.getApuntAnt());
                    auxiliar.getApuntAnt().setApuntSgte(nuevo);
                    auxiliar.setApuntAnt(nuevo);
		}
	}
	//.....busca un codigo en la lista
	NodoDoble busca(String codigo) {
            // empieza por el primero de la lista
            NodoDoble Auxiliar = inicio;

            // mientras no sea nulo
            while(Auxiliar != null)	{
		if(codigo.equals(Auxiliar.getPro().getCodigo()))
                    return Auxiliar;// lo encontró
		else
                    Auxiliar = Auxiliar.getApuntSgte(); // pasa al siguiente
	}// fin del while
	// terminó la lista y no lo encontró
	return null;
	}
}//fin de la clase ListaDobleConOrden
&lt;/pre&gt;


La clase productos solo es una clase de seteo u getteo de valores:

&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
public class Productos {

private  String Codigo;
    // constructor vacío
    public Productos(){ }
    // constructor que recibe un objeto con datos
    public Productos(Productos obj)
    {
        Codigo = obj.getCodigo();
    }
    public String getCodigo() {
        return Codigo;
    }
    public void setCodigo(String Codigo) {
        this.Codigo = Codigo;
    }
}
&lt;/pre&gt;

Para ejemplo de uso:

&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
public class Principal{
static ListaDobleConOrden ldco =new ListaDobleConOrden();
Productos Productos;
public static void main(String args[]){
ldco.setInicio(null);
    Productos =new Productos();
    Productos.setDescripcion( &quot;abc&quot; );
    ldco.agrega(Productos);
}
}
&lt;/pre&gt;

En caso necesites buscar algo se puede usar &lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
NodoDoble auxiliar = Principal.ldco.busca(codigo);
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/8191213181967781444/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/07/estructuras-dinamicas.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8191213181967781444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8191213181967781444'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/07/estructuras-dinamicas.html' title='Estructuras dinámicas'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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/AVvXsEh-Kvmmg7FRKm97dHMPPJqpV2WG5TCwRGH-2gsxQkhA2o6ZuNpGDRnoCRB322OZpHikGG4OYF-G4eqJCOob-FqrT1BNlahkvB8JAmzr0bfBMKSr8PI7_bmEzZNQLQ8qpNC-T7-hFLgu-dU/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-2175868382939407848</id><published>2012-06-01T17:00:00.001-05:00</published><updated>2012-12-06T18:00:57.437-05:00</updated><title type='text'>Jtable con Checkboxs</title><content type='html'>Si en alguna oportunidad has necesitado poner checkbox en un Jtable y no tubiste ni idea aquí veremos lo fácil que resulta.&lt;br /&gt;
Todo va dentro de un arreglo estático pero Uds pueden ponerlo en un for while u otra estructura de control antes de lanzar el agregado o la función getTable()&lt;br /&gt;
Adjunto el código:
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
/** 
* 
* @author http://jonathan-palomino.blogspot.com/ 
* 
*/ 
import javax.swing.SwingUtilities; 
import java.awt.BorderLayout; 
import javax.swing.JPanel; 
import javax.swing.JFrame; 
import javax.swing.UIManager;
import javax.swing.JScrollPane; 
import javax.swing.JTable; 
import javax.swing.table.DefaultTableModel;
public class J_table extends JFrame {
    private static final long serialVersionUID = 1L; 
    private JPanel jContentPane = null; 
    private JScrollPane scroll = null; 
    private JTable Table = null; 
    Object[] columnas = {&quot;ACTIVOS&quot;, &quot;NOMBRE&quot;, &quot;EDAD&quot;}; 
    Object[][] datos = { 
        {true,&quot;JOSE&quot;,50}, 
        {false,&quot;ANDREA&quot;,12}, 
        {true,&quot;IVETTE&quot;,18}, 
        {false,&quot;JUAN&quot;,18}};
    /** 
     * This method initializes scroll    
     *     
     * @return javax.swing.JScrollPane    
     */ 
    private JScrollPane getScroll() { 
        if (scroll == null) { 
            scroll = new JScrollPane(); 
            scroll.setViewportView(getTable()); 
        } 
        return scroll; 
    }
    /** 
     * This method initializes Table    
     *     
     * @return javax.swing.JTable    
     */ 
    private JTable getTable() { 
        if (Table == null) { 
             DefaultTableModel modelo = new DefaultTableModel(datos, columnas) { 
                    public Class&lt;?&gt; getColumnClass(int column) { 
                        return getValueAt(1, column).getClass(); 
                    } 
                }; 
            Table = new JTable(modelo); 
           
        } 
        return Table; 
    }
    /** 
     * @param args 
     */ 
    public static void main(String[] args) { 
        // TODO Auto-generated method stub 
        SwingUtilities.invokeLater(new Runnable() { 
            public void run() { 
                try{ 
                    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 
                }catch(Exception e) { 
                    e.printStackTrace(); 
                } 
                J_table thisClass = new J_table(); 
                thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
                thisClass.setVisible(true); 
            } 
        }); 
    }
    /** 
     * This is the default constructor 
     */ 
    public J_table() { 
        super(); 
        initialize(); 
    }
    /** 
     * This method initializes this 
     * 
     * @return void 
     */ 
    private void initialize() { 
        this.setSize(609, 281); 
        this.setContentPane(getJContentPane()); 
        this.setTitle(&quot;JTable con checkbox por http://jonathan-palomino.blogspot.com/&quot;); 
        this.setLocationRelativeTo(null); 
    }
    /** 
     * This method initializes jContentPane 
     * 
     * @return javax.swing.JPanel 
     */ 
    private JPanel getJContentPane() { 
        if (jContentPane == null) { 
            jContentPane = new JPanel(); 
            jContentPane.setLayout(new BorderLayout()); 
            jContentPane.add(getScroll(), BorderLayout.CENTER); 
        } 
        return jContentPane; 
    }
} 
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/2175868382939407848/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/06/jtable-con-checkboxs.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/2175868382939407848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/2175868382939407848'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/06/jtable-con-checkboxs.html' title='Jtable con Checkboxs'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-951508188046201659</id><published>2012-06-01T16:51:00.001-05:00</published><updated>2012-12-06T18:02:06.569-05:00</updated><title type='text'>Jlabel editable con tecla Enter</title><content type='html'>En este caso podremos editar en tiempo de ejecución un Jlabel con la tecla Enter con lo cual lo podremos modificar a nuestro gusto.&lt;br /&gt;
Dejo el&amp;nbsp;código&amp;nbsp;para que lo prueben:&lt;br /&gt;
&lt;br /&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
/** 
* 
* @author http://jonathan-palomino.blogspot.com/ 
* 
*/ 
import javax.swing.SwingUtilities; 
import java.awt.BorderLayout; 
import javax.swing.JPanel; 
import javax.swing.JFrame; 
import javax.swing.JTextField;
import java.awt.CardLayout; 
import java.awt.event.KeyAdapter; 
import java.awt.event.KeyEvent; 
import java.awt.event.MouseAdapter; 
import java.awt.event.MouseEvent;
import javax.swing.JLabel; 
import java.awt.Font; 
import javax.swing.SwingConstants;
public class principal extends JFrame {
    private static final long serialVersionUID = 1L; 
    private JPanel jContentPane = null; 
    private JPanel panel_edicion = null; 
    private JLabel etiqueta_editable = null; 
    /*************************************/ 
    //si el usuario hizo enter 
    private static final int confirmar = KeyEvent.VK_ENTER; 
    //si es usuario pulso escape 
    private static final int cancelo = KeyEvent.VK_ESCAPE; 
    private CardLayout card;//utilizo el carlayotu para manejar varios objetos dentro del mismo panel 
    private static final String txt_caja = &quot;text field&quot;;  //  @jve:decl-index=0: 
    private JTextField caja_edicion; 
    private static final String LABEL = &quot;label&quot;; 
    private String valor=new String(&quot;&quot;);
    /** 
     * This method initializes panel_edicion    
     *     
     * @return javax.swing.JPanel    
     */ 
    private JPanel getPanel_edicion() { 
        if (panel_edicion == null) { 
            card = new CardLayout(); 
            etiqueta_editable = new JLabel(); 
            etiqueta_editable.setText(&quot;Programación fácil con JAVA&quot;); 
            etiqueta_editable.setHorizontalAlignment(SwingConstants.CENTER); 
            etiqueta_editable.setFont(new Font(&quot;Dialog&quot;, Font.BOLD, 48)); 
            etiqueta_editable.addMouseListener(new MouseAdapter() { 
                public void mouseClicked(MouseEvent e) { 
                    //si el usurario hizo doble clic encima de la etiqueta 
                    if (e.getClickCount() == 2) { 
                        editando(); 
                    } 
                } 
            }); 
            caja_edicion = new JTextField(); 
            caja_edicion.addKeyListener(new KeyAdapter() { 
                public void keyReleased(KeyEvent e) { 
                    if (e.getKeyCode() == confirmar) { 
                        confirmar(); 
                    } else if (e.getKeyCode() == cancelo) { 
                        cancelar(); 
                    } 
                } 
            }); 
            panel_edicion = new JPanel(card); 
            panel_edicion.add(caja_edicion, txt_caja); 
            panel_edicion.add(etiqueta_editable, LABEL); 
            card.show(panel_edicion, LABEL); 
        } 
        return panel_edicion; 
    }
    /** 
     * @param args 
     */ 
    public static void main(String[] args) { 
        // TODO Auto-generated method stub 
        SwingUtilities.invokeLater(new Runnable() { 
            public void run() { 
                principal thisClass = new principal(); 
                thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
                thisClass.setVisible(true); 
            } 
        }); 
    }
    /** 
     * This is the default constructor 
     */ 
    public principal() { 
        super(); 
        initialize(); 
    }
    /** 
     * This method initializes this 
     * 
     * @return void 
     */ 
    private void initialize() { 
        this.setSize(864, 251); 
        this.setContentPane(getJContentPane()); 
        this.setTitle(&quot;JLabel editable en tiempo de ejecucion por jonathan-palomino.blogspot.com&quot;); 
        this.setLocationRelativeTo(null); 
    }
    /** 
     * This method initializes jContentPane 
     * 
     * @return javax.swing.JPanel 
     */ 
    private JPanel getJContentPane() { 
        if (jContentPane == null) { 
            jContentPane = new JPanel(); 
            jContentPane.setLayout(new BorderLayout()); 
            jContentPane.add(getPanel_edicion(), BorderLayout.CENTER); 
        } 
        return jContentPane; 
    } 
    /*********************************************/ 
    private void editando() { 
        card.show(getPanel_edicion(), txt_caja); 
        caja_edicion.setText(valor); 
        caja_edicion.requestFocus(); 
        caja_edicion.selectAll(); 
    }
    private void cancelar() { 
        caja_edicion.setText(valor); 
        card.show(getPanel_edicion(), LABEL); 
    }
    public void confirmar() { 
        valor = caja_edicion.getText(); 
        etiqueta_editable.setText(valor); 
        card.show(getPanel_edicion(), LABEL); 
    } 
    
} 
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/951508188046201659/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/06/jlabel-editable-con-tecla-enter.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/951508188046201659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/951508188046201659'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/06/jlabel-editable-con-tecla-enter.html' title='Jlabel editable con tecla Enter'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-400364419799684724</id><published>2012-06-01T16:46:00.001-05:00</published><updated>2012-12-06T18:04:19.202-05:00</updated><title type='text'>Aplicando sombra un texto</title><content type='html'>Hola,quien no ha querido aplicar efectos al titulo de una aplicación en este caso aplicaremos sombra y su inclinación como tamaño según parámetros.&lt;br /&gt;
Así obtendrán esta imagen&lt;br /&gt;
&lt;img height=&quot;78&quot; src=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/sombra_texto.png&quot; style=&quot;margin: 0px 4px 4px 0px;&quot; width=&quot;264&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
/** 
* 
* @author http://jonathan-palomino.blogspot.com/ 
* 
*/ 
import javax.swing.SwingUtilities; 
import java.awt.BorderLayout; 
import java.awt.Color; 
import java.awt.Font; 
import java.awt.Graphics; 
import java.awt.Graphics2D;
import javax.swing.JPanel; 
import javax.swing.JFrame; 
import java.awt.geom.AffineTransform;
public class Principal extends JFrame {
    private static final long serialVersionUID = 1L; 
    private JPanel jContentPane = null; 
    private int tamaño = 55; 
    private String mensaje = &quot;Programación fácil con JAVA&quot;;  //  @jve:decl-index=0: 
    private int Width=50; 
        private double inclinacion_vertical =-0.95; 
        private double inclinacion_horizontal=0; 
        private double escala_altura=2; 
    /** 
     * @param args 
     */ 
    public static void main(String[] args) { 
        // TODO Auto-generated method stub 
        SwingUtilities.invokeLater(new Runnable() { 
            public void run() { 
                Principal thisClass = new Principal(); 
                thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
                thisClass.setVisible(true); 
            } 
        }); 
    }
    /** 
     * This is the default constructor 
     */ 
    public Principal() { 
        super(); 
        initialize(); 
        
    }
    /** 
     * This method initializes this 
     * 
     * @return void 
     */ 
    private void initialize() { 
        this.setSize(985, 257); 
        this.setResizable(false); 
        this.setLocationRelativeTo(null); 
        this.setContentPane(getJContentPane()); 
        this.setTitle(&quot;TEXTO CON SOMBRA&quot;); 
        this.setBackground(Color.white); 
        Font font = new Font(&quot;DokChampa&quot;, Font.BOLD, tamaño); 
        this.setFont(font); 
    }
    /** 
     * This method initializes jContentPane 
     * 
     * @return javax.swing.JPanel 
     */ 
    private JPanel getJContentPane() { 
        if (jContentPane == null) { 
            jContentPane = new JPanel(); 
            jContentPane.setLayout(new BorderLayout()); 
        } 
        return jContentPane; 
    }
        public void paint(Graphics g) { 
            super.paint(g); 
            Graphics2D graph = (Graphics2D)g; 
            int x = Width; 
            int y = tamaño*5/2; 
            graph.translate(10, y); 
            graph.setPaint(Color.lightGray);            
            AffineTransform origTransform = graph.getTransform(); 
            graph.shear(inclinacion_vertical, inclinacion_horizontal); 
            graph.scale(1, escala_altura); 
            graph.drawString(mensaje, 0, 0); 
            graph.setTransform(origTransform); 
            graph.setPaint(Color.blue); 
            graph.drawString(mensaje, 0, 0); 
        } 
   
} 
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/400364419799684724/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/06/sobra-texto.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/400364419799684724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/400364419799684724'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/06/sobra-texto.html' title='Aplicando sombra un texto'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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="http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/th_sombra_texto.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-5336071080471667564</id><published>2012-04-20T13:03:00.001-05:00</published><updated>2012-12-06T18:05:09.014-05:00</updated><title type='text'>Crear un pop up en un boton</title><content type='html'>Si querían poner un pop up en sus botones como menú de opciones esta es la forma les adjunto el código:&lt;br /&gt;
&lt;br /&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
import javax.swing.JButton; 
import javax.swing.JFrame; 
import javax.swing.JLabel; 
import javax.swing.JMenuItem; 
import javax.swing.JPopupMenu;
/** 
* 
* @author jonathan-palomino.blogspot.com 
*/ 
public class Pop_Up extends JFrame{
    public Pop_Up() { 
        setSize(200,150); 
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 
        prueba.setBounds(40, 40, 140, 50); 
        fantasma.setBounds(10, 10, 50, 30); 
        fantasma.setText(&quot;&quot;); 
        prueba.setText(&quot;Boton padre&quot;); 
        element.add(ele1); 
        element.add(ele2); 
        
        prueba.setComponentPopupMenu(element); 
        
        add(prueba); 
        add(fantasma); 
    } 
    public static void main(String[] args){ 
        Pop_Up ob = new Pop_Up(); 
        ob.show(); 
    } 
    JButton prueba = new JButton(); 
    JPopupMenu element = new JPopupMenu(); 
    JMenuItem ele1 = new JMenuItem(&quot;Elemento1&quot;);    
    JMenuItem ele2 = new JMenuItem(&quot;Elemento2&quot;); 
    JLabel fantasma = new JLabel(); 
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/5336071080471667564/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/04/crear-un-pop-up-en-un-boton.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/5336071080471667564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/5336071080471667564'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/04/crear-un-pop-up-en-un-boton.html' title='Crear un pop up en un boton'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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-707635783452779018.post-6781624306471730994</id><published>2012-04-20T12:14:00.001-05:00</published><updated>2012-12-06T18:05:55.853-05:00</updated><title type='text'>Zipear archivos</title><content type='html'>Para zipear archivos desde java les traigo la siguiente clase:&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
/** 
* 
* @author jonathan-palomino.blogspot.com
*/ 
import java.util.logging.Level; 
import java.util.logging.Logger; 
import java.util.zip.*; 
import java.io.*; 
  
public class Zipear { 
    public static void Comprimir(String args[]) throws IOException{ 
              if (args.length &lt; 2) { 
            System.err.println(&quot;use: Zip.zip file1 file2 file3&quot;); 
            System.exit(-1); 
        } 
        File zipFile = new File(args[0]); 
        if (zipFile.exists()) { 
            System.err.println(&quot;Archivo Zip existente seleccione otro&quot;); 
            System.exit(-2); 
        } 
        FileOutputStream fos = new FileOutputStream(zipFile); 
        ZipOutputStream zos = new ZipOutputStream(fos); 
        int bytesRead; 
        byte[] buffer = new byte[1024]; 
        CRC32 crc = new CRC32(); 
        for (int i=1, n=args.length; i &lt; n; i++) { 
            String name = args[i]; 
            System.out.println(&quot;--------&quot;+name); 
            File file = new File(name); 
            if (!file.exists()) { 
                System.err.println(&quot;Skipping: &quot; + name); 
                continue; 
            } 
            BufferedInputStream bis = new BufferedInputStream( 
                new FileInputStream(file)); 
            crc.reset(); 
            while ((bytesRead = bis.read(buffer)) != -1) { 
                crc.update(buffer, 0, bytesRead); 
            } 
            bis.close(); 
            // Reset to beginning of input stream 
            bis = new BufferedInputStream( 
                new FileInputStream(file)); 
            ZipEntry entry = new ZipEntry(name); 
            entry.setMethod(ZipEntry.STORED); 
            entry.setCompressedSize(file.length()); 
            entry.setSize(file.length()); 
            entry.setCrc(crc.getValue()); 
            zos.putNextEntry(entry); 
            while ((bytesRead = bis.read(buffer)) != -1) { 
                zos.write(buffer, 0, bytesRead); 
            } 
            bis.close(); 
        } 
        zos.close(); 
    } 
    public static void main(String args[])  { 
        String argumentos[] = {&quot;C:\\zip.zip&quot;,&quot;C:\\Test.pdf&quot;}; 
        try { 
            Comprimir(argumentos); 
        } catch (IOException ex) { 
            Logger.getLogger(Zipear.class.getName()).log(Level.SEVERE, null, ex); 
        } 
    } 
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/6781624306471730994/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/04/zipear-archivos.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/6781624306471730994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/6781624306471730994'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/04/zipear-archivos.html' title='Zipear archivos'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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-707635783452779018.post-4926841724987631826</id><published>2012-04-20T11:58:00.001-05:00</published><updated>2012-12-06T18:06:30.472-05:00</updated><title type='text'>Capturar pantalla</title><content type='html'>Si queremos por algún motivo obtener la captura de pantalla con java aquí les dejo el código:&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;pre class=&quot;brush:java&quot;&gt;
import java.awt.Dimension; 
import java.awt.Rectangle; 
import java.awt.Robot; 
import java.awt.Toolkit; 
import java.awt.image.BufferedImage; 
import java.util.logging.Level; 
import java.util.logging.Logger; 
import javax.imageio.ImageIO; 
import java.io.File; 
/** 
* 
* @author jonathan-palomino.blogspot.com 
*/ 
public class Capturar_pantalla { 
    
    public static void main(String [] args){ 
        try { 
            captureScreen(&quot;C:\\archivo.png&quot;); 
        } catch (Exception ex) { 
            Logger.getLogger(Capturar_pantalla.class.getName()).log(Level.SEVERE, null, ex); 
        } 
    } 
    public static void captureScreen(String fileName) throws Exception { 
  
   Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 
   Rectangle screenRectangle = new Rectangle(screenSize); 
   Robot robot = new Robot(); 
   BufferedImage image = robot.createScreenCapture(screenRectangle); 
   ImageIO.write(image, &quot;png&quot;, new File(fileName)); 
  
} 
}
&lt;/pre&gt;
y lo guardan en “archivo.png” o el que deseen para este caso deje el método como static pero no es necesario.</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/4926841724987631826/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/04/capturar-pantalla.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/4926841724987631826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/4926841724987631826'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/04/capturar-pantalla.html' title='Capturar pantalla'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-5983449546894391573</id><published>2012-04-20T11:42:00.001-05:00</published><updated>2012-04-20T11:42:27.294-05:00</updated><title type='text'>Generar PDF</title><content type='html'>&lt;p&gt;&lt;font size=&quot;2&quot; face=&quot;Arial&quot;&gt;El propósito de este post es generar un pdf sencillo mediante Java.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size=&quot;2&quot; face=&quot;Arial&quot;&gt;Nos vamos a la página &lt;/font&gt;&lt;a href=&quot;http://sourceforge.net/projects/itext/files/&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Arial&quot;&gt;http://sourceforge.net/projects/itext/files/&lt;/font&gt;&lt;/a&gt;&lt;font size=&quot;2&quot; face=&quot;Arial&quot;&gt; y descargamos iText. La importamos en nuestro proyecto yendo al menú Biblioteca—agregar archivo jar y seleccionamos los 2 jar.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;El código&lt;/p&gt;  &lt;p&gt;Se trata de una aplicación muy sencilla que escribirá en el pdf un párrafo con un saludo y otro con la fecha actual.&lt;/p&gt;  &lt;p&gt;import com.itextpdf.text.Document;   &lt;br /&gt;import com.itextpdf.text.Paragraph;    &lt;br /&gt;import com.itextpdf.text.pdf.PdfWriter;    &lt;br /&gt;import java.io.File;    &lt;br /&gt;import java.io.FileOutputStream;    &lt;br /&gt;import java.io.OutputStream;    &lt;br /&gt;import java.util.Date;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;public class GeneratePDF {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public static void main(String[] args) {   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; try {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; OutputStream file = new FileOutputStream(new File(&amp;quot;C:\\Test.pdf&amp;quot;));&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Document document = new Document();   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PdfWriter.getInstance(document, file);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; document.open();    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; document.add(new Paragraph(&amp;quot;Hola a todos!&amp;quot;));    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; document.add(new Paragraph(new Date().toString()));&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; document.close();   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; file.close();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } catch (Exception e) {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; e.printStackTrace();   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;}&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/5983449546894391573/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/04/generar-pdf.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/5983449546894391573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/5983449546894391573'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/04/generar-pdf.html' title='Generar PDF'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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-707635783452779018.post-1206990441517677899</id><published>2012-04-20T10:58:00.001-05:00</published><updated>2012-04-20T11:29:50.437-05:00</updated><title type='text'>cambiar icono jframe</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
1)El ícono debe ser una imagen de extensión PNG. Esto se hace más fácil, ya que conseguir una figura y convertirlo en formato .ico es muy complicado. Los PNG nos ayudan bastante.    &lt;br /&gt;2)La imagen que será el ícono debe estar dentro del paquete de fuentes, como si fuera una clase más. Si estuviera dentro de un paquete, sería mucho mejor.     &lt;br /&gt;     &lt;br /&gt;&lt;a href=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono1.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; src=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono1.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;3)En el código del JFrame que vamos a poner el ícono, sobreescribimos el método getIconImage() conteniendo el siguiente código: (notar cómo se está llamando a la imagen .png)     &lt;br /&gt;public Image getIconImage() {     &lt;br /&gt;Image retValue = Toolkit.getDefaultToolkit().     &lt;br /&gt;getImage(ClassLoader.getSystemResource(&quot;resources/icono.png&quot;));     &lt;br /&gt;return retValue;     &lt;br /&gt;}     &lt;br /&gt;4)En la vista de diseño del JFrame, lo seleccionamos y vamos sus propiedades, buscamos la propiedad &quot;iconImagen&quot; y hacemos clic en el botón de puntos suspensivos. Se mostrará una ventana de diálogo como esta:     &lt;br /&gt;&amp;nbsp;
&lt;a href=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono2.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;240&quot; src=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;De la lista desplegable, seleccionamos &quot;Valor de componente existente&quot;. Esto hará que cambie la ventana a la siguiente forma:     &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono3.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;274&quot; src=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono3.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Seleccionamos la opción &quot;Propiedad&quot; y hacemos clic en el botón de puntos suspendidos. Aparecerá una ventana de diálogo más pequeña, y seleccionamos la propiedad &quot;iconImage&quot; que aparece ahí.     &lt;br /&gt;&amp;nbsp;
&lt;a href=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono4.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; src=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono4.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;le damos Clic en Aceptar, y se verá así:     &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono5.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; src=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono5.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;y nuevamente clic en &quot;Aceptar&quot; para cerrar la ventana de selección de imagen.     &lt;br /&gt;Ahora, veremos que las propiedades del JFrame ya tiene un nuevo valor     &lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono6.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; src=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono6.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Ejecutamos la aplicación con el JFrame y veremos nuestro JFrame con un ícono diferente.     &lt;br /&gt;&lt;a href=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono7.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; src=&quot;http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/jframe-icono7.jpg&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/1206990441517677899/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/04/cambiar-icono-jframe.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/1206990441517677899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/1206990441517677899'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2012/04/cambiar-icono-jframe.html' title='cambiar icono jframe'/><author><name>Jonathan Palomino</name><uri>http://www.blogger.com/profile/07127141412930339469</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="http://i936.photobucket.com/albums/ad205/jonathan7_07/blog/th_jframe-icono1.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-3964738191207229899</id><published>2011-10-02T00:30:00.000-05:00</published><updated>2011-11-01T22:46:52.059-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="digito"/><category scheme="http://www.blogger.com/atom/ns#" term="documento"/><category scheme="http://www.blogger.com/atom/ns#" term="identificar"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="RUT"/><category scheme="http://www.blogger.com/atom/ns#" term="validacion"/><category scheme="http://www.blogger.com/atom/ns#" term="venta"/><title type='text'>Validador de RUT</title><content type='html'>Es una forma sencilla de obtener un rut completo a partir de los dígitos anteriores.&lt;br /&gt;
De facil uso ya que el método que obtiene el dígito de control es muy sencillo prácticamente de niños&lt;br /&gt;
&lt;br /&gt;
&lt;!-- adsense --&gt; 
&lt;script type=&#39;text/javascript&#39;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt;  &lt;pre class=&quot;brush:java&quot;&gt;package validador.rut;
/*
 * v.java
 *
 * Creado en 09/08/2011, 05:58:13 PM
 *
 * Aplicacion creada por jonathan-palomino.blogspot.com.
 *
 */

/**
 *
 * @author Jonathan palomino &lt;jhonelfenix@gmail.com&gt;
 */
class v {
static String RUT=&quot;12345678&quot;;
    public static void main(String args[]) {
        int M = 0, S = 1;
        int T = Integer.parseInt(RUT);
        for (; T != 0; T /= 10) {
            S = (S + T % 10 * (9 - M++ % 6)) % 11;
        }
        System.out.println(RUT+&quot;-&quot;+(char) (S != 0 ? S + 47 : 75));
    }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/3964738191207229899/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/10/validador-de-rut.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/3964738191207229899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/3964738191207229899'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/10/validador-de-rut.html' title='Validador de RUT'/><author><name>Unknown</name><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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-6719835891326431620</id><published>2011-07-28T18:01:00.001-05:00</published><updated>2011-07-28T18:36:04.281-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="escala"/><category scheme="http://www.blogger.com/atom/ns#" term="imagen"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="sun"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><category scheme="http://www.blogger.com/atom/ns#" term="zoom"/><title type='text'>Usar Zoom en imagenes</title><content type='html'>Alguna ves quisiste darle zoom a una imagen o quisiste agregar esa función a un proyecto tuyo pues ahora te traigo la solución.&lt;br /&gt;
Se trata de una clase o librería x decirlo asi que te dará esa habilidad.&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt;&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;package Zoom;

/**
 *
 * @author JONATHAN
 */
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import javax.swing.JPanel;

public class Zoom extends JPanel {

    private Image FOTO_ORIGINAL;
    private Image FOTO_tmp;
    private BufferedImage Imagen_en_memoria;
    private Graphics2D g2D;
    private boolean con_foto = false;   

    private int valEscalaX=0;
    private int valEscalaY=0;

    /* al crear el objeto se crea con una imagen pasada como parametro*/
    public Zoom(BufferedImage f){
        this.FOTO_ORIGINAL = f;
        this.FOTO_tmp = f;
        this.setSize(f.getWidth(),f.getHeight());
        this.setVisible(true);
        this.con_foto=true;
    }

    @Override
    protected void paintComponent(Graphics g) {
      Graphics2D g2 = (Graphics2D)g;
      if(this.con_foto){
        Imagen_en_memoria = new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB);
        g2D = Imagen_en_memoria.createGraphics();
        g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        //se aÃ±ade la foto
        g2D.drawImage(FOTO_tmp,0, 0, FOTO_tmp.getWidth(this), FOTO_tmp.getHeight(this), this);
        g2.drawImage(Imagen_en_memoria, 0, 0, this);
      }
    }

    public void Aumentar(int Valor_Zoom){
        //se calcula el incremento
        valEscalaX =  (int) (FOTO_tmp.getWidth(this) * escala(Valor_Zoom) );
        valEscalaY =  (int) (FOTO_tmp.getHeight(this) * escala(Valor_Zoom) );
        //se escala la imagen sumado el nuevo incremento
        this.FOTO_tmp = FOTO_tmp.getScaledInstance((int) (FOTO_tmp.getWidth(this) + valEscalaX), (int) (FOTO_tmp.getHeight(this) + valEscalaY), Image.SCALE_AREA_AVERAGING);
        resize();
    }

    public void Disminuir(int Valor_Zoom){
        valEscalaX =  (int) (FOTO_tmp.getWidth(this) * escala(Valor_Zoom) );
        valEscalaY =  (int) (FOTO_tmp.getHeight(this) * escala(Valor_Zoom) );
        this.FOTO_tmp = FOTO_tmp.getScaledInstance((int) (FOTO_tmp.getWidth(this) - valEscalaX), (int) (FOTO_tmp.getHeight(this) - valEscalaY), Image.SCALE_AREA_AVERAGING);
        resize();
     }

    private float escala(int v){
        return  v/100f;
    }

    public void Restaurar(){
        this.FOTO_tmp = this.FOTO_ORIGINAL;
        resize();
    }

    private void resize(){
        this.setSize(FOTO_tmp.getWidth(this),FOTO_tmp.getHeight(this));
    }
}
&lt;/pre&gt;Ahora los métodos para operar esta clase son los siguientes en este caso con este abrilos la imagen en un jpanel que estará dentro de un jscrollpane.&lt;br /&gt;
El motivo es para que la imagen al dimensionarse en el jpanel no dimensione tambien el jframe que se usara para visualizar el contenido&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-s3Rqi-tUwxs/TjHvKFm00jI/AAAAAAAAEY4/Sm3zdmdhwAU/s1600/zoom.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;238&quot; src=&quot;http://1.bp.blogspot.com/-s3Rqi-tUwxs/TjHvKFm00jI/AAAAAAAAEY4/Sm3zdmdhwAU/s320/zoom.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;private void Abrir_Imagen() {
        fileChooser = new JFileChooser();
        fileChooser.setFileFilter(filter);
        fileChooser.setCurrentDirectory(Directorio);
        int result = fileChooser.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            try {
                BufferedImage imagen = ImageIO.read(fileChooser.getSelectedFile());
                Cambiar(imagen.getWidth(), imagen.getHeight());
                zoom = new Zoom(imagen);
                this.Panel.removeAll();
                this.Panel.add(zoom);
                this.Panel.repaint();
                this.Directorio = fileChooser.getCurrentDirectory();
            } catch (IOException ex) {
                System.out.println(&quot;error: &quot; + ex);
            }
        }
    }
    private void Cambiar(int alto, int ancho) {
        Panel.setPreferredSize(new Dimension(alto, ancho));
        Panel.setSize(alto, ancho);
    }
&lt;/pre&gt;Ahora como dije zoom nos permitirá aumentar como disminuir entonces se necesitan estos métodos también.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;zoom.Aumentar(50);
zoom.Disminuir(50);
zoom.Restaurar();
&lt;/pre&gt;Donde 50 en ambos casos es el valor a aumentar o disminuir con respecto a su imagen y bueno restaurar es para regresar a las dimensiones anteriores u originales.</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/6719835891326431620/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/usar-zoom-en-imagenes.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/6719835891326431620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/6719835891326431620'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/usar-zoom-en-imagenes.html' title='Usar Zoom en imagenes'/><author><name>Unknown</name><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="http://1.bp.blogspot.com/-s3Rqi-tUwxs/TjHvKFm00jI/AAAAAAAAEY4/Sm3zdmdhwAU/s72-c/zoom.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-999490216194291446</id><published>2011-07-26T14:27:00.000-05:00</published><updated>2011-07-26T14:27:35.895-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2008"/><category scheme="http://www.blogger.com/atom/ns#" term="coneccion"/><category scheme="http://www.blogger.com/atom/ns#" term="conectar php y sql"/><category scheme="http://www.blogger.com/atom/ns#" term="ejemplo"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="mssql"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="sql 2008"/><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><title type='text'>Coneccion SQL SERVER Y PHP 5.3.x con Netbeans</title><content type='html'>&lt;script type=&#39;text/javascript&#39;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt;&lt;br /&gt;
Hola aun no creo esta entrada pero tengo un ejemplo de como conectar sql server 2008 con php5 fue realizado por mi autoria para un trabajo de la universidad con base de datos espero comentarios acerca de su creación.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/999490216194291446/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/coneccion-sql-server-y-php-53x-con.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/999490216194291446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/999490216194291446'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/coneccion-sql-server-y-php-53x-con.html' title='Coneccion SQL SERVER Y PHP 5.3.x con Netbeans'/><author><name>Unknown</name><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-707635783452779018.post-8598304119427558229</id><published>2011-07-26T01:31:00.001-05:00</published><updated>2011-07-26T14:16:09.181-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aplicativo"/><category scheme="http://www.blogger.com/atom/ns#" term="español"/><category scheme="http://www.blogger.com/atom/ns#" term="ingles"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="properties"/><category scheme="http://www.blogger.com/atom/ns#" term="propiedades"/><category scheme="http://www.blogger.com/atom/ns#" term="traduccion"/><category scheme="http://www.blogger.com/atom/ns#" term="uso"/><title type='text'>Aplicación multi-lenguaje uso de Java y Properties</title><content type='html'>El archivo Properties puede servirnos tambien para crear aplicaciones multilenguaje, por ejemplo guardar en cada archivo la estructura del idioma que utilizamos y en otros archivos el lenguaje al que deseamos traducir nuestra aplicacion, osea:&lt;br /&gt;
&lt;br /&gt;
Creamos los archivos .Properties para cada lenguaje.&lt;br /&gt;
Para el idioma español podemos tener:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&#39;text/javascript&#39;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; &lt;br /&gt;
//esto formatea el codigo java &lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;# Idioma español
#

#titulo aplicacion
titulo=Aplicación Multilenguaje

!Datos personales
titulo_datos=Datos Personales
nombre=Nombre:
Apellidos=Apellidos:
mail=Correo Electronico:
dir=Dirección:
fono=Telefono:

#salir
salir=Salir

! menu
archivo=Archivo
nuevo=Nuevo
abrir=Abrir...
guardar=Guardar como...
!Salir

herramientas=Herramientas
es=Español
en=Ingles

ayuda=Ayuda
enlinea=Ayuda en linea...
acerca=Acerca de...
&lt;/pre&gt;&lt;br /&gt;
Y para el ingles:&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;# Idioma Ingles
#
#

#titulo aplicacion
titulo=Multilingual Application

!Datos personales
titulo_datos=Personal Data
nombre=First Name:
Apellidos=Last Name:
mail=Your Email:
dir=Address:
fono=Phone:

#salir
salir=Exit

! menu
archivo=File
nuevo=New
abrir=Open...
guardar=Save as...
!Salir

herramientas=Tools
es=Spanish
en=English

ayuda=Help
enlinea=Online Help...
acerca=About..
&lt;/pre&gt;&lt;br /&gt;
Como puede verse, la cantidad de elementos en ambos archivos propeties, es la misma, asi tambien el KEY para cada parametro tambien es la misma, solo cambia el contenido de estos, uno en español y otro en ingles.&lt;br /&gt;
&lt;br /&gt;
Nos creamos una clase para cargar estos archivos:&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;import java.io.IOException;
import java.util.Properties;

public class NProperties extends Properties{

    public NProperties(String idioma){
        if(idioma.equals(&quot;ES&quot;)){//español
            getProperties(&quot;_ES.properties&quot;);
        }else if(idioma.equals(&quot;EN&quot;)){//Ingles
            getProperties(&quot;_EN.properties&quot;);
        }else{//sino por default idioma español
            getProperties(&quot;ES&quot;);
        }
    }

    /* se leen las propiedades */
     private void getProperties(String idioma) {
        try {                
            this.load( getClass().getResourceAsStream(idioma) );
        } catch (IOException ex) {            
        }
   }

}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/8598304119427558229/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/aplicacion-multilenguaje-con-java-y.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8598304119427558229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8598304119427558229'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/aplicacion-multilenguaje-con-java-y.html' title='Aplicación multi-lenguaje uso de Java y Properties'/><author><name>Unknown</name><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-707635783452779018.post-8463350309830776565</id><published>2011-07-26T01:21:00.002-05:00</published><updated>2011-07-26T14:10:53.768-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cheque"/><category scheme="http://www.blogger.com/atom/ns#" term="clase"/><category scheme="http://www.blogger.com/atom/ns#" term="convertir"/><category scheme="http://www.blogger.com/atom/ns#" term="factura"/><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="numero"/><category scheme="http://www.blogger.com/atom/ns#" term="número a texto"/><category scheme="http://www.blogger.com/atom/ns#" term="recibos"/><title type='text'>Convertir números a texto en java</title><content type='html'>&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
Cuando se realizan trabajos donde se necesita mostrar al cliente un determinado monto de dinero, tipo factura, recibo, cheque, etc, el cliente desea ver el monto en numeral asi como en literal.

Por ejemplo:

877866,50 = ochocientos setenta y siete mil ochocientos sesenta y seis 50/100 Nuevo Soles
Pues bien, la siguiente clase a la que llame Numero_Letra.java realiza justamente esa operacion, esta extracomentada y trate de hacerla lo mas entendible posible.

La logica que se utliza es la siguiente:

La clase recibe un numero ej. 123456789,50
valida este numero, si el numero no es valido devuelve NULL
Si el numero es valido segun sea este unidad, decena, centena, mil o millon,  va clasificando el numero y llama a sus procedimientos correspondientes, estas funciones, son utilizadas en cascada, osea:
nuestro numero de ejemplo es 123456789,50, entonces separa en 123456789 y 50, siendo 50 nuestra parte decimal.

El  numero entero, 123456789 es clasificado = es millon, entonces llama a la funcion getMillones, esta funcion a la vez divide el numero en miles y millones
123456789 = 123 456789 donde 123 corresponde a millones y 456789 a miles
entonces la misma funcion llama a las funciones getMiles, getCentenas, getUnidades, segun corresponda, al igual que la funcion getMiles, hace uso de getCentenas, getDecenas getUnidades, lo mismo getCentenas, hace uso de getDececas, getUnidades.

Espero se entienda.

&lt;/script&gt; //esto formatea el codigo java &lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;import java.util.regex.Pattern;
/**
 * @web http://jonathan-palomino.blogspot.com/
 */
public class Numero_Letra {

    private final String[] UNIDADES = {&quot;&quot;, &quot;un &quot;, &quot;dos &quot;, &quot;tres &quot;, &quot;cuatro &quot;, &quot;cinco &quot;, &quot;seis &quot;, &quot;siete &quot;, &quot;ocho &quot;, &quot;nueve &quot;};
    private final String[] DECENAS = {&quot;diez &quot;, &quot;once &quot;, &quot;doce &quot;, &quot;trece &quot;, &quot;catorce &quot;, &quot;quince &quot;, &quot;dieciseis &quot;,
        &quot;diecisiete &quot;, &quot;dieciocho &quot;, &quot;diecinueve&quot;, &quot;veinte &quot;, &quot;treinta &quot;, &quot;cuarenta &quot;,
        &quot;cincuenta &quot;, &quot;sesenta &quot;, &quot;setenta &quot;, &quot;ochenta &quot;, &quot;noventa &quot;};
    private final String[] CENTENAS = {&quot;&quot;, &quot;ciento &quot;, &quot;doscientos &quot;, &quot;trecientos &quot;, &quot;cuatrocientos &quot;, &quot;quinientos &quot;, &quot;seiscientos &quot;,
        &quot;setecientos &quot;, &quot;ochocientos &quot;, &quot;novecientos &quot;};

   public Numero_Letra() {
   }

    public String Convertir(String numero, boolean mayusculas) {
        String literal = &quot;&quot;;
        String parte_decimal;    
        //si el numero utiliza (.) en lugar de (,) -&gt; se reemplaza
        numero = numero.replace(&quot;.&quot;, &quot;,&quot;);
        //si el numero no tiene parte decimal, se le agrega ,00
        if(numero.indexOf(&quot;,&quot;)==-1){
            numero = numero + &quot;,00&quot;;
        }
        //se valida formato de entrada -&gt; 0,00 y 999 999 999,00
        if (Pattern.matches(&quot;\\d{1,9},\\d{1,2}&quot;, numero)) {
            //se divide el numero 0000000,00 -&gt; entero y decimal
            String Num[] = numero.split(&quot;,&quot;);            
            //de da formato al numero decimal
            parte_decimal = Num[1] + &quot;/100 Bolivianos.&quot;;
            //se convierte el numero a literal
            if (Integer.parseInt(Num[0]) == 0) {//si el valor es cero
                literal = &quot;cero &quot;;
            } else if (Integer.parseInt(Num[0]) &gt; 999999) {//si es millon
                literal = getMillones(Num[0]);
            } else if (Integer.parseInt(Num[0]) &gt; 999) {//si es miles
                literal = getMiles(Num[0]);
            } else if (Integer.parseInt(Num[0]) &gt; 99) {//si es centena
                literal = getCentenas(Num[0]);
            } else if (Integer.parseInt(Num[0]) &gt; 9) {//si es decena
                literal = getDecenas(Num[0]);
            } else {//sino unidades -&gt; 9
                literal = getUnidades(Num[0]);
            }
            //devuelve el resultado en mayusculas o minusculas
            if (mayusculas) {
                return (literal + parte_decimal).toUpperCase();
            } else {
                return (literal + parte_decimal);
            }
        } else {//error, no se puede convertir
            return literal = null;
        }
    }

    /* funciones para convertir los numeros a literales */

    private String getUnidades(String numero) {// 1 - 9
        //si tuviera algun 0 antes se lo quita -&gt; 09 = 9 o 009=9
        String num = numero.substring(numero.length() - 1);
        return UNIDADES[Integer.parseInt(num)];
    }

    private String getDecenas(String num) {// 99                        
        int n = Integer.parseInt(num);
        if (n &lt; 10) {//para casos como -&gt; 01 - 09
            return getUnidades(num);
        } else if (n &gt; 19) {//para 20...99
            String u = getUnidades(num);
            if (u.equals(&quot;&quot;)) { //para 20,30,40,50,60,70,80,90
                return DECENAS[Integer.parseInt(num.substring(0, 1)) + 8];
            } else {
                return DECENAS[Integer.parseInt(num.substring(0, 1)) + 8] + &quot;y &quot; + u;
            }
        } else {//numeros entre 11 y 19
            return DECENAS[n - 10];
        }
    }

    private String getCentenas(String num) {// 999 o 099
        if( Integer.parseInt(num)&gt;99 ){//es centena
            if (Integer.parseInt(num) == 100) {//caso especial
                return &quot; cien &quot;;
            } else {
                 return CENTENAS[Integer.parseInt(num.substring(0, 1))] + getDecenas(num.substring(1));
            } 
        }else{//por Ej. 099 
            //se quita el 0 antes de convertir a decenas
            return getDecenas(Integer.parseInt(num)+&quot;&quot;);            
        }        
    }

    private String getMiles(String numero) {// 999 999
        //obtiene las centenas
        String c = numero.substring(numero.length() - 3);
        //obtiene los miles
        String m = numero.substring(0, numero.length() - 3);
        String n=&quot;&quot;;
        //se comprueba que miles tenga valor entero
        if (Integer.parseInt(m) &gt; 0) {
            n = getCentenas(m);           
            return n + &quot;mil &quot; + getCentenas(c);
        } else {
            return &quot;&quot; + getCentenas(c);
        }

    }

    private String getMillones(String numero) { //000 000 000        
        //se obtiene los miles
        String miles = numero.substring(numero.length() - 6);
        //se obtiene los millones
        String millon = numero.substring(0, numero.length() - 6);
        String n = &quot;&quot;;
        if(millon.length()&gt;1){
            n = getCentenas(millon) + &quot;millones &quot;;
        }else{
            n = getUnidades(millon) + &quot;millon &quot;;
        }
        return n + getMiles(miles);        
    }
}
&lt;/pre&gt;&lt;br /&gt;
Esta clase, recibe  un numero de 0,00 a 999999999.00 en formato String, el separador decimal puede ser un punto (.) o una coma (,), ademas tiene un parametro booleano &quot;mayusculas&quot; el cual sea verdadero (true) o falso (false), retorna el resultado en mayusculas o minusculas, esta clase no acepta numeros negativos ni tampoco numero mayores o iguales a mil millones, aunque claro trate de escribir esta clase para que sea facilmente comprensible y asi pueda ser ampliado o modificado segun sus necesidades.&lt;br /&gt;
&lt;br /&gt;
La forma de llamara a esta clase es:&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;Numero_Letra NumLetra = new Numero_Letra();
String numero = &quot;20004.70&quot;;
System.out.println( numero  + &quot; literal = &quot;  + NumLetra.Convertir(numero,true));
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/8463350309830776565/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/convertir-numeros-letras-en-java-tipo.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8463350309830776565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8463350309830776565'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/convertir-numeros-letras-en-java-tipo.html' title='Convertir números a texto en java'/><author><name>Unknown</name><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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-8052816429130089253</id><published>2011-07-26T00:46:00.001-05:00</published><updated>2011-07-26T00:47:56.622-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="algoritmo"/><category scheme="http://www.blogger.com/atom/ns#" term="aplicacion"/><category scheme="http://www.blogger.com/atom/ns#" term="cesar"/><category scheme="http://www.blogger.com/atom/ns#" term="char"/><category scheme="http://www.blogger.com/atom/ns#" term="criptografia"/><category scheme="http://www.blogger.com/atom/ns#" term="intervalo"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="julio"/><title type='text'>Algoritmo Julio Cesar (Criptografia)</title><content type='html'>Este es un algoritmo sencillo consiste en alterar con un intervalo numérico menor a 10 la posición ascii tanto para encriptar o desencriptar.&lt;br /&gt;
&lt;br /&gt;
Por ejemplo a en ascii es 97 pero con un intervalo de 1 se imprimiría un ascii 98 que es b&lt;br /&gt;
&lt;script type=&#39;text/javascript&#39;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; //esto formatea el codigo java &lt;pre class=&quot;brush:java&quot;&gt;public class cesar {

private String tabla = &quot;abcdefghijklmnopqrstuvwxyzáéíóú 1234567890@.,;:-+*/$#¿?!¡=()[]{}&quot;;

    public cesar(){
    }

    public String Encriptar(String t, int key){
        String texto = LimpiarCadena(t);
        //aqui se almacena el resultado
        String res = &quot;&quot;;
        for(int i = 0; i &lt; texto.length();i++)
        {
            //busca la posicion del caracter en la variable tabla
            int pos = tabla.indexOf(texto.charAt(i));
            //realiza el reemplazo
            if ((pos + key) &lt; tabla.length()){
                res = res + tabla.charAt(pos+key);
            }
            else
            {
                res = res + tabla.charAt((pos+key) - tabla.length());
            }
        }
        return res;
    }

    public String Desencriptar(String t, int key){
        String texto = LimpiarCadena(t);
        String res = &quot;&quot;;
        for(int i = 0; i &lt; texto.length();i++)
        {
            int pos = tabla.indexOf(texto.charAt(i));
            if ((pos - key) &lt; 0){
                res = res + tabla.charAt((pos-key) + tabla.length());
            }
            else
            {
                res = res + tabla.charAt(pos-key);
            }
        }
        return res;
    }

    private String LimpiarCadena(String t){
        //transforma el texto a minusculas
        t = t.toLowerCase();
        //eliminamos todos los retornos de carro
        t = t.replaceAll(&quot;\n&quot;, &quot;&quot;);
        //eliminamos caracteres prohibidos
        for(int i = 0; i &lt; t.length();i++)
        {
            int pos = tabla.indexOf(t.charAt(i));
            if (pos == -1){
                t = t.replace(t.charAt(i), &#39; &#39;);
            }
        }
        return t;
    }
}
&lt;/pre&gt;

Ahora la forma de instanciarlo es asi:
&lt;pre class=&quot;brush:java&quot;&gt;cesar cesar = new cesar();
String cadena_final = cesar.Encriptar(texto_inicial, intervalo);
String cadena_inicial= cesar.Desencriptar(cadena_final, intervalo);
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/8052816429130089253/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/algoritmo-julio-cesar-criptografia.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8052816429130089253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8052816429130089253'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/algoritmo-julio-cesar-criptografia.html' title='Algoritmo Julio Cesar (Criptografia)'/><author><name>Unknown</name><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-707635783452779018.post-1648523792851677125</id><published>2011-07-26T00:31:00.000-05:00</published><updated>2011-07-26T00:31:14.524-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Action"/><category scheme="http://www.blogger.com/atom/ns#" term="ActionListener"/><category scheme="http://www.blogger.com/atom/ns#" term="aplicacion"/><category scheme="http://www.blogger.com/atom/ns#" term="código"/><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="minimizar"/><category scheme="http://www.blogger.com/atom/ns#" term="PopupMenu"/><category scheme="http://www.blogger.com/atom/ns#" term="reloj"/><category scheme="http://www.blogger.com/atom/ns#" term="sun"/><category scheme="http://www.blogger.com/atom/ns#" term="SystemTray"/><category scheme="http://www.blogger.com/atom/ns#" term="Trayicon"/><category scheme="http://www.blogger.com/atom/ns#" term="utilizar"/><title type='text'>Uso de taryicon o icono de reloj</title><content type='html'>Hola alguna ves quisieron una aplicación que se minimizara a la barra de reloj osea un segundo plano con Trayicon logramos esto sencillamente agregamos a este modulo lo que necesitamos y listo ademas haremos uso de un PopupMenu para visualizar opciones de dicho programa.&lt;br /&gt;
&lt;br /&gt;
Adjunto el código para que lo usen.&lt;br /&gt;
&lt;script type=&#39;text/javascript&#39;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt; //esto formatea el codigo java &lt;pre class=&quot;brush:java&quot;&gt;import java.awt.*;
import java.awt.event.*;
import javax.swing.ImageIcon;
public class EjemploSystemTray {
    public EjemploSystemTray() {
        //se declara el objeto tipo icono
        final TrayIcon iconoSystemTray;
        //se verifica que el SystemTray sea soportado
        if (SystemTray.isSupported()) {
            //se obtiene una instancia estática de la clase SystemTray
            SystemTray tray = SystemTray.getSystemTray();
            //esta es la imagen de icono que esta en la misma carpeta que las clases
            ImageIcon icono = new ImageIcon(EjemploSystemTray.class.getResource(&quot;CARITA.PNG&quot;));
            //este listener nos permite capturar cualquier tipo de evento
            //que se haga con el mouse sobre el icono
            MouseListener mouseListener = new MouseListener() {
                public void mouseClicked(MouseEvent e) {
                    System.out.println(&quot;Icono del System Tray - Mouse clicked!&quot;);
                }
                public void mouseEntered(MouseEvent e) {
                    System.out.println(&quot;Icono del System Tray - Mouse entered!&quot;);
                }
                public void mouseExited(MouseEvent e) {
                    System.out.println(&quot;Icono del System Tray - Mouse exited!&quot;);
                }
                public void mousePressed(MouseEvent e) {
                    System.out.println(&quot;Icono del System Tray - Mouse pressed!&quot;);
                }
                public void mouseReleased(MouseEvent e) {
                    System.out.println(&quot;Icono del System Tray - Mouse released!&quot;);
                }
            };
            //este listener se asociara con un item del menu contextual
            //que aparece al hacer click derecho sobre el icono
            ActionListener escuchadorSalir = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    System.out.println(&quot;Saliendo...&quot;);
                    System.exit(0);
                }
            };
            //menu que aparece al hacer click derecho
            PopupMenu popup = new PopupMenu();
            MenuItem item = new MenuItem(&quot;Exit&quot;);
            item.addActionListener(escuchadorSalir);
            popup.add(item);
            //iniciamos el objeto TrayIcon
            iconoSystemTray = new TrayIcon(icono.getImage(), &quot;Prueba System Tray&quot;, popup);
            //este tipo de listener captura el doble click sobre el icono
            ActionListener accionMostrarMensaje = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    iconoSystemTray.displayMessage(&quot;Titulo mensaje&quot;,
                            &quot;Este es el contenido del mensaje!&quot;,
                            TrayIcon.MessageType.INFO);
                }
            };

            iconoSystemTray.setImageAutoSize(true);
            iconoSystemTray.addActionListener(accionMostrarMensaje);
            iconoSystemTray.addMouseListener(mouseListener);

            //se debe capturar una excepción en caso que falle la adicion de un icono
            try {
                tray.add(iconoSystemTray);
            } catch (AWTException e) {
                System.err.println(&quot;No es posible agregar el icono al System Tray&quot;);
            }
        }
        else
            System.err.println(&quot;Tu sistema no soporta el System Tray :(&quot;);
    }
    public static void main(String[] args) {
        new EjemploSystemTray();
    }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/1648523792851677125/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/uso-de-taryicon-o-icono-de-reloj.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/1648523792851677125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/1648523792851677125'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/uso-de-taryicon-o-icono-de-reloj.html' title='Uso de taryicon o icono de reloj'/><author><name>Unknown</name><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-707635783452779018.post-7146693371058117339</id><published>2011-07-12T01:51:00.001-05:00</published><updated>2011-07-25T22:25:49.413-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="amenidades"/><category scheme="http://www.blogger.com/atom/ns#" term="aplicación"/><category scheme="http://www.blogger.com/atom/ns#" term="buscado"/><category scheme="http://www.blogger.com/atom/ns#" term="consola"/><category scheme="http://www.blogger.com/atom/ns#" term="deporte"/><category scheme="http://www.blogger.com/atom/ns#" term="entretenimiento"/><category scheme="http://www.blogger.com/atom/ns#" term="jar"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="juego"/><category scheme="http://www.blogger.com/atom/ns#" term="juegos"/><category scheme="http://www.blogger.com/atom/ns#" term="otros"/><category scheme="http://www.blogger.com/atom/ns#" term="sodoku"/><title type='text'>SUDOKU</title><content type='html'>Bueno hace tiempo vi por ahí que preguntaban como hacer un SUDOKU bueno les traigo las respuesta y en código java como tiene que ser es una aplicación de consola que pronto pasara a frame pero por lo pronto disfrútenla.&lt;br /&gt;
Son libres de hacer lo que deseen con el codigo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&#39;text/javascript&#39;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt;&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;//codigo java
/**
 *
 * @author JONATHAN
 */
import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.*;

public class SUDOKU {
 
 //PROPIEDADES.
 public static int nivel = 1;
 
 
 //METODO PARA CARGAR JUEGO.
 public static int[][] cargar_juego( int nivel){
  
  int[][] matriz = new int[9][9];
  
  switch (nivel){
  
  case 2:
  
  matriz[0][0] = 7;matriz[0][4] = 5;matriz[0][6] = 4;matriz[1][0] = 4;
  matriz[1][3] = 1;matriz[1][4] = 9;matriz[1][6] = 6;matriz[1][7] = 2;
  matriz[1][8] = 7;matriz[2][2] = 6;matriz[2][8] = 9;matriz[3][0] = 9;
  matriz[3][2] = 3;matriz[3][6] = 8;matriz[4][3] = 4;matriz[4][5] = 3;
  matriz[5][2] = 8;matriz[5][6] = 5;matriz[5][8] = 2;matriz[6][0] = 5;
  matriz[6][6] = 2;matriz[7][0] = 2;matriz[7][1] = 9;matriz[7][2] = 1;
  matriz[7][4] = 4;matriz[7][5] = 7;matriz[7][8] = 8;matriz[8][2] = 7;
  matriz[8][4] = 1;matriz[8][8] = 5;
  
  break;
  
  
  case 1:
  default:
  
  matriz[0][2] = 9;matriz[0][5] = 8;matriz[0][6] = 5; matriz[0][7] = 4;
  matriz[1][8] = 7;matriz[2][1] = 5;matriz[2][2] = 4; matriz[2][4] = 9;
  matriz[2][6] = 1;matriz[3][5] = 6;matriz[3][6] = 3; matriz[3][7] = 2;
  matriz[4][1] = 8;matriz[4][2] = 2;matriz[4][6] = 4; matriz[4][7] = 1;
  matriz[5][1] = 3;matriz[5][2] = 5;matriz[5][3] = 2; matriz[6][2] = 7;
  matriz[6][4] = 3;matriz[6][6] = 2;matriz[6][7] = 5; matriz[7][0] = 9;
  matriz[8][1] = 4;matriz[8][2] = 3;matriz[8][3] = 8; matriz[8][7] = 9;
  
  break;
  
  }
  
  return matriz;
 }
 
 //METODO PARA NO SOBREESCRIBIR VALORES EN EL JUEGO.
 public static boolean es_origen( int fila, int columna, int[][] matriz ){
  
  boolean resultado = false;
  if ( matriz[fila][columna] != 0)
   resultado = true;
  
  return resultado;
  
 }
 
 //METODO QUE DETECTA SI EL JUEGO FUE TERMINADO.
 public static boolean terminado( int[][] matriz ){
  
  boolean resultado = true;
  
  for ( int f = 0; f &lt; matriz.length; f ++)
   for ( int c = 0; c &lt; matriz[0].length; c ++)
    if ( matriz[f][c] == 0 )
     resultado = false;
  
   
  return resultado;

 }
 
 //METODO QUE IMPRIME UN MENSAJE CON BORDE.
 public static void mensaje ( String mensaje ){
  
  //CABECERA.
  System.out.print(&quot;Ã‰&quot;);
  for(int i = 0; i &lt; (mensaje.length() + 20); i ++ )
   System.out.print (&quot;Ã&quot;);
  System.out.print (&quot;Â»\n&quot;);

  //CUERPO.
  System.out.print(&quot;Âº          &quot;);
  System.out.print( mensaje );
  System.out.print(&quot;          Âº\n&quot;);
 
  //PIE
  System.out.print(&quot;Ãˆ&quot;);
  for(int i = 0; i &lt; (mensaje.length() + 20); i ++ )
   System.out.print (&quot;Ã&quot;);
   
  System.out.print (&quot;Â¼\n\n&quot;);
   
  
 }
 
 //METODO QUE IMPRIME EL VECTOR.
 public static void imprime_vector ( int[][] matriz ){
  
  
  System.out.println( &quot; Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â²Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â²Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â° &quot; );
  
  for ( int f = 0; f &lt; matriz.length; f ++ ){
  
   System.out.print(&quot; Â° &quot;);
   
   for ( int c = 0; c &lt; matriz.length; c++){
    
    if ( matriz[f][c] != 0 ) 
     System.out.print ( matriz[f][c] );
    else 
     System.out.print (&quot; &quot;);
    
    if ( es_origen( f, c, cargar_juego( nivel ) ) )
     System.out.print (&quot; &quot;);
    else
     System.out.print (&quot; &quot;);
    
    if ( c == 2 || c == 5) 
     System.out.print (&quot;Â² &quot;);
    else
     System.out.print (&quot;Â° &quot;) ;
     
   }
   System.out.println();
   if ( f != 2 &amp;&amp; f != 5)
    System.out.print( &quot; Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â²Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â²Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â°Â° &quot; );
   else
    System.out.print( &quot; Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â²Â² &quot; );
   System.out.println();
  }
 }

 //METODO PARA COMPROBAR FILAS.
 public static boolean existe_fila( int numero, int fila, int[][] matriz ){
  
  boolean resultado = false;
  
  for ( int i = 0; i &lt; matriz.length; i ++ )
   if ( matriz[(fila-1)][i] == numero ){
     resultado = true;
     break;
   }
   
  //COMPROBAMOS SI ES 0.
  if ( numero == 0 ) resultado = false;
  
  return resultado;
  
 }
 
 //METODO PARA COMPROBAR COLUMNAS.
 public static boolean existe_columna( int numero, int columna, int[][] matriz ){
  
  boolean resultado = false;
  
  for ( int i = 0; i &lt; matriz.length; i ++ )
   if ( matriz[i][(columna-1)] == numero ){
     resultado = true;
     break;
   }
   
  //COMPROBAMOS SI ES 0.
  if ( numero == 0 ) resultado = false;
  
  return resultado;
  
 }
 
 // METODO PARA COMPROBAR LOS INDICES.
 public static boolean comprobar_indice ( int indice ){
  
  if ( indice &gt; 0 &amp;&amp; indice &lt; 10)
   return true;
  else
   return false;
  
 }
 
 // METODO PARA COMPROBAR LOS VALORES.
 public static boolean comprobar_valor ( int valor ){
  
  if ( valor &gt;= 0 &amp;&amp; valor &lt; 10)
   return true;
  else
   return false;
  
 }
 
 //METODO PARA COMPROBAR LAS CAJAS.
 public static boolean existe_caja ( int valor, int fila, int columna, int[][] matriz ){
  
  //VARIABLES.
  int minimo_fila;
  int maximo_fila;
  int minimo_columna;
  int maximo_columna;
  boolean resultado = false;
 
  //DETERMINAMOS LAS FILAS DE LA CAJA.
  if ( fila &gt; 0 &amp;&amp; fila &lt; 4){
   minimo_fila = 0;
   maximo_fila = 2;
  }else if ( fila &gt; 3 &amp;&amp; fila &lt; 7 ){
   minimo_fila = 3;
   maximo_fila = 5;
  }else{
   minimo_fila = 6;
   maximo_fila = 8;
  }
    
  //DETERMINAMOS LAS COLUMNAS DE LA CAJA.
  if ( columna &gt; 0 &amp;&amp; columna &lt; 4){
   minimo_columna = 0;
   maximo_columna = 2;
  }else if ( columna &gt; 3 &amp;&amp; columna &lt; 7 ){
   minimo_columna = 3;
   maximo_columna = 5;
  }else{
   minimo_columna = 6;
   maximo_columna = 8;
  }
  
  //RECORREMOS EL RANGO DE LA CAJA, Y BUSCAMOS EL VALOR.
  for ( int f = minimo_fila; f &lt;= maximo_fila; f++ )
   for ( int c = minimo_columna; c &lt;= maximo_columna; c++)
    if ( matriz[f][c] == valor ){
     resultado = true;
     break; 
     
    }
   
   
  //COMPROBAMOS SI ES 0.
  if ( valor == 0 ) resultado = false;
  
  //REGRESAMOS EL VALOR BOOLEANO.
  return resultado;
   
 
  
 }
 
 //METODO PRINCIPAL
 public static void main ( String[] args ) throws Exception
 {
  
  //VARIABLES.
  BufferedReader teclado = new BufferedReader( new InputStreamReader ( System.in ) );
  int[][] sudoku = new int[9][9];
  int fila = 0;
  int columna = 0;
  int valor = 0;
  
  //CARGAMOS EL JUEGO.
  sudoku = cargar_juego( nivel );
   
  while ( true ){
  
  //IMPRIMIMOS EL VECTOR.
  imprime_vector ( sudoku );
  
  //PEDIMOS LOS DATOS.
  System.out.println( &quot;Inserte las coordenadas (fila/columna): &quot; );
  
  //FILA.
  System.out.print( &quot;[fila]: &quot; );
  fila = Integer.parseInt( teclado.readLine() );
  
  //COLUMNA.
  System.out.print( &quot;[columna]: &quot; );
  columna = Integer.parseInt( teclado.readLine() );
  
  //VALOR.
  System.out.print( &quot;[valor]: &quot; );
  valor = Integer.parseInt( teclado.readLine() );
  
  //COMPROBAMOS LA FILA ESTA EN RANGO.
  if ( !comprobar_indice(fila) )
   mensaje (&quot;El valor de la fila no es correcto..&quot;);
  
  //COMPROBAMOS LA COLUMNA ESTA EN RANGO.
  else if ( !comprobar_indice(columna) )
   mensaje ( &quot;El valor de la columna no es correcto.&quot;);
   
  //COMPROBAMOS QUE EL VALOR ESTA EN RANGO.
  else if ( !comprobar_valor(valor) )
   mensaje ( &quot;El valor introducido no es valido..&quot;);
   
  //COMPROBAMOS QUE USE CASILLAS DISPONIBLES.
  else if ( es_origen( (fila - 1), (columna - 1), cargar_juego( nivel ) ) )
   mensaje ( &quot;Ese valor es predeterminado del juego...&quot;);
   
  //COMPRUEBA QUE NO SE REPITA EL VALOR EN LA FILA.
  else if ( existe_fila( valor, fila, sudoku ) )
   mensaje (&quot;[X] El valor &quot; + valor + &quot; ya ha sido usado en la fila..&quot;);
   
  //COMPRUEBA QUE NO SE REPITA EL VALOR EN LA COLUMNA..
  else if ( existe_columna( valor, columna, sudoku ) )
   mensaje ( &quot;[X] El valor &quot; + valor + &quot; ya ha sido usado en la columna..&quot;);
   
  //COMPRUEBA QUE EL VALOR NO ESTÃ‰ EN LA CAJA.
  else if ( existe_caja( valor, fila, columna, sudoku ) )
   mensaje ( &quot;[X] El valor ya existe en la caja..&quot;);
   
  //INTRODUCIMOS EL VALOR A LA MATRIZ.
  else {
   sudoku[(fila - 1)][(columna - 1)] = valor;
   mensaje( &quot;[&quot; + fila + &quot;,&quot; + columna + &quot;]=&quot; + valor + &quot; Correcto.&quot;);
  }
  
  
  //COMPRUEBA SI SE TERMINÃ“ EL JUEGO.
  if ( terminado( sudoku ) ){
   mensaje( &quot;FELICIDADES!!!! HAS TERMINADO EL JUEGO!!&quot;);
   imprime_vector( sudoku );
   System.out.println ( &quot;Presiona una tecla para continuar en el siguiente nivel..&quot;);
   teclado.readLine();
   
   //AUMENTAMOS EL NIVEL DEL JUEGO.
   nivel ++;
   sudoku = cargar_juego( nivel );
   mensaje( &quot;SUDOKU NIVEL &quot; + nivel );
  }
 
 
  }
 
 } 

 
}


&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/7146693371058117339/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/sodoku.html#comment-form' title='6 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/7146693371058117339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/7146693371058117339'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/07/sodoku.html' title='SUDOKU'/><author><name>Unknown</name><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>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-2336300621753457952</id><published>2011-06-10T19:38:00.001-05:00</published><updated>2011-06-10T19:41:34.692-05:00</updated><title type='text'>Resultados de la Busqueda</title><content type='html'>&lt;div id=&quot;cse-search-results&quot;&gt;&lt;/div&gt;&lt;script type=&quot;text/javascript&quot;&gt;
  var googleSearchIframeName = &quot;cse-search-results&quot;;
  var googleSearchFormName = &quot;cse-search-box&quot;;
  var googleSearchFrameWidth = 800;
  var googleSearchDomain = &quot;www.google.com.pe&quot;;
  var googleSearchPath = &quot;/cse&quot;;
&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/afsonline/show_afs_search.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;div siber__q92dpb7seovvtbh5__vptr=&quot;725cb20&quot; sourceindex=&quot;4&quot;&gt;Resultados de la Busqueda&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/2336300621753457952/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/06/resultados-de-la-busqueda.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/2336300621753457952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/2336300621753457952'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/06/resultados-de-la-busqueda.html' title='Resultados de la Busqueda'/><author><name>Unknown</name><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-707635783452779018.post-5420181929869886793</id><published>2011-06-10T19:04:00.000-05:00</published><updated>2011-06-10T19:04:12.525-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arreglos"/><category scheme="http://www.blogger.com/atom/ns#" term="ayuda"/><category scheme="http://www.blogger.com/atom/ns#" term="estadisticas"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="ordeniamiento"/><category scheme="http://www.blogger.com/atom/ns#" term="primos"/><category scheme="http://www.blogger.com/atom/ns#" term="principal"/><category scheme="http://www.blogger.com/atom/ns#" term="problema"/><category scheme="http://www.blogger.com/atom/ns#" term="solucion"/><title type='text'>Hola y lo nuevo</title><content type='html'>&lt;div siber__q92dpb7seovvtbh5__vptr=&quot;7cbe280&quot; sourceindex=&quot;4&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hola a todos mis lectores como podrán haber visto el diseño de la pagina ha cambiado y creo que para bien ya que tendrán el contenido mas accesible y mas ordenado, pero no kiero acabar ahí eh agregado ciertos elementos que tal ves les sera molesto como la publicidad espero me comprendan necesitaba rentabilizar en algo esta pagina pero no obligo a nadie ver la publicidad si les parece bien apoyarme sino ignoren ese contenido.&lt;/span&gt;&lt;/div&gt;&lt;div siber__q92dpb7seovvtbh5__vptr=&quot;8944090&quot; sourceindex=&quot;5&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br siber__q92dpb7seovvtbh5__vptr=&quot;7255c80&quot; sourceindex=&quot;6&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div siber__q92dpb7seovvtbh5__vptr=&quot;893b1e0&quot; sourceindex=&quot;7&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Este cambio trae algunas mejoras eh revisado las estadísticas y por lo visto lo mas buscado es el tema de arreglos, números primos,ordenamiento, búsqueda,excepciones,ect.&lt;/span&gt;&lt;/div&gt;&lt;div siber__q92dpb7seovvtbh5__vptr=&quot;8932f50&quot; sourceindex=&quot;8&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Por lo cual si necesitan que agregue algún contenido que no existe actualmente en mi blog pero les es de interés posteenlo sin ningún inconveniente eso me ayudara a mejorar.&lt;/span&gt;&lt;/div&gt;&lt;div siber__q92dpb7seovvtbh5__vptr=&quot;8d3d9f0&quot; sourceindex=&quot;9&quot;&gt;&lt;br siber__q92dpb7seovvtbh5__vptr=&quot;7c81ae0&quot; sourceindex=&quot;10&quot; /&gt;&lt;/div&gt;&lt;div siber__q92dpb7seovvtbh5__vptr=&quot;7cb6820&quot; sourceindex=&quot;11&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Gracias.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/5420181929869886793/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/06/hola-y-lo-nuevo.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/5420181929869886793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/5420181929869886793'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/06/hola-y-lo-nuevo.html' title='Hola y lo nuevo'/><author><name>Unknown</name><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-707635783452779018.post-8392515166948004510</id><published>2011-06-10T18:22:00.001-05:00</published><updated>2011-06-10T18:25:54.859-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2d"/><category scheme="http://www.blogger.com/atom/ns#" term="clase"/><category scheme="http://www.blogger.com/atom/ns#" term="imagen"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="salida"/><category scheme="http://www.blogger.com/atom/ns#" term="trabajo"/><title type='text'>imágenes en java</title><content type='html'>Los métodos getWidth o getHeight de Image me devuenven -1&lt;br /&gt;
&lt;br /&gt;
El Problema: Si te devuelve -1, significa que no pudo obtener el tamaño, es porque no se cargo la imagen aún&lt;br /&gt;
&lt;br /&gt;
Estas cargando las imágenes de la siguiente manera:&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&#39;text/javascript&#39;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt;&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;Image imgen = Toolkit.getDefaultToolkit().getImage( getClass().getResource(&quot;objeto.jpeg&quot;) );
int ancho = imgen.getWidth(null);
int alto = imgen.getHeight(null);
System.out.println(&quot;ANCHO:&quot;+ancho+&quot; ALTO:&quot;+alto);
&lt;/pre&gt;&lt;br /&gt;
La salida es algo como:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;ANCHO:-1 ALTO:-1
&lt;/pre&gt;&lt;br /&gt;
Esto es porque Toolkit.getDefaultToolkit().getImage() retorna primero y luego empieza a cargar los pixels.&lt;br /&gt;
&lt;br /&gt;
Solución:&lt;br /&gt;
Utilizar la Clase Image Icon para cargar ya que este método retorna cuando se termino de cargar la imagen.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;Image imgen = new ImageIcon(getClass().getResource(&quot;imagen.gif&quot;)).getImage();
int ancho = imgen.getWidth(null);
int alto = imgen.getHeight(null);
System.out.println(&quot;ANCHO:&quot;+ancho+&quot; ALTO:&quot;+alto);
&lt;/pre&gt;&lt;br /&gt;
La salida es algo como:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;ANCHO:50 ALTO:50
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/8392515166948004510/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/06/imagenes-en-java.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8392515166948004510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8392515166948004510'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/06/imagenes-en-java.html' title='imágenes en java'/><author><name>Unknown</name><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-707635783452779018.post-697573280656085732</id><published>2011-05-04T01:15:00.000-05:00</published><updated>2011-05-04T01:15:19.744-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="actualizacion"/><category scheme="http://www.blogger.com/atom/ns#" term="codigo"/><category scheme="http://www.blogger.com/atom/ns#" term="coneccion"/><category scheme="http://www.blogger.com/atom/ns#" term="driver"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jdbc"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="sql 2008"/><title type='text'>CONECCION JAVA CON SQL SERVER 2008</title><content type='html'>Hola seguro ya revisaron como conectar java con sql 2005 de mi blog &lt;a href=&quot;http://jonathan-palomino.blogspot.com/2010/08/coneccion-java-con-sql-server-2005.html&quot;&gt;click aqui&lt;/a&gt; si no es asi, los pasos son similares no hay mucha varianza salvo en ciertas opciones que detallare.&lt;br /&gt;
Necesitaremos para esto&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;el driver jdbc 3.0&lt;/li&gt;
&lt;li&gt;Sql server 2008 (yo use la version express como practica ademas es gratiuta y orientada a educacion)&lt;/li&gt;
&lt;li&gt;Obviamente el ide java netbeans o otro ide &lt;/li&gt;
&lt;/ul&gt;Les dejo entonces el link para el driver jdbc3.0 &lt;a href=&quot;http://www.microsoft.com/downloads/es-es/details.aspx?FamilyID=a737000d-68d0-4531-b65d-da0f2a735707&quot;&gt;http://www.microsoft.com/downloads/es-es/details.aspx?FamilyID=a737000d-68d0-4531-b65d-da0f2a735707&lt;/a&gt;&lt;br /&gt;
Obviamente descargen el exe. &lt;br /&gt;
&lt;br /&gt;
Luego descargenlo en algun lugar para el ejemplo lo baje a mi escritorio.&lt;br /&gt;
PEro basta de palabras vamos con las imagenes....&lt;br /&gt;
PASO1: &lt;br /&gt;
&lt;br /&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;http://1.bp.blogspot.com/-rPeYHBKwBEE/TcDr3yq9PzI/AAAAAAAAAHI/Xk-svaYIiaM/s1600/1.png&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;http://1.bp.blogspot.com/-rPeYHBKwBEE/TcDr3yq9PzI/AAAAAAAAAHI/Xk-svaYIiaM/s320/1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;PASO2:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-nU3JYdxwfPY/TcDsGOuOEII/AAAAAAAAAHM/xNMdgLTIR5I/s1600/2.png&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;http://4.bp.blogspot.com/-nU3JYdxwfPY/TcDsGOuOEII/AAAAAAAAAHM/xNMdgLTIR5I/s320/2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;PASO3:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-J1LiTegzn9M/TcDsNkjQUBI/AAAAAAAAAHQ/CE0-Zt0c8ZI/s1600/3.png&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;http://1.bp.blogspot.com/-J1LiTegzn9M/TcDsNkjQUBI/AAAAAAAAAHQ/CE0-Zt0c8ZI/s320/3.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;PASO4:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-mNYx2WN2k-Q/TcDsaM_nT1I/AAAAAAAAAHU/jCnVvc_IJYo/s1600/4.png&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;http://3.bp.blogspot.com/-mNYx2WN2k-Q/TcDsaM_nT1I/AAAAAAAAAHU/jCnVvc_IJYo/s320/4.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;PASO 5 Y EL MAS IMPORTANTE&lt;/b&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;http://1.bp.blogspot.com/--DnPsFsZ7pU/TcDsiYEVfOI/AAAAAAAAAHY/rBXAvPyB-OY/s1600/5.png&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;http://1.bp.blogspot.com/--DnPsFsZ7pU/TcDsiYEVfOI/AAAAAAAAAHY/rBXAvPyB-OY/s320/5.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;PASO 6:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-aEz1k1trJHI/TcDslGLk5HI/AAAAAAAAAHc/QLfN4Zu-Sng/s1600/6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;282&quot; src=&quot;http://2.bp.blogspot.com/-aEz1k1trJHI/TcDslGLk5HI/AAAAAAAAAHc/QLfN4Zu-Sng/s320/6.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;PASO 7:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-wNxvC-NYQr0/TcDsn_ryxnI/AAAAAAAAAHg/TRZQdN4cHhk/s1600/7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;282&quot; src=&quot;http://4.bp.blogspot.com/-wNxvC-NYQr0/TcDsn_ryxnI/AAAAAAAAAHg/TRZQdN4cHhk/s320/7.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Ahora que ya tenemos la coneccion desde el netbeans notad que me entrego la ruta url JDBC con esa podras realizar la coneccion desde codigo.&lt;br /&gt;
&lt;br /&gt;
Ahora el codigo java lo pueden consegir de mi anterior publicacion(ver link arriba) o si teneis alguna a modificar simplemente apliquen los cambios.</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/697573280656085732/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/05/coneccion-java-con-sql-server-2008.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/697573280656085732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/697573280656085732'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/05/coneccion-java-con-sql-server-2008.html' title='CONECCION JAVA CON SQL SERVER 2008'/><author><name>Unknown</name><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="http://1.bp.blogspot.com/-rPeYHBKwBEE/TcDr3yq9PzI/AAAAAAAAAHI/Xk-svaYIiaM/s72-c/1.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-7445098146252868689</id><published>2011-04-12T22:12:00.000-05:00</published><updated>2011-04-12T22:12:31.195-05:00</updated><title type='text'>Hola liberando mi codigo reproductor mp3 java</title><content type='html'>Hola hace tiempo presente un reproductor mp3 en java &lt;a href=&quot;http://jonathan-palomino.blogspot.com/2010/10/reproductor-de-sonido-java.html&quot;&gt;click aqui&lt;/a&gt; que implementa una libreria necesaria para leer y descodificar los ficheros mp3 y reproducirlos en tal la interfaz es algo amigable pero con el trabajo y el estudio casi no me da tiempo para buscarle mejoras por lo cual libero mi codigo con licencia GLP v3 en googlecode.&lt;br /&gt;
Se que el proyecto da para mas y que mas de alguno esta deseoso de saber como lo realize y poder estudiar el codigo y es mas espero que me ayuden a corregir los errores que tenga,añadir funciones extra,retirar codigo redundante.&lt;br /&gt;
aqui la direccion lo eh subido completo es decir solo lo tendran que bajar e importar a un proyecto java &lt;a href=&quot;http://code.google.com/p/reproductor-mp3-java/&quot;&gt;http://code.google.com/p/reproductor-mp3-java/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
y si eres usuario consola-linux lo bajas asi&lt;br /&gt;
&lt;tt id=&quot;checkoutcmd&quot;&gt;svn checkout &lt;strong&gt;&lt;em&gt;http&lt;/em&gt;&lt;/strong&gt;://reproductor-mp3-java.googlecode.com/svn/trunk/ reproductor-mp3-java-read-only&lt;/tt&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/7445098146252868689/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/04/hola-liberando-mi-codigo-reproductor.html#comment-form' title='6 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/7445098146252868689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/7445098146252868689'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/04/hola-liberando-mi-codigo-reproductor.html' title='Hola liberando mi codigo reproductor mp3 java'/><author><name>Unknown</name><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>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-707635783452779018.post-8824039490046798532</id><published>2011-04-03T20:18:00.010-05:00</published><updated>2011-04-03T22:33:07.544-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arraylist"/><category scheme="http://www.blogger.com/atom/ns#" term="elemento"/><category scheme="http://www.blogger.com/atom/ns#" term="jar"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="menor"/><category scheme="http://www.blogger.com/atom/ns#" term="nueva"/><category scheme="http://www.blogger.com/atom/ns#" term="nuevo"/><category scheme="http://www.blogger.com/atom/ns#" term="objetos"/><category scheme="http://www.blogger.com/atom/ns#" term="orden"/><category scheme="http://www.blogger.com/atom/ns#" term="ordenamiento"/><category scheme="http://www.blogger.com/atom/ns#" term="tecnica"/><title type='text'>Metodo de ordenamiento propio</title><content type='html'>&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Hola como algunos de uds saben existen multiples metodos de ordenar elementos ya sea de un arreglo o de otro tipo de objeto.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Presento mi propio metodo de ordenamiento que me vino a la mente en un chispaso hoy.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;por ejemplo si tenemos esto:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ingreso = 5,7,15,0,2,1&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;de salida tendriamos esto&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;salida = 0,1,2,5,7,15&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Para ello existe la burbuja,el de ciclos y muchos otros mas pero como me gusta generar contenido propio muestro el mio.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Consta de 2 clases para no marearlos con tanto codigo.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Clase Main.java&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
&lt;/script&gt;&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;import java.util.Random;
/**
&amp;nbsp;*
&amp;nbsp;* @author JONATHAN
&amp;nbsp;*/
public class Main {
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO code application logic here
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int[] arreglo_temp = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arreglo_temp = Crear_lista(5);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Libreria objeto = new Libreria();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;ORIGINAL : &quot;+ objeto.Visualizar(arreglo_temp));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;ORDENADO : &quot;+ objeto.Visualizar(objeto.ordenar(arreglo_temp)));
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; private static int[] Crear_lista(int n) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int[] arre = new int[n];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Random generador = new Random();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; arre.length; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arre[i] = generador.nextInt(10);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return arre;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/pre&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Hasta ahi simple verdad, cumplo con la regla de orientado a objetos, sin nada de complicaciones de codigo.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;El metodo Crear_lista genera un array de elementos aleatorios,jejeje asi no parece predeterminado a nada.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Ahora pasemos a la clase Libreria.java es decir la que trabaja con el ordenamiento.&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&#39;brush: java&#39;&gt;import java.util.ArrayList;
/**
&amp;nbsp;*
&amp;nbsp;* @author JONATHAN
&amp;nbsp;*/
class Libreria {
&amp;nbsp;&amp;nbsp;&amp;nbsp; private int[] vector;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private int elementos;

&amp;nbsp;&amp;nbsp;&amp;nbsp; public Libreria() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; //para imprimir el array de la forma / 0 / 1 / 2 / 3 / 4 /5

&amp;nbsp;&amp;nbsp;&amp;nbsp; public String Visualizar(int[] v) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String s = &quot; / &quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; v.length; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s += v[i] + &quot; / &quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return s;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; int[] ordenar(int[] v) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.vector = v;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementos = vector.length;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArrayList uno = new ArrayList();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; elementos; i++)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uno.add(vector[i]);//Recorro el arreglo y agrego cada elemento al arraylist
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(int i=0;i&lt;elementos;i++)&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vector[i]=toEntero(uno.get(indice_Menor(uno)));//Asigno al arreglo
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //primitivo el elemento menor del arraylist
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uno.remove(toEntero(indice_Menor(uno)));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Proceso a eliminar dicho elemento del arraylist
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Se ejecuta un bucle rescatando el menor elemento.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Asi ordenaria mi arreglo
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return vector;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; private int indice_Menor(ArrayList indice) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int b = 0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; indice.size(); i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (toEntero(indice.get(i)) &amp;lt; toEntero(indice.get(b))) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b = i;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return b;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; private int toEntero(Object get) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //los arraylist retornan objetos pero necesito trabajar con enteros
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Simplemente convierto a entero un objeto cuando es llamada esta funcion
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Integer.parseInt(get.toString());
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

}

&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;
Hagamos un resumen existen los metodos:&lt;/div&gt;&lt;ul style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;li&gt;Visualizar(int[] v);&lt;/li&gt;
&lt;li&gt;ordenar(int[] v);&lt;/li&gt;
&lt;li&gt;indice_Menor(ArrayList indice);&lt;/li&gt;
&lt;li&gt;toEntero(Object get);&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;El metodo&amp;nbsp; Visualizar(int[] v) es solo para la presentacion de datos de modo que no aparescan todos juntos.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;El metodo ordenar(int[] v) es para realizar el ordenamiento propiamente dicho.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;El metodo indice_Menor(ArrayList indice) sirve para obtener el menor elemento de un arraylist y retorna su indice para procesarlo.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;Finalmente como los arraylist trabajan con objetos necesito un convertidor porque lo que usare seran enteros, para ese caso esta toEntero(Object get) que me retornara como entero cualquier objeto enviado.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;Espero les sirva es algo que se me ocurrio comenten y diganme que les parece.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathan-palomino.blogspot.com/feeds/8824039490046798532/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/04/metodo-de-ordenamiento-propio.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8824039490046798532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/707635783452779018/posts/default/8824039490046798532'/><link rel='alternate' type='text/html' href='http://jonathan-palomino.blogspot.com/2011/04/metodo-de-ordenamiento-propio.html' title='Metodo de ordenamiento propio'/><author><name>Unknown</name><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>2</thr:total></entry></feed>