<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Java Examples</title>
	<atom:link href="http://jleyer.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jleyer.wordpress.com</link>
	<description>By Leyer  [Facebook]http://www.facebook.com/jhonatan.ferrer</description>
	<lastBuildDate>Sun, 12 Feb 2012 16:07:23 +0000</lastBuildDate>
	<language>es</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jleyer.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Java Examples</title>
		<link>http://jleyer.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jleyer.wordpress.com/osd.xml" title="Java Examples" />
	<atom:link rel='hub' href='http://jleyer.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Imagen de Fondo JTable</title>
		<link>http://jleyer.wordpress.com/2011/08/26/imagen-de-fondo-jtable/</link>
		<comments>http://jleyer.wordpress.com/2011/08/26/imagen-de-fondo-jtable/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 23:25:36 +0000</pubDate>
		<dc:creator>Leyer</dc:creator>
				<category><![CDATA[J2SE]]></category>
		<category><![CDATA[imagen de fondo Jtable java]]></category>

		<guid isPermaLink="false">http://jleyer.wordpress.com/?p=330</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=330&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://jleyer.files.wordpress.com/2011/08/ee.jpg"><img src="http://jleyer.files.wordpress.com/2011/08/ee.jpg?w=300&#038;h=231" alt="" title="ee" width="300" height="231" class="aligncenter size-medium wp-image-331" /></a></p>
<p><pre class="brush: java;">
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.util.Random;

import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
/**
 * 
 * @author Leyer
 *
 */
public class JTableBackground extends JFrame{
	private static final long serialVersionUID = -6650115843758904110L;
	
	private static final String pathImage=&quot;d:\\12.jpg&quot;;
	
	public static final short WINDOW_WIDTH = 930;
	public static final short WINDOW_HEIGTH = 420;

	protected JTable     mainTable  =null;
	protected TableModel tableModel =null;
	
	public JTableBackground(){
		super(&quot;Imagen de Fondo JTable&quot;);
		initComponents();
		this.setSize(WINDOW_WIDTH,WINDOW_HEIGTH);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
	private class TableModel extends DefaultTableModel{
		
		private static final long serialVersionUID = 1L;
		
		public TableModel(){
			addColumn(&quot;1&quot;);addColumn(&quot;2&quot;);
			addColumn(&quot;3&quot;);addColumn(&quot;4&quot;);
			for(int index=0;index&lt;20;index++){
				Object row[]={
						new Random().nextInt(100001),
						new Random().nextInt(100001),
						new Random().nextInt(100001),
						new Random().nextInt(100001)};
				addRow(row);
			}
		}	
	}
	private void initComponents(){
		tableModel=new TableModel();
		mainTable=new JTable(tableModel){
			private static final long serialVersionUID = 1L;
			
			 ImageIcon imageBackground = new ImageIcon(pathImage);
			    @Override
			    public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
			        final Component c = super.prepareRenderer(renderer, row, column);
			        if (c instanceof JComponent){
			            ((JComponent) c).setOpaque(false);                    
			        }
			        return c;
			    }
			    @Override
			    public void paint(Graphics graphics) {
			        graphics.drawImage(imageBackground.getImage(), 0, 0,getWidth(),getHeight(),null);
			        super.paint(graphics);
			    }
		};
		mainTable.setFillsViewportHeight(true);
		mainTable.setOpaque(false);
		mainTable.setForeground(Color.white);
		JScrollPane scrollPane= new JScrollPane(mainTable);
		getContentPane().add(scrollPane);
		
	}
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				new JTableBackground().setVisible(true);
			}
		});
	}
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jleyer.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jleyer.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jleyer.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jleyer.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jleyer.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jleyer.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jleyer.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jleyer.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jleyer.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jleyer.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jleyer.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jleyer.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jleyer.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jleyer.wordpress.com/330/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=330&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jleyer.wordpress.com/2011/08/26/imagen-de-fondo-jtable/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51c11cbda170875bb9a8f9a0300ce74e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jleyer</media:title>
		</media:content>

		<media:content url="http://jleyer.files.wordpress.com/2011/08/ee.jpg?w=300" medium="image">
			<media:title type="html">ee</media:title>
		</media:content>
	</item>
		<item>
		<title>Loguearse en un foro SMF</title>
		<link>http://jleyer.wordpress.com/2011/07/30/loguease-en-un-foro-smf/</link>
		<comments>http://jleyer.wordpress.com/2011/07/30/loguease-en-un-foro-smf/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 22:29:09 +0000</pubDate>
		<dc:creator>Leyer</dc:creator>
				<category><![CDATA[J2SE]]></category>

		<guid isPermaLink="false">http://jleyer.wordpress.com/?p=314</guid>
		<description><![CDATA[Librerias necesarias commons-httpclient-3.0-rc4 commons-logging commons-codec-1.3<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=314&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Librerias necesarias</p>
<li><strong>commons-httpclient-3.0-rc4</strong></li>
<li><strong>commons-logging</strong></li>
<li><strong>commons-codec-1.3</strong></li>
<p><pre class="brush: java;">
import java.io.IOException;
import org.apache.commons.httpclient.Cookie;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.PostMethod;
/**
 * @author Leyer
 */
public class SMF {
	        
	protected  HttpClient client = new HttpClient();

	public static final String USER =&quot;user&quot;;
	public static final String PASSWORD=&quot;passwrd&quot;;

	public static final int REDIRECT = HttpStatus.SC_MOVED_TEMPORARILY;
	
	private boolean login = false;
	
	public boolean isLogin(){
		return login;
	}
	/**
	 * Inicia sesion
	 * 
	 * @param formAction Accion del formulario
	 * @param user       Nombre de Usuario
	 * @param password   Contrasena
	 * @param minutes    Duracion de la sesion en minutos
	 * 
	 * @return boolean
	 */
	public boolean login(String formAction,String user,String password,int minutes){
		PostMethod postMethod = new PostMethod(formAction);
		if(user!=null&amp;password!=null&amp;&amp;minutes&gt;0){
			postMethod.addParameter(USER, user);
			postMethod.addParameter(PASSWORD,password);
			postMethod.addParameter(&quot;cookielength&quot;,String.valueOf(minutes));
			int statusCode = -1;
			try {
				statusCode = client.executeMethod( postMethod );
				if(statusCode == REDIRECT){
					postMethod.releaseConnection();
					login = true;
				   }
			} catch (HttpException e) {e.printStackTrace();
			} catch (IOException e)   {e.printStackTrace();
			}
		}else{
			System.err.println(&quot;Datos no validos&quot;);
		}
		return login;
	}
	public Cookie[] getCookies(){
		if(isLogin()){
			return client.getState().getCookies();
		}else{
			System.err.println(&quot;No te has logueado&quot;);
			return null;
		}
	}
 public static void main( String[] args ) {
  //&lt;form action=&quot;http://foro.elhacker.net/login2.html&quot; method=&quot;post&quot; 
   String formAction = &quot;http://foro.elhacker.net/login2.html&quot;;
   SMF smf=new SMF();
   boolean login=smf.login(formAction,&quot;user&quot;, &quot;password&quot;,90);
   if(login){
	 System.out.println(&quot;Te has logueado correctamente!&quot;);  
   	 }else{
      System.err.println(&quot;usuario o contrasena incorrectos&quot;);
   	 }
   }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jleyer.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jleyer.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jleyer.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jleyer.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jleyer.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jleyer.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jleyer.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jleyer.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jleyer.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jleyer.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jleyer.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jleyer.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jleyer.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jleyer.wordpress.com/314/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=314&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jleyer.wordpress.com/2011/07/30/loguease-en-un-foro-smf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51c11cbda170875bb9a8f9a0300ce74e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jleyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Realizar una busqueda en Google</title>
		<link>http://jleyer.wordpress.com/2011/07/27/realizar-una-busqueda-en-google/</link>
		<comments>http://jleyer.wordpress.com/2011/07/27/realizar-una-busqueda-en-google/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 16:23:40 +0000</pubDate>
		<dc:creator>Leyer</dc:creator>
				<category><![CDATA[J2SE]]></category>

		<guid isPermaLink="false">http://jleyer.wordpress.com/?p=305</guid>
		<description><![CDATA[Libreria necesarias: json-lib-2.4-jdk15 ezmorph commons-beanutils-1.7 commons-collections commons-logging-1.1.1 commons-lang Salida ===================================================== [ Resultados de la Busqueda ] Titulo: Python Tutorials &#8211; Tutorialized URL : http://www.tutorialized.com/tutorials/Python/1 Titulo: PyCon 2011: Advanced Python 1 Tutorial Â« The Mouse Vs. The Python URL : http://www.blog.pythonlibrary.org/2011/03/09/pycon-2011-advanced-python-1-tutorial/ Titulo: Tutorial Python 1 &#8211; Android Market URL : https://market.android.com/details%3Fid%3Dappinventor.ai_nitronat.tutorial_python_1 Titulo: Python 1: Installation and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=305&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Libreria necesarias:</p>
<li>json-lib-2.4-jdk15</li>
<li>ezmorph</li>
<li>commons-beanutils-1.7</li>
<li>commons-collections</li>
<li>commons-logging-1.1.1</li>
<li>commons-lang</li>
<p>Salida<br />
=====================================================<br />
[    Resultados de la Busqueda   ]<br />
<strong><br />
Titulo: Python Tutorials &#8211; Tutorialized<br />
URL   : http://www.tutorialized.com/tutorials/Python/1<br />
Titulo: PyCon 2011: Advanced Python 1 Tutorial Â« The Mouse Vs. The Python<br />
URL   : http://www.blog.pythonlibrary.org/2011/03/09/pycon-2011-advanced-python-1-tutorial/<br />
Titulo: Tutorial Python 1 &#8211; Android Market<br />
URL   : https://market.android.com/details%3Fid%3Dappinventor.ai_nitronat.tutorial_python_1<br />
Titulo: Python 1: Installation and beginner&#039;s tutorial.? &#8211; YouTube<br />
URL   : http://www.youtube.com/watch%3Fv%3DNlK_f39eXCE</strong><br />
=====================================================<br />
<pre class="brush: java;">
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.Iterator;
import java.util.Vector;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
/**
 * @author Leyer
 */
public class GoogleSearch{
	public static String baseUrl       = &quot;http://ajax.googleapis.com/ajax/services/search/web?v=1.0&amp;q=&quot;;
	
	private String securityStuff = null;

	public static final int DEFAULT_PAGE_NUMBER =1;
	
	private int page = -1;
	
	private Vector&lt;Result&gt; _results =new Vector&lt;GoogleSearch.Result&gt;();

	private String key;
	public GoogleSearch(String key){
		this.key =key;
		this.securityStuff=&quot;&amp;key=&quot;+key+&quot;&amp;start=&quot;;
	}
	class Result {
		private String title = null;
		private URL    url   = null;
		
		public Result(String title,URL url){
			this.title= title;
			this.url=url;
		}
		public String getTitle() {
			return title;
		}
		public URL getUrl() {
			return url;
		}
	}
	public Vector&lt;Result&gt; search(String query,int page){
		try {
		setPageNumber(page);
		_results= search(query);
		} catch (IOException e) {
			e.printStackTrace();
		}
		return _results;
	}
	private int getPageNumber() {
		return page;
	}
	private void setPageNumber(int page) {
		this.page = page;
	}
	public Vector&lt;Result&gt; search(String query) throws IOException{
		  URLConnection connection = null;
		  
		try {
			if(page != -1){
				this.securityStuff=&quot;&amp;key=&quot;+key+&quot;&amp;source=uds&amp;filter=0&amp;start=&quot;+getPageNumber();
			}
			else{
				this.securityStuff=&quot;&amp;key=&quot;+key+&quot;&amp;source=uds&amp;filter=0&amp;start=&quot;+DEFAULT_PAGE_NUMBER;
			}
			connection = new URL( baseUrl + URLEncoder.encode(query,&quot;UTF-8&quot;) + securityStuff ).openConnection();
			} catch (MalformedURLException e) {
				e.printStackTrace();
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
		  }
		if(connection != null){
		  String line = null;
		  StringBuffer response = new StringBuffer();
		  BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
		  while((line = reader.readLine()) != null)response.append(line);
		  reader.close();
		  JSONObject obj = (JSONObject)JSONObject.fromObject(response.toString());
		  if(obj.get(&quot;responseData&quot;) instanceof JSONObject){
			  JSONObject responseData = (JSONObject)obj.get(&quot;responseData&quot;);
			  if(responseData!=null){
				  JSONArray results=(JSONArray)responseData.get(&quot;results&quot;);
				  Iterator&lt;?&gt; iterator= results.iterator();
				  while(iterator.hasNext()){
					JSONObject result=(JSONObject)iterator.next(); 
					String title=(String) result.get(&quot;titleNoFormatting&quot;);
					URL url= new URL(result.get(&quot;url&quot;).toString());
					Result r =new Result(title, url);
					_results.add(r);
				  			}
				  	}
		  		}else{
				  	System.exit(0);
			  	}
		  }
		  return _results;
	}
  public static void main(String[] args)  {

	  String key = &quot;***********&quot;;
	  String query =&quot;tutorial python&quot;;
	  GoogleSearch googleSearch=new GoogleSearch(key);
	  try {
		Vector&lt;Result&gt; results = googleSearch.search(query);
		if(results.size()&gt;0){
		Iterator&lt;Result&gt; iterator = results.iterator();		
		System.out.println(&quot;[    Resultados de la Busqueda  ]&quot;);
		System.out.println();
		while(iterator.hasNext()){
			Result result = iterator.next();
			System.out.println(&quot;Titulo: &quot;+result.getTitle());
			System.out.println(&quot;URL   : &quot;+result.getUrl());
				}
			}else{
				System.out.println(&quot;No hubieron resultados&quot;);
			
			}
	} catch (Exception e) {
		e.printStackTrace();
	}
	  }
  

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jleyer.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jleyer.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jleyer.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jleyer.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jleyer.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jleyer.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jleyer.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jleyer.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jleyer.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jleyer.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jleyer.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jleyer.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jleyer.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jleyer.wordpress.com/305/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=305&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jleyer.wordpress.com/2011/07/27/realizar-una-busqueda-en-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51c11cbda170875bb9a8f9a0300ce74e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jleyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Enviar imagen por sockets</title>
		<link>http://jleyer.wordpress.com/2011/07/27/enviar-imagen-por-sockets/</link>
		<comments>http://jleyer.wordpress.com/2011/07/27/enviar-imagen-por-sockets/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 04:27:52 +0000</pubDate>
		<dc:creator>Leyer</dc:creator>
				<category><![CDATA[J2SE]]></category>
		<category><![CDATA[Enviar imagen por sockets java]]></category>

		<guid isPermaLink="false">http://jleyer.wordpress.com/?p=302</guid>
		<description><![CDATA[Salida =========================================================== Server started port 8081 Waiting for connections&#8230; New connection /127.0.0.1 Image received! Server close. ===========================================================<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=302&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Salida<br />
===========================================================<br />
<strong>Server started port 8081<br />
Waiting for connections&#8230;<br />
New connection /127.0.0.1<br />
Image received!<br />
Server close.</strong><br />
===========================================================</p>
<p><pre class="brush: java;">
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;

import javax.imageio.ImageIO;
/**=
 * @author leyer
 */
class _Server extends ServerSocket implements Runnable{
	public _Server(int port, int backlog, InetAddress bindAddr)throws IOException {
		super(port, backlog, bindAddr);
		System.out.println(&quot;Server started port &quot;+port);
	}
	public void start(){
		new Thread(this).start();
	}
	@Override
	public void run() {
		System.out.println(&quot;Waiting for connections...&quot;);
		try {
			Socket socket=accept();
			System.out.println(&quot;New connection &quot;+socket.getInetAddress());
			BufferedImage bufferedImage = ImageIO.read(socket.getInputStream());
			ImageIO.write(bufferedImage,&quot;png&quot;, new FileOutputStream(&quot;/home/leyer/image.png&quot;));
			System.out.println(&quot;Image received!&quot;);	
			socket.close();
			close();
			System.out.println(&quot;Server close.&quot;);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
public class Transfer {
	public static void main(String args[]){
		try {
			new _Server(8081, 1, InetAddress.getByName(&quot;127.0.0.1&quot;)).start();
			Socket socket=new Socket( InetAddress.getByName(&quot;127.0.0.1&quot;),8081);
			BufferedImage bufferedImage = ImageIO.read(new File(&quot;/home/leyer/lsm.png&quot;));
			ImageIO.write(bufferedImage, &quot;png&quot;, socket.getOutputStream());
			socket.getOutputStream().flush();
		}catch (Exception e) {
			e.printStackTrace();
		}
	}
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jleyer.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jleyer.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jleyer.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jleyer.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jleyer.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jleyer.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jleyer.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jleyer.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jleyer.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jleyer.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jleyer.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jleyer.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jleyer.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jleyer.wordpress.com/302/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=302&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jleyer.wordpress.com/2011/07/27/enviar-imagen-por-sockets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51c11cbda170875bb9a8f9a0300ce74e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jleyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Subir un archivo a un servidor FTP usando sockets</title>
		<link>http://jleyer.wordpress.com/2011/07/25/subir-un-archivo-a-un-servidor-ftp-usando-sockets/</link>
		<comments>http://jleyer.wordpress.com/2011/07/25/subir-un-archivo-a-un-servidor-ftp-usando-sockets/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 00:27:47 +0000</pubDate>
		<dc:creator>Leyer</dc:creator>
				<category><![CDATA[J2SE]]></category>

		<guid isPermaLink="false">http://jleyer.wordpress.com/?p=293</guid>
		<description><![CDATA[Salida ===================================================================== 220&#8212;&#8212;&#8212;- Welcome to Pure-FTPd [privsep] [TLS] &#8212;&#8212;&#8212;- 220-You are user number 62 of 500 allowed. 220-Local time is now 00:29. Server port: 21. 220-This is a private system &#8211; No anonymous login 220-IPv6 connections are also welcome on this server. 220 You will be disconnected after 2 minutes of inactivity. 331 User **** [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=293&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Salida<br />
=====================================================================<br />
<strong>220&#8212;&#8212;&#8212;- Welcome to Pure-FTPd [privsep] [TLS] &#8212;&#8212;&#8212;-<br />
220-You are user number 62 of 500 allowed.<br />
220-Local time is now 00:29. Server port: 21.<br />
220-This is a private system &#8211; No anonymous login<br />
220-IPv6 connections are also welcome on this server.<br />
220 You will be disconnected after 2 minutes of inactivity.<br />
331 User **** OK. Password required<br />
230-User **** has group access to:  vhosts<br />
230-OK. Current restricted directory is /<br />
230 7846 Kbytes used (0%) &#8211; authorized: 6144000 Kb<br />
250 OK. Current directory is /test<br />
200 TYPE is now ASCII<br />
227 Entering Passive Mode (67,220,217,230,134,37)<br />
150 Accepted data connection<br />
uploading file&#8230;<br />
File sucessfully transferred!</strong><br />
=====================================================================<br />
<pre class="brush: java;">
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.MalformedURLException;
import java.net.Socket;
import java.util.StringTokenizer;
/**
 *@author Leyer 
 */
public class ftp {
	/**
	 * Sube un archivo a un servidor FTP
	 * 
	 * @param ftpServer Servidor FTP
	 * @param user      Usuario
	 * @param password  Contraseña
	 * @param location  Directorio donde se subira el archivo
	 * @param file      Archivo que se va a subir
	 * @param debug     Para Mostrar las respuestas del servidor
	 * 
	 */
	public static void uploadFileToFTP(String ftpServer,String user,String password,String location,File file, boolean debug     ){
		try {
		if(file.exists()){
			Socket socket=new Socket(ftpServer,21);
			BufferedWriter bufferedWriter=new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
			BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(socket.getInputStream()));
			bufferedWriter.write(&quot;USER &quot;+user+&quot;\r\n&quot;);
			bufferedWriter.flush();
			bufferedWriter.write(&quot;PASS &quot;+password+&quot;\r\n&quot;);
			bufferedWriter.flush();
			bufferedWriter.write(&quot;CWD &quot;+location+&quot;\r\n&quot;);
			bufferedWriter.flush();
			bufferedWriter.write(&quot;TYPE A\r\n&quot;);
			bufferedWriter.flush();
			bufferedWriter.write(&quot;PASV\r\n&quot;);
			bufferedWriter.flush();
			String response=null;
			while((response=bufferedReader.readLine())!=null){
				if(debug)
					System.out.println(response);
				if(response.startsWith(&quot;530&quot;)){
					System.err.println(&quot;Login aunthentication failed&quot;);
					break;
				}
				if(response.startsWith(&quot;227&quot;)){
					    String address = null;  
		                int port = -1;  
		                int opening = response.indexOf('(');  
		                int closing = response.indexOf(')', opening + 1);  
		                if (closing &gt; 0) {  
		                    String dataLink = response.substring(opening + 1, closing);  
		                    StringTokenizer tokenizer = new StringTokenizer(dataLink, &quot;,&quot;);  
		                    try {  
		                        address = tokenizer.nextToken() + &quot;.&quot; + tokenizer.nextToken() + &quot;.&quot; + tokenizer.nextToken() + &quot;.&quot; + tokenizer.nextToken();  
		                        port = Integer.parseInt(tokenizer.nextToken()) * 256 + Integer.parseInt(tokenizer.nextToken());  
		                    }  
		                    catch (Exception e) {  
		                        e.printStackTrace();
		                    }
		                    try{
				            Socket transfer =new Socket(address,port);
		        			bufferedWriter.write(&quot;STOR &quot;+file.getName()+&quot;\r\n&quot;);
		        			bufferedWriter.flush();
		        	        response=bufferedReader.readLine();
		        	        if(debug)
		        	        	System.out.println(response);
		        			if(response.startsWith(&quot;150&quot;)){
				        		FileInputStream fileInputStream=new FileInputStream(file);
				        		final int BUFFER_SIZE=1024;
				        		byte buffer[]=new byte[BUFFER_SIZE];
				        		int len=0,off=0;
				        		if(debug)
				        			System.out.println(&quot;uploading file...&quot;);
				        		while((len=fileInputStream.read(buffer))!=-1)
				        			transfer.getOutputStream().write(buffer, off, len);
				        		transfer.getOutputStream().flush();
				        		transfer.close();
				        		bufferedWriter.write(&quot;QUIT\r\n&quot;);
				        		bufferedWriter.flush();
				        		bufferedReader.close();
				        		socket.close();
				        		System.out.println(&quot;File sucessfully transferred!&quot;);
			        			break;
		        				}
		                    }catch (Exception e) {
								System.err.println(e);
							}
		                }  
					}
				}
			}else{
				System.err.println(file+&quot;no exist!&quot;);
			}
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public static void main(String[] args) {
		uploadFileToFTP(&quot;***.net&quot;,&quot;*******&quot;,&quot;*******&quot;,&quot;/test&quot;, new File(&quot;c:\\readme.txt&quot;),true);
	}
}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jleyer.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jleyer.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jleyer.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jleyer.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jleyer.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jleyer.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jleyer.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jleyer.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jleyer.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jleyer.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jleyer.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jleyer.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jleyer.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jleyer.wordpress.com/293/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=293&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jleyer.wordpress.com/2011/07/25/subir-un-archivo-a-un-servidor-ftp-usando-sockets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51c11cbda170875bb9a8f9a0300ce74e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jleyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Troyano Java ARLeyer RAT</title>
		<link>http://jleyer.wordpress.com/2011/07/23/mas-reciente-proyecto-2/</link>
		<comments>http://jleyer.wordpress.com/2011/07/23/mas-reciente-proyecto-2/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 05:51:09 +0000</pubDate>
		<dc:creator>Leyer</dc:creator>
				<category><![CDATA[J2SE]]></category>
		<category><![CDATA[Troyano java by leyer]]></category>

		<guid isPermaLink="false">http://jleyer.wordpress.com/?p=263</guid>
		<description><![CDATA[Mi mas reciente proyecto ARLeyer RAT se trada de un troyano en java, me falta poco para terminarlo [ VERSION 1.1 ] [ VERSION 1.0 ] Metal Funciones Actuales ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Tipo de Conexion TCP Conexion Directa Conexion Inversa El Cliente genera el servidor Permite abrir N cantidad de puertos Captura de Pantalla + captura por [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=263&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Mi mas reciente proyecto ARLeyer RAT se trada de un troyano en java, me falta poco para terminarlo</p>
<p><strong>[  VERSION 1.1  ]</strong><br />
<a href="http://jleyer.files.wordpress.com/2011/07/arleyerrar1_2.jpg"><img src="http://jleyer.files.wordpress.com/2011/07/arleyerrar1_2.jpg?w=300&#038;h=137" alt="" title="arleyerrar1_2" width="300" height="137" class="aligncenter size-medium wp-image-325" /></a></p>
<p><a href="http://jleyer.files.wordpress.com/2011/07/arleyerrar1_1.jpg"><img src="http://jleyer.files.wordpress.com/2011/07/arleyerrar1_1.jpg?w=300&#038;h=135" alt="" title="arleyerrar1_1" width="300" height="135" class="aligncenter size-medium wp-image-324" /></a></p>
<p><strong>[  VERSION 1.0  ]</strong></p>
<div id="attachment_311" class="wp-caption aligncenter" style="width: 310px"><a href="http://jleyer.files.wordpress.com/2011/07/arleyer.jpg"><img src="http://jleyer.files.wordpress.com/2011/07/arleyer.jpg?w=300&#038;h=147" alt="arleyer rat" title="arleyer rat" width="300" height="147" class="size-medium wp-image-311" /></a><p class="wp-caption-text">Troyano Java</p></div>
<p>Metal<br />
<a href="http://jleyer.files.wordpress.com/2011/07/capturada1.jpg"><img src="http://jleyer.files.wordpress.com/2011/07/capturada1.jpg?w=300&#038;h=147" alt="ARLeyer RAT" title="ARLeyer RAT" width="300" height="147" class="aligncenter size-medium wp-image-256" /></a></p>
<p><a href="http://jleyer.files.wordpress.com/2011/07/capturada3.jpg"><img src="http://jleyer.files.wordpress.com/2011/07/capturada3.jpg?w=300&#038;h=147" alt="ARLeyer RAT" title="ARLeyer RAT" width="300" height="147" class="aligncenter size-medium wp-image-257" /></a></p>
<p><a href="http://jleyer.files.wordpress.com/2011/07/capturada4.jpg"><img src="http://jleyer.files.wordpress.com/2011/07/capturada4.jpg?w=300&#038;h=147" alt="" title="ARLeyer RAT" width="300" height="147" class="aligncenter size-medium wp-image-259" /></a></p>
<p>Funciones Actuales<br />
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br />
Tipo de Conexion TCP<br />
Conexion Directa<br />
Conexion Inversa<br />
El Cliente genera el servidor<br />
Permite abrir N cantidad de puertos<br />
Captura de Pantalla + captura por tiempo<br />
Lectura texto y archivos copiados<br />
Informacion del Sistema, para optener informacion adicional requiere usar usar el plugin AD1Info.jar<br />
Subir Archivos<br />
Descargar Archivos se puede pausar cancelar y reanudar descargas<br />
Lista de Procesos<br />
Envios de Mensajes Planos<br />
Patalla Remota<br />
Chat<br />
Consola Remota<br />
Keylogger<br />
Captura de Sonido<br />
Lectura y Escritura en el Registro requiere plugin AD1Registry.jar<br />
Explorador de Archivos  {Abrir,<br />
	                Informacion del Archivo,<br />
                        Renombrar,<br />
                        Extraccion de archivos jar y zip,<br />
                        Eliminar archivos y carpetas,<br />
                        Buscar Archivos,<br />
                        Cambiar atributos,<br />
                        Crear carpetas,<br />
                        Mover}<br />
Otras Funciones</p>
<p>   -Apagar, reiniciar y cerrar sesion<br />
   -Escribir<br />
   -Descontrolar el raton<br />
   -Visitar una pagina web</p>
<p>   -Precionar Teclas especificas<br />
   -Reproducir sonidos<br />
   -Monitoriar la modificacion de un archivo<br />
   -Precioanar Teclas especificas y realizar combinadiones de teclas</p>
<p>   -Compilador Interno<br />
   -Ejecuar funciones de una DLL<br />
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jleyer.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jleyer.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jleyer.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jleyer.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jleyer.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jleyer.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jleyer.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jleyer.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jleyer.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jleyer.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jleyer.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jleyer.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jleyer.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jleyer.wordpress.com/263/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=263&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jleyer.wordpress.com/2011/07/23/mas-reciente-proyecto-2/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51c11cbda170875bb9a8f9a0300ce74e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jleyer</media:title>
		</media:content>

		<media:content url="http://jleyer.files.wordpress.com/2011/07/arleyerrar1_2.jpg?w=300" medium="image">
			<media:title type="html">arleyerrar1_2</media:title>
		</media:content>

		<media:content url="http://jleyer.files.wordpress.com/2011/07/arleyerrar1_1.jpg?w=300" medium="image">
			<media:title type="html">arleyerrar1_1</media:title>
		</media:content>

		<media:content url="http://jleyer.files.wordpress.com/2011/07/arleyer.jpg?w=300" medium="image">
			<media:title type="html">arleyer rat</media:title>
		</media:content>

		<media:content url="http://jleyer.files.wordpress.com/2011/07/capturada1.jpg?w=300" medium="image">
			<media:title type="html">ARLeyer RAT</media:title>
		</media:content>

		<media:content url="http://jleyer.files.wordpress.com/2011/07/capturada3.jpg?w=300" medium="image">
			<media:title type="html">ARLeyer RAT</media:title>
		</media:content>

		<media:content url="http://jleyer.files.wordpress.com/2011/07/capturada4.jpg?w=300" medium="image">
			<media:title type="html">ARLeyer RAT</media:title>
		</media:content>
	</item>
		<item>
		<title>Link En JLabel</title>
		<link>http://jleyer.wordpress.com/2011/07/19/link-en-jlabel/</link>
		<comments>http://jleyer.wordpress.com/2011/07/19/link-en-jlabel/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 01:16:14 +0000</pubDate>
		<dc:creator>Leyer</dc:creator>
				<category><![CDATA[J2SE]]></category>
		<category><![CDATA[Link JLabel]]></category>

		<guid isPermaLink="false">http://jleyer.wordpress.com/?p=249</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=249&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://jleyer.files.wordpress.com/2011/07/56.jpg"><img src="http://jleyer.files.wordpress.com/2011/07/56.jpg" alt="" title="56" width="201" height="100" class="aligncenter size-full wp-image-280" /></a><br />
<pre class="brush: java;">
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.FlowLayout;
import java.awt.Desktop.Action;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
/**
 * @author Leyer
 */
public class _Main extends JDialog{
	private static final long serialVersionUID = 1L;
	private JLabel label;
	public _Main(){
		this.setTitle(&quot;Link on Jlabel&quot;);
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		this.setSize(200,100);
		this.setLayout(new FlowLayout(FlowLayout.CENTER));
		label=new JLabel(&quot;&quot;);
		addLinkToJLabel(label, &quot;www.google.com&quot;);
		add(label);
	}
	public void addLinkToJLabel(final JLabel label,final String url){
		label.setText(&quot;&lt;html&gt;&lt;a href=&gt;http//&quot;+url+&quot;&lt;/html&gt;&quot;);
		label.addMouseListener(new MouseListener() {
			@Override public void mouseReleased(MouseEvent arg0) {}
			@Override public void mousePressed(MouseEvent arg0) {}
			@Override
			public void mouseExited(MouseEvent arg0) {
				label.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
			}
			@Override
			public void mouseEntered(MouseEvent arg0) {
				label.setCursor(new Cursor(Cursor.HAND_CURSOR));
			}
			@Override
			public void mouseClicked(MouseEvent arg0) {
				try {
					if(Desktop.getDesktop().isSupported(Action.BROWSE)){
						label.setCursor(new Cursor(Cursor.WAIT_CURSOR));
						Desktop.getDesktop().browse(new URI(url));
						label.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
		                        }
					else
						System.err.println(&quot;Not supported!&quot;);
				} catch (IOException e1)         {e1.printStackTrace();
				} catch (URISyntaxException e1)  {System.err.println(&quot;URI Syntax error!&quot;);
				}
			}
		});
	}
	public static void main(String[] argv) {
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				new _Main().setVisible(true);
			}
		});
	}
}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jleyer.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jleyer.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jleyer.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jleyer.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jleyer.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jleyer.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jleyer.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jleyer.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jleyer.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jleyer.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jleyer.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jleyer.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jleyer.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jleyer.wordpress.com/249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=249&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jleyer.wordpress.com/2011/07/19/link-en-jlabel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51c11cbda170875bb9a8f9a0300ce74e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jleyer</media:title>
		</media:content>

		<media:content url="http://jleyer.files.wordpress.com/2011/07/56.jpg" medium="image">
			<media:title type="html">56</media:title>
		</media:content>
	</item>
		<item>
		<title>Opteniendo los Iconos del Sistema con SWT</title>
		<link>http://jleyer.wordpress.com/2011/07/09/opteniendo-los-iconos-del-sistema-con-swt/</link>
		<comments>http://jleyer.wordpress.com/2011/07/09/opteniendo-los-iconos-del-sistema-con-swt/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 16:14:23 +0000</pubDate>
		<dc:creator>Leyer</dc:creator>
				<category><![CDATA[J2SE]]></category>
		<category><![CDATA[Icons SWT sistema Windows]]></category>

		<guid isPermaLink="false">http://jleyer.wordpress.com/?p=230</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=230&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://jleyer.files.wordpress.com/2011/07/jhg.jpg" alt="java" /></p>
<p><pre class="brush: java;">
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.DirectColorModel;
import java.awt.image.WritableRaster;

import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;

import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.PaletteData;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.program.Program;
/**
 *
 * @author Leyer
 *
 */
public class IconProgram extends JDialog{

	private static final long serialVersionUID = 1L;

	public static final String[] EXTENSIONS =Program.getExtensions();
	public BufferedImage convertToBufferedReader(ImageData data) {
	    ColorModel colorModel = null;
	    PaletteData palette = data.palette;
	    if (palette.isDirect) {
	      colorModel = new DirectColorModel(data.depth, palette.redMask,palette.greenMask, palette.blueMask);
	      BufferedImage bufferedImage = new BufferedImage(colorModel,colorModel.createCompatibleWritableRaster(data.width,data.height), false, null);
	      WritableRaster raster = bufferedImage.getRaster();

	      int[] pixelArray = new int[3];
	      for (int y = 0; y &amp;amp;lt; data.height; y++) {
	        for (int x = 0; x &amp;amp;lt; data.width; x++) {
	          int pixel = data.getPixel(x, y);
	          RGB rgb   = palette.getRGB(pixel);
	          if(rgb.red==0&amp;amp;amp;&amp;amp;amp;rgb.green==0&amp;amp;amp;&amp;amp;amp;rgb.blue==0){
		          pixelArray[0] = -1;pixelArray[1] = -1;pixelArray[2] = -1;
	          }else{
	        	  pixelArray[0] = rgb.red;pixelArray[1] = rgb.green;pixelArray[2] = rgb.blue;
	          }
	          raster.setPixels(x, y, 1, 1, pixelArray);
	        }
	      }
	      return bufferedImage;
	  }
		return null;
    }
	private JTable table;
	private DefaultTableModel defaultTableModel;
	private JScrollPane scrollPane;
	private class cellRenderer extends DefaultTableCellRenderer{
		private static final long serialVersionUID = 1L;
		@Override
		public void setValue(Object value) {
			if(value != null){
				try{
					Program program = Program.findProgram(value.toString());
					setIcon(new ImageIcon(convertToBufferedReader(program.getImageData())));
				}catch (Exception e) {

				}
			}
		}
	}
	public IconProgram(){
		defaultTableModel=new DefaultTableModel();
		defaultTableModel.addColumn(&amp;amp;quot;Icon&amp;amp;quot;);
		defaultTableModel.addColumn(&amp;amp;quot;Type&amp;amp;quot;);
		table = new JTable(defaultTableModel);
		table.getColumnModel().getColumn(0).setCellRenderer(new cellRenderer());
		for(int index=0;index			defaultTableModel.addRow(
					new Object[]{EXTENSIONS[index],
							Program.findProgram(EXTENSIONS[index])});
		table.getColumnModel().getColumn(1).setPreferredWidth(920);
		scrollPane=new JScrollPane(table);
		getContentPane().add(scrollPane);
		this.setTitle(&amp;amp;quot;Icons&amp;amp;quot;);
		this.setSize(500, 500);
		this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
	}
	public static void main(String[] args) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				new IconProgram().setVisible(true);
			}
		});
	}
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jleyer.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jleyer.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jleyer.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jleyer.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jleyer.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jleyer.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jleyer.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jleyer.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jleyer.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jleyer.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jleyer.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jleyer.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jleyer.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jleyer.wordpress.com/230/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=230&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jleyer.wordpress.com/2011/07/09/opteniendo-los-iconos-del-sistema-con-swt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51c11cbda170875bb9a8f9a0300ce74e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jleyer</media:title>
		</media:content>

		<media:content url="http://jleyer.files.wordpress.com/2011/07/jhg.jpg" medium="image">
			<media:title type="html">java</media:title>
		</media:content>
	</item>
		<item>
		<title>Funcion Recursiva para Eliminar una Llave en el Registro de Windows (WinRegistry)</title>
		<link>http://jleyer.wordpress.com/2011/07/08/funcion-recursiva-para-eliminar-una-llave-en-el-registro-de-windows-winregistry/</link>
		<comments>http://jleyer.wordpress.com/2011/07/08/funcion-recursiva-para-eliminar-una-llave-en-el-registro-de-windows-winregistry/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 17:12:19 +0000</pubDate>
		<dc:creator>Leyer</dc:creator>
				<category><![CDATA[J2SE]]></category>
		<category><![CDATA[Registro Windows Java winregstry]]></category>

		<guid isPermaLink="false">http://jleyer.wordpress.com/?p=228</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=228&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: java;">
public void delKey(Key root,Key a,Key b){
		try {
			List listKeys = registry.listKeys(a);
			String subKey=&quot;&quot;;
			Key newKey=null;
			Iterator iterator=null;
			try{
				iterator = listKeys.iterator();
				while(iterator.hasNext()){
					newKey = registry.openKey(a, iterator.next());
					if(root == Regor.HKEY_LOCAL_MACHINE)subKey=newKey.getPath().substring(19);
					subKey=newKey.getPath().substring(18);
					registry.listKeys(newKey).size();
					delKey(root,newKey,b);
				    }
				delKey(root,a,b);
				}catch (Exception exception) {
				boolean deleted=false;
					try{
						registry.delKey(root,subKey);
						deleted=true;
					}catch (Exception ex) {
						deleted=false;
						return;
					}
					if(!deleted){
						newKey = registry.openKey(a, iterator.next());
						delKey(root,newKey,b);
					}else{	
                                                delKey(root,a,b);
					}
				}
		} catch (RegistryErrorException e) {
			e.printStackTrace();
		}
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jleyer.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jleyer.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jleyer.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jleyer.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jleyer.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jleyer.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jleyer.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jleyer.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jleyer.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jleyer.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jleyer.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jleyer.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jleyer.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jleyer.wordpress.com/228/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=228&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jleyer.wordpress.com/2011/07/08/funcion-recursiva-para-eliminar-una-llave-en-el-registro-de-windows-winregistry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51c11cbda170875bb9a8f9a0300ce74e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jleyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Imagen en Filas del JTable</title>
		<link>http://jleyer.wordpress.com/2011/07/08/imagen-en-filas-del-jtable/</link>
		<comments>http://jleyer.wordpress.com/2011/07/08/imagen-en-filas-del-jtable/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 13:17:00 +0000</pubDate>
		<dc:creator>Leyer</dc:creator>
				<category><![CDATA[J2SE]]></category>
		<category><![CDATA[Imagen Filas Jtable Java]]></category>

		<guid isPermaLink="false">http://jleyer.wordpress.com/?p=220</guid>
		<description><![CDATA[http://jleyer.files.wordpress.com/2011/07/d1.jpg [img]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=220&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre><a href="http://jleyer.wordpress.com/2011/07/08/imagen-en-filas-del-jtable/#gallery-1-slideshow">Click to view slideshow.</a></p>
<p>http://jleyer.files.wordpress.com/2011/07/d1.jpg</p>
<p>[img]<br />
<pre class="brush: java;">
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;

public class CellRendererImagen extends DefaultTableCellRenderer {

	private static final long serialVersionUID = 1L;

    static class TableModel extends DefaultTableModel{

	private static final long serialVersionUID = 1L;

		public TableModel(){
			addColumn(&quot;Imagen&quot;);
			addColumn(&quot;A&quot;);
			addColumn(&quot;B&quot;);
			addColumn(&quot;C&quot;);
		}
	}
	public CellRendererImagen() {
		super();
	}
	public void setValue(Object value) {
	if (value == null) setText(&quot;&quot;);
	   else{
	    	if(value.toString().equals(&quot;OK&quot;)){
			     setIcon(Icons.ICON_ACCEPT);//modf
	    	}else{
	    		 setIcon(Icons.ICON_CANCEL);//modf
	    	}
	   	}
	}
	static class Frame extends JFrame{
		private static final long serialVersionUID = 1L;

		public Frame(){

			TableModel tableModel = new TableModel();
			JTable table = new JTable(tableModel);
			table.getColumnModel().getColumn(0).setCellRenderer(new CellRendererImagen());
			JScrollPane scrollPane=new JScrollPane(table);
			getContentPane().add(scrollPane);
			this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			this.setSize(500,200);

			tableModel.addRow(new Object[]{&quot;OK&quot;,&quot;A&quot;,&quot;B&quot;,&quot;C&quot;});
			tableModel.addRow(new Object[]{&quot;OK&quot;,&quot;A&quot;,&quot;B&quot;,&quot;C&quot;});
			tableModel.addRow(new Object[]{&quot;OK&quot;,&quot;A&quot;,&quot;B&quot;,&quot;C&quot;});
			tableModel.addRow(new Object[]{&quot;OK&quot;,&quot;A&quot;,&quot;B&quot;,&quot;C&quot;});

			tableModel.addRow(new Object[]{&quot;FAIL&quot;,&quot;A&quot;,&quot;B&quot;,&quot;C&quot;});
			tableModel.addRow(new Object[]{&quot;FAIL&quot;,&quot;A&quot;,&quot;B&quot;,&quot;C&quot;});
		}
		public static void main(String args[]){
			SwingUtilities.invokeLater(new Runnable() {

				@Override
				public void run() {
					new Frame().setVisible(true);

				}
			});
		}
	}
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jleyer.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jleyer.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jleyer.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jleyer.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jleyer.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jleyer.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jleyer.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jleyer.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jleyer.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jleyer.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jleyer.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jleyer.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jleyer.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jleyer.wordpress.com/220/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jleyer.wordpress.com&amp;blog=14742011&amp;post=220&amp;subd=jleyer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jleyer.wordpress.com/2011/07/08/imagen-en-filas-del-jtable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51c11cbda170875bb9a8f9a0300ce74e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jleyer</media:title>
		</media:content>
	</item>
	</channel>
</rss>
