<?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-1979839458424143226</id><updated>2024-09-14T01:35:17.221+09:00</updated><category term="JMF"/><category term="SQLite"/><category term="Swing"/><category term="WebDriver"/><category term="JFreeChart"/><category term="文字列操作"/><category term="Eclipse"/><category term="jsoup"/><title type='text'>JAVA メモ</title><subtitle type='html'>メモとして記録しているだけです。</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><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><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>75</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1979839458424143226.post-5075264824210638230</id><published>2013-08-14T13:19:00.000+09:00</published><updated>2013-08-14T13:19:48.396+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQLite"/><title type='text'>テーブルの作成とデータ追加：SQLite</title><content type='html'>&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class SqliteTest {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO 自動生成されたメソッド・スタブ

  try {
   // JDBCドライバーの指定
   Class.forName(&quot;org.sqlite.JDBC&quot;);

   // データベースに接続する なければ作成される
   Connection con = DriverManager.getConnection(&quot;jdbc:sqlite:../database.db&quot;);

   // Statementオブジェクト作成
   Statement stmt = con.createStatement();

   //テーブル作成　すでにある場合は例外が発生
   stmt.executeUpdate(&quot;create table nameTable( id integer, name string )&quot;);
   
    //テーブルにデータを追加
   stmt.executeUpdate(&quot;insert into nameTable values(1, &#39;sakura&#39;)&quot;);

  } catch (ClassNotFoundException e) {
   // TODO 自動生成された catch ブロック
   e.printStackTrace();
  } catch (SQLException e) {
   // TODO 自動生成された catch ブロック
   // Connection の例外が発生した時

   e.printStackTrace();
  }
 }
}

&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEEtx1LN0rCfrzWXj9DiKYLD5Uy009knh3S8hV6PlM-MWt56Nb__6CY3WLEkBwr0N4CedhAkBomWab_6_QOd14VK_f1nawssr5TOnSGOOfCs_VAXtDM36b4tLBMu2sSl86z0cjj7Te9Ekj/s1600/014.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEEtx1LN0rCfrzWXj9DiKYLD5Uy009knh3S8hV6PlM-MWt56Nb__6CY3WLEkBwr0N4CedhAkBomWab_6_QOd14VK_f1nawssr5TOnSGOOfCs_VAXtDM36b4tLBMu2sSl86z0cjj7Te9Ekj/s1600/014.png&quot; height=&quot;177&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/5075264824210638230/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2013/08/sqlite.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/5075264824210638230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/5075264824210638230'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2013/08/sqlite.html' title='テーブルの作成とデータ追加：SQLite'/><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="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEEtx1LN0rCfrzWXj9DiKYLD5Uy009knh3S8hV6PlM-MWt56Nb__6CY3WLEkBwr0N4CedhAkBomWab_6_QOd14VK_f1nawssr5TOnSGOOfCs_VAXtDM36b4tLBMu2sSl86z0cjj7Te9Ekj/s72-c/014.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979839458424143226.post-1242084752896361959</id><published>2013-08-14T12:36:00.001+09:00</published><updated>2013-08-14T12:59:11.142+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQLite"/><title type='text'>Eclipse で SQLite 準備からデータベース作成・接続まで</title><content type='html'>1.SQLite用のJDBCドライバーをダウンロードしてくる。&lt;br /&gt;
&lt;a href=&quot;https://bitbucket.org/xerial/sqlite-jdbc&quot;&gt;https://bitbucket.org/xerial/sqlite-jdbc&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.Eclipse のパッケージエクスプローラからSQLite を使うプロジェクトをせんたくして、&lt;br /&gt;
&lt;br /&gt;
右クリックからプロパティーを選択して、Javaのビルド・パス　でライブラリタブを選択して、&lt;br /&gt;
&lt;br /&gt;
外部ライブラリを登録する。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiYIuUUch7AhO_h1c2oLE_g50UaFikTGLVceOZ5psqyEwKdrJw502KWIWcghC_m-_9MvmHQFWo3BIiIgfBw_SDL-RXIzY3cLBwWT-bqY5RHdFkMYxmk1RrXJ_aR_8u128sg6tnz5pNxPKa/s1600/013.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;229&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiYIuUUch7AhO_h1c2oLE_g50UaFikTGLVceOZ5psqyEwKdrJw502KWIWcghC_m-_9MvmHQFWo3BIiIgfBw_SDL-RXIzY3cLBwWT-bqY5RHdFkMYxmk1RrXJ_aR_8u128sg6tnz5pNxPKa/s1600/013.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
準備完了！&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class SqliteTest {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO 自動生成されたメソッド・スタブ

  try {
   // JDBCドライバーの指定
   Class.forName(&quot;org.sqlite.JDBC&quot;);

   // データベースに接続する なければ作成される
   Connection con = DriverManager.getConnection(&quot;jdbc:sqlite:../database.db&quot;);

  } catch (ClassNotFoundException e) {
   // TODO 自動生成された catch ブロック
   e.printStackTrace();
  } catch (SQLException e) {
   // TODO 自動生成された catch ブロック
   // Connection の例外が発生した時

   e.printStackTrace();
  }
 }
}

&lt;/pre&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/1242084752896361959/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2013/08/eclipse-sqlite.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/1242084752896361959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/1242084752896361959'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2013/08/eclipse-sqlite.html' title='Eclipse で SQLite 準備からデータベース作成・接続まで'/><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="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiYIuUUch7AhO_h1c2oLE_g50UaFikTGLVceOZ5psqyEwKdrJw502KWIWcghC_m-_9MvmHQFWo3BIiIgfBw_SDL-RXIzY3cLBwWT-bqY5RHdFkMYxmk1RrXJ_aR_8u128sg6tnz5pNxPKa/s72-c/013.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979839458424143226.post-7646115545199343011</id><published>2013-08-13T12:49:00.002+09:00</published><updated>2013-08-13T12:49:54.237+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jsoup"/><title type='text'>テーブルの中のリンクアドレスをすべて取得する。</title><content type='html'>&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;
import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;


public class paint {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO 自動生成されたメソッド・スタブ
  
  String url = &quot;http://127.0.0.1/auto/date-top.htm&quot;;
  
   try {
   Document document = Jsoup.connect(url).get();
   
            Element table = document.getElementById(&quot;tableIdName&quot;);
            
            Elements links = table.getElementsByTag(&quot;a&quot;);
            
            for (Element link : links) {
             String linkHref = link.attr(&quot;href&quot;); 
             System.out.println( linkHref );
            }
   
  } catch (IOException e) {
   // TODO 自動生成された catch ブロック
   e.printStackTrace();
  }
 }

}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/7646115545199343011/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2013/08/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/7646115545199343011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/7646115545199343011'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2013/08/blog-post.html' title='テーブルの中のリンクアドレスをすべて取得する。'/><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-1979839458424143226.post-7323170493538431258</id><published>2012-08-12T13:28:00.000+09:00</published><updated>2012-08-12T13:53:04.811+09:00</updated><title type='text'>正規表現：基本</title><content type='html'>&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;^&lt;/span&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;行の先頭&lt;/span&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;[ ]&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;指定内の任意の表現 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;例&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;[ab]&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;aまたはbにマッチする&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;メタ文字&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;\s&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;任意の空白文字（スペース、タブ、改行、復帰）1文字にマッチします。&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;例&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;[^\\s]&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;先頭の空白文字位置文字にマッチする。&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;*&lt;/td&gt;&lt;td&gt;直前にある文字が0回以上繰り返された文字列にマッチします。0回でも可なので直前の文字が存在しなくてもマッチする。&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/7323170493538431258/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/08/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/7323170493538431258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/7323170493538431258'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/08/blog-post.html' title='正規表現：基本'/><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-1979839458424143226.post-5159202116296968363</id><published>2012-08-02T07:51:00.002+09:00</published><updated>2012-08-02T08:56:49.844+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JMF"/><title type='text'>ライブ配信送信側のJavaプログラム:JMF</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioAlh9Wiri2n-kf6nRMUCcwX_YKv9scR8CoANR9hf-_M6EOmrcqYite2MwyRaDcMXFHv6fIkp2dTUQnHHKYy68S0bSslIbBe_7zEzUSoL_GqLr3PUmd-DcEnryaNcikU6ALu5cso01USms/s1600/012.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioAlh9Wiri2n-kf6nRMUCcwX_YKv9scR8CoANR9hf-_M6EOmrcqYite2MwyRaDcMXFHv6fIkp2dTUQnHHKYy68S0bSslIbBe_7zEzUSoL_GqLr3PUmd-DcEnryaNcikU6ALu5cso01USms/s320/012.jpg&quot; width=&quot;304&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
受信側プログラムはJMStudioを利用&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;import javax.media.*;
import javax.media.control.*;
import javax.media.protocol.*;
import javax.media.format.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.util.*;

public class TransmitterTest extends JFrame {

    private MediaLocator mediaLocator = null;
    private DataSink dataSink = null;
    private Processor mediaProcessor = null;
    private Format[] formats = new Format[] {
        new VideoFormat( VideoFormat.JPEG_RTP ) };
    private ContentDescriptor descriptor = 
        new ContentDescriptor( ContentDescriptor.RAW_RTP );
    private InputPanel ipanel;
    private static final int PORT=22224;
    private Component ctrl;

  /** Creates a new transmitter frame. */
    public TransmitterTest() {

        super( &quot;Video Transmitter&quot; );
        ipanel = new InputPanel();
        getContentPane().add( ipanel, &quot;Center&quot; );
        pack();
        show();
    }

  /** set locator from Capture Device */
    public void setLocator() {
        try {
            MediaLocator deviceLocator = searchCaptureDevice();
            DataSource source
                = Manager.createDataSource( deviceLocator );
            mediaLocator
             = new MediaLocator( &quot;rtp://&quot; + ipanel.host.getText()
                                  + &quot;:&quot; + PORT + &quot;/video&quot; );
            mediaProcessor = Manager.createRealizedProcessor(
                new ProcessorModel( source, formats, descriptor ) );
            dataSink = Manager.createDataSink(
                   mediaProcessor.getDataOutput(), mediaLocator );

            setControlPanel();
            startTransmitting();
                
        } catch (Exception e) {
            System.err.println( e.toString() );
        }
    }

  /** Search Capture Device for Video */
    public static MediaLocator searchCaptureDevice() {

         Vector list = CaptureDeviceManager.getDeviceList(
                       new VideoFormat( VideoFormat.YUV ) );
         if( list.size() &amp;gt; 0 ) {
             CaptureDeviceInfo info
               = (CaptureDeviceInfo)list.elementAt( 0 );
             return  info.getLocator();
         }
         System.err.println( &quot;No Capture Device&quot; );
         return null;
    }

  /** set Control */
    public void setControlPanel() {

        ctrl = mediaProcessor.getControlPanelComponent();
        getContentPane().add( ctrl, &quot;South&quot; );
        pack();
    }

  /** Starts transmitting the media. */
    public void startTransmitting() throws IOException {

        mediaProcessor.start();
        dataSink.open();
        dataSink.start();
    }

  /** start here */
    public static void main(String[] args) {

        TransmitterTest transmitter = new TransmitterTest();
    }

  /** Input receive host name, port number */
    class InputPanel extends JPanel implements ActionListener {

         public JLabel label = new JLabel( &quot;Receiver Adress:&quot; );
         public JTextField host = new JTextField( &quot;&quot;, 16 );
         public JButton transmit = new JButton( &quot;Transmit&quot; );

         InputPanel() {
              add( label );
              add( host );
              add( transmit );
              transmit.addActionListener( this );
         }

      /** Event Processing */
         public void actionPerformed( ActionEvent evt ) {

              if( evt.getSource() instanceof JButton ) {
                  if( (JButton)(evt.getSource()) == transmit ) {
                      setLocator();
                  }
              }
         }
    }
}
&lt;/pre&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/5159202116296968363/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/08/sss.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/5159202116296968363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/5159202116296968363'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/08/sss.html' title='ライブ配信送信側のJavaプログラム:JMF'/><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="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioAlh9Wiri2n-kf6nRMUCcwX_YKv9scR8CoANR9hf-_M6EOmrcqYite2MwyRaDcMXFHv6fIkp2dTUQnHHKYy68S0bSslIbBe_7zEzUSoL_GqLr3PUmd-DcEnryaNcikU6ALu5cso01USms/s72-c/012.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979839458424143226.post-6617280685476620487</id><published>2012-07-11T09:50:00.001+09:00</published><updated>2012-07-11T09:50:46.887+09:00</updated><title type='text'>末尾の改行コード削除</title><content type='html'>正規表現で末尾の文字列を削除する。&lt;br/&gt;
&lt;pre class=&quot;brush: java;&quot;&gt;
  Pattern pattern = Pattern.compile(&quot;\n$&quot;);
  
  Matcher matcher = pattern.matcher(&quot;Hello World. Hello World.\n&quot;);
  
  String strResult = matcher.replaceAll(&quot;&quot;);
  
  System.out.println(strResult);
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/6617280685476620487/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/07/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/6617280685476620487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/6617280685476620487'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/07/blog-post.html' title='末尾の改行コード削除'/><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-1979839458424143226.post-2992512584611931927</id><published>2012-07-11T07:48:00.000+09:00</published><updated>2012-08-02T07:31:28.831+09:00</updated><title type='text'>SyntaxHighlighter のバージョンアップ</title><content type='html'>SyntaxHighlighter を&amp;nbsp;Version: 1.5.1　から version 3.0.83 にバージョンアップしてみる。&lt;br /&gt;
どちらのバージョンからの文法でも動くようにする。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java;&quot;&gt;
&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;

&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;
 &amp;lt;head&amp;gt;
  &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&amp;gt;
  &amp;lt;title&amp;gt;dp.SyntaxHighlighter Tests&amp;lt;/title&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&quot;scripts3/shCore.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&quot;scripts3/shLegacy.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&quot;text/javascript&quot; src=&quot;scripts3/shBrushJava.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;styles3/shCoreDefault.css&quot;/&amp;gt;
 &amp;lt;/head&amp;gt;
 &amp;lt;body&amp;gt;
  &amp;lt;pre name=&quot;code&quot; class=&quot;java&quot;&amp;gt;
function helloSyntaxHighlighter()
{
 return &quot;hi!&quot;;
}
&amp;lt;/pre&amp;gt;

  &amp;lt;pre class=&quot;brush: java;&quot;&amp;gt;
function helloSyntaxHighlighter()
{
 return &quot;hi!&quot;;
}
&amp;lt;/pre&amp;gt;


  &amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
   SyntaxHighlighter.all();
   dp.SyntaxHighlighter.HighlightAll(&#39;code&#39;);

  &amp;lt;/script&amp;gt;
 &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;function helloSyntaxHighlighter()
{
 return &quot;hi!&quot;;
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java;&quot;&gt;function helloSyntaxHighlighter()
{
 return &quot;hi!&quot;;
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/2992512584611931927/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/07/syntaxhighlighter.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/2992512584611931927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/2992512584611931927'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/07/syntaxhighlighter.html' title='SyntaxHighlighter のバージョンアップ'/><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-1979839458424143226.post-5942423967704838068</id><published>2012-07-03T03:47:00.000+09:00</published><updated>2012-08-02T08:24:11.599+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JMF"/><title type='text'>ライブ配信受信側のJavaプログラム:JMF</title><content type='html'>送信側は&amp;nbsp;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;JMStudio&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;を使って、USBカメラの映像を送信する。&lt;/span&gt;&lt;br /&gt;
送信の設定は　&lt;a href=&quot;http://yamato-java.blogspot.jp/2012/07/jmf.html&quot;&gt;ライブ配信テスト:JMF&lt;/a&gt;　で確認。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;import javax.media.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;

/** Media Frame */
public class ReceiverTest extends JFrame {

    private Player player = null;
    private InputPanel ipanel;
    private Component canvas;
    private Component panel;
    private static final int PORT = 22224;

    public ReceiverTest() {

        super( &quot;RTP Receiver&quot; );
        ipanel = new InputPanel();
        getContentPane().add( ipanel, &quot;North&quot; );
        pack();
    }

  /** start play */
    public void startPlayer() {
        try {
            MediaLocator locator
              = new MediaLocator( &quot;rtp://&quot; + ipanel.host.getText()
                         + &quot;:&quot; + PORT + &quot;/video&quot; );
            player = Manager.createRealizedPlayer( locator );
            canvas = player.getVisualComponent();
            if ( canvas != null) {
                 getContentPane().add( canvas, &quot;Center&quot; );
            }
            panel = player.getControlPanelComponent();
            if ( panel != null) {
                 getContentPane().add( panel, &quot;South&quot; );
            }
            pack();
            player.start();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

  /** start here */
    public static void main(String[] args) {
        try {
            ReceiverTest frame = new ReceiverTest(); 
            frame.show();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

  /** Input receive host name, port number */
    class InputPanel extends JPanel implements ActionListener {

         public JLabel label = new JLabel( &quot;Transmitter Adress:&quot; );
         public JTextField host = new JTextField( &quot;&quot;, 16 );
         public JButton receive = new JButton( &quot;Receive&quot; );

         InputPanel() {

              add( label );
              add( host );
              add( receive );
              receive.addActionListener( this );
         }

      /** Event Processing */
         public void actionPerformed( ActionEvent evt ) {

              if( evt.getSource() instanceof JButton ) {
                  if( (JButton)(evt.getSource()) == receive ) {
                      startPlayer();
                  }
              }
          }
     }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2RL1qJDW_vK4jxusYPZuBiSO-CHQdWB9bY3cM0mLeg4Jdy8KQtweBDmLVoknmyCwdW1svHTWaGxPgosKRLkIb6Gs4LFFXunMV9DEWWSgoYpcCw0tKlydFau_hVkmwxtCE0b82CjQejBxC/s1600/081.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;274&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2RL1qJDW_vK4jxusYPZuBiSO-CHQdWB9bY3cM0mLeg4Jdy8KQtweBDmLVoknmyCwdW1svHTWaGxPgosKRLkIb6Gs4LFFXunMV9DEWWSgoYpcCw0tKlydFau_hVkmwxtCE0b82CjQejBxC/s320/081.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/5942423967704838068/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/07/javajmf.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/5942423967704838068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/5942423967704838068'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/07/javajmf.html' title='ライブ配信受信側のJavaプログラム:JMF'/><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="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2RL1qJDW_vK4jxusYPZuBiSO-CHQdWB9bY3cM0mLeg4Jdy8KQtweBDmLVoknmyCwdW1svHTWaGxPgosKRLkIb6Gs4LFFXunMV9DEWWSgoYpcCw0tKlydFau_hVkmwxtCE0b82CjQejBxC/s72-c/081.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979839458424143226.post-3647325166790834247</id><published>2012-07-03T03:08:00.002+09:00</published><updated>2012-07-03T03:08:47.102+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JMF"/><title type='text'>ライブ配信テスト:JMF</title><content type='html'>JMF をインストールしたときに入っている、JMStudio でライブ配信テストをやってみる。&lt;br /&gt;
&lt;br /&gt;
怒涛のめもめもリンク集&lt;br /&gt;
&lt;a href=&quot;http://mechsys.tec.u-ryukyu.ac.jp/~oshiro/SiteList/2009/07/16/711&quot;&gt;JMF: JMStudioでRTP試し&lt;/a&gt;　に詳しく解説してある。&lt;br /&gt;
&lt;br /&gt;
JMStudio&amp;nbsp;で送信側と受信側のテストが出来る。&lt;br /&gt;
&lt;br /&gt;
一台のパソコンで送信側と受信側のテストをしてみる。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;送信側の設定&lt;/b&gt;&lt;br /&gt;
JMStudio&amp;nbsp;を起動させて、File から Transmit.. を選択する。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJqf6U7ichKmRIA7sDOMWM-TsFONee0VISu85daun-nFJj1rByCXSbToMFJOtlSjUEAx3-qFoCeOQe9_wgkx6z_XUBp_Hjj3-ofddOpbUK_1B-Qyn9Iwg8VQHvSuUCRa_BURnRkiCNMMX2/s1600/070.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJqf6U7ichKmRIA7sDOMWM-TsFONee0VISu85daun-nFJj1rByCXSbToMFJOtlSjUEAx3-qFoCeOQe9_wgkx6z_XUBp_Hjj3-ofddOpbUK_1B-Qyn9Iwg8VQHvSuUCRa_BURnRkiCNMMX2/s1600/070.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;hr /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiphBGurQxwtgGVRNqI9fuzldKbQFjTbygA6Wgr4_cHG_3BDf8TBvh4FPODl0exU30mFzZaR0ps5-NH0EHRr4PHqXMSVpwJsZvnNHkW4gHMj7PEkFhamDWYmdoC1zz7b_tpjijsbdABD_AK/s1600/071.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiphBGurQxwtgGVRNqI9fuzldKbQFjTbygA6Wgr4_cHG_3BDf8TBvh4FPODl0exU30mFzZaR0ps5-NH0EHRr4PHqXMSVpwJsZvnNHkW4gHMj7PEkFhamDWYmdoC1zz7b_tpjijsbdABD_AK/s320/071.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Caputure..をクリックする。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf1saUW9ym5-mOEOrCWR_Hfqtaa4RwcMMzCCMyCAC9RTalnIUNx2h-nFVM_QR6SOF7JOBXDqwX_Se82K0-hfLtKQqEp-SrmELYUAiGoWBtoXnTxQzSWFQaZDsMoeDqgwMH0k88t1jC3ViE/s1600/074.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;175&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf1saUW9ym5-mOEOrCWR_Hfqtaa4RwcMMzCCMyCAC9RTalnIUNx2h-nFVM_QR6SOF7JOBXDqwX_Se82K0-hfLtKQqEp-SrmELYUAiGoWBtoXnTxQzSWFQaZDsMoeDqgwMH0k88t1jC3ViE/s320/074.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
OK をクリックする&lt;br /&gt;
Next&amp;gt;&amp;gt; をクリックする。&lt;br /&gt;
&lt;hr /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVBjb8BXc77EtrMPo_iCKmGpdY11_HuOV3H4L08ng5DdxGVVMaX9zenR0qa2BvzhjEl0KGUdgJkBXt0MUyQ-7ehHdt_UbcPqc8q8nj3n8yI9YO_y0U7iRfZoXQUdUq6TwEiSW_6_g8o2F5/s1600/075.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVBjb8BXc77EtrMPo_iCKmGpdY11_HuOV3H4L08ng5DdxGVVMaX9zenR0qa2BvzhjEl0KGUdgJkBXt0MUyQ-7ehHdt_UbcPqc8q8nj3n8yI9YO_y0U7iRfZoXQUdUq6TwEiSW_6_g8o2F5/s320/075.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Next&amp;gt;&amp;gt; をクリックする。&lt;br /&gt;
&lt;hr /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxdXHDkUvWX-LmDQPu9zyXieRQvfBe8M7ZpSpvSIGnFpi2Xw4KdVX01HmEENla91BQctBDNLZnCLfBcdwS50208wJBHLTJtVcL0WjXKoFF4EX4qjizDDUHzGsegyGWBd-Dvc6JqX7JXSNI/s1600/076.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxdXHDkUvWX-LmDQPu9zyXieRQvfBe8M7ZpSpvSIGnFpi2Xw4KdVX01HmEENla91BQctBDNLZnCLfBcdwS50208wJBHLTJtVcL0WjXKoFF4EX4qjizDDUHzGsegyGWBd-Dvc6JqX7JXSNI/s320/076.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Finish をクリックする。&lt;br /&gt;
&lt;hr /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXF9bo8U8jFiNSab_yAhDc8LVD5RiwNmwrM5sHG3z-jMHd3EH7QC5_N6QkXnvX7iHDk6u-KpQlDLHOU41aoOo5oPrih-4s31XcohqiSA1PjKQ-uluHG-TL8xTnwXvXwCOe0_pdTBOuNrkD/s1600/077.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;142&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXF9bo8U8jFiNSab_yAhDc8LVD5RiwNmwrM5sHG3z-jMHd3EH7QC5_N6QkXnvX7iHDk6u-KpQlDLHOU41aoOo5oPrih-4s31XcohqiSA1PjKQ-uluHG-TL8xTnwXvXwCOe0_pdTBOuNrkD/s320/077.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
送信を確認する画面が表示される。&lt;br /&gt;
&lt;hr /&gt;
&lt;hr /&gt;
&lt;b&gt;受信側の設定&lt;/b&gt;&lt;br /&gt;
JMStudio&amp;nbsp;をもう一回起動させる。&lt;br /&gt;
File から Open RTP Session..をクリックする。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP4NwvWsB-fQ6Q3ZZ3BBqlfvZ3nTyMOkCWYW1DSyQqVqZcgsgGDKRuplErBuGEjD2f3NJPunTIc-fpC-3qzobb6LNBWbVYRMxSwCUo0mninWjY4HjvQ_cqBzaLi2Td3HFgCkNR-BKIG2P0/s1600/078.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP4NwvWsB-fQ6Q3ZZ3BBqlfvZ3nTyMOkCWYW1DSyQqVqZcgsgGDKRuplErBuGEjD2f3NJPunTIc-fpC-3qzobb6LNBWbVYRMxSwCUo0mninWjY4HjvQ_cqBzaLi2Td3HFgCkNR-BKIG2P0/s1600/078.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;hr /&gt;
アドレスを入力して Open をクリックする。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxcH4YCyTOq5vuB0N4WEO44PkAd_sEf74Ls4GrLvLppXOf6kdlDAzOtuT2HMCxZJhJ5M1wdddNyGS5dWpCz_HYgLe9rZffuhY9AysZSzlMrh8bIIJjworQ0jlyjdPi86_LrDa7Y66kQP2C/s1600/079.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxcH4YCyTOq5vuB0N4WEO44PkAd_sEf74Ls4GrLvLppXOf6kdlDAzOtuT2HMCxZJhJ5M1wdddNyGS5dWpCz_HYgLe9rZffuhY9AysZSzlMrh8bIIJjworQ0jlyjdPi86_LrDa7Y66kQP2C/s1600/079.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;hr /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEFxwoijFDRh6F0IwxWJj_oBBH2NG04v81jE2UtpVehiW68UT15AVHJby8aMgnGZSWiUWkIjRfsP7bcqtLby4t2Ih-ws91T4RcVZgmKRKxmw_SKHofRx7g5sXJOcMX5ShThbdRbDg1Umf3/s1600/080.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;288&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEFxwoijFDRh6F0IwxWJj_oBBH2NG04v81jE2UtpVehiW68UT15AVHJby8aMgnGZSWiUWkIjRfsP7bcqtLby4t2Ih-ws91T4RcVZgmKRKxmw_SKHofRx7g5sXJOcMX5ShThbdRbDg1Umf3/s320/080.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
送られた画像が表示された。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/3647325166790834247/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/07/jmf.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/3647325166790834247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/3647325166790834247'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/07/jmf.html' title='ライブ配信テスト:JMF'/><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="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJqf6U7ichKmRIA7sDOMWM-TsFONee0VISu85daun-nFJj1rByCXSbToMFJOtlSjUEAx3-qFoCeOQe9_wgkx6z_XUBp_Hjj3-ofddOpbUK_1B-Qyn9Iwg8VQHvSuUCRa_BURnRkiCNMMX2/s72-c/070.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979839458424143226.post-199000445218804842</id><published>2012-07-03T01:21:00.001+09:00</published><updated>2012-07-03T02:13:29.028+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JMF"/><title type='text'>javaでUSBカメラを使う:JMF</title><content type='html'>JMF をインストールしたときに入っている、JMStudio でUSBカメラが利用できるか確認してみる。&lt;br /&gt;
&lt;br /&gt;
JMStudio&amp;nbsp;を起動させる。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP5Qi6CGh96I71OYqxiS773C6NhpGchN_WLiqdf6Dsbf8Vag_1XBZLjVmrZM3HVIe3STFnYWx7bTvyyZljfZ4-zz2KNKEfHYYfC8m2FsUDneWNTsmv6uBaCi1nYT0p5__djzFyJV8r6-id/s1600/065.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP5Qi6CGh96I71OYqxiS773C6NhpGchN_WLiqdf6Dsbf8Vag_1XBZLjVmrZM3HVIe3STFnYWx7bTvyyZljfZ4-zz2KNKEfHYYfC8m2FsUDneWNTsmv6uBaCi1nYT0p5__djzFyJV8r6-id/s1600/065.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;hr /&gt;
ファイルから Cupture を選択する&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAOillxIEQzeyrosMzwfWXZnWg83bRm7EBxMC7QMd0pnvCwwegzGxaKSAAvL3eGQSKaShyphenhyphen01I2xUqAvFxrnWbBBcapRljKgbf9oBcmRlw5jVyvu3yCRvvbJD0sjP6FlQ8rPMjspK68EtCC/s1600/066.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAOillxIEQzeyrosMzwfWXZnWg83bRm7EBxMC7QMd0pnvCwwegzGxaKSAAvL3eGQSKaShyphenhyphen01I2xUqAvFxrnWbBBcapRljKgbf9oBcmRlw5jVyvu3yCRvvbJD0sjP6FlQ8rPMjspK68EtCC/s1600/066.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;hr /&gt;
OKをクリックする。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCjrWheO89DivFG9idqrh2EM6RiHMGrs4hObeRgmAuWFoW8R-dDJQoMFhOlnEoyT-GcvVrZP9xgxGAC2VJn6xNH0Z6fRjoMU3jgHnfCo3EZDhy1C33yUHrwjcOVzCgjShLVRw6s8XSq5AT/s1600/067.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCjrWheO89DivFG9idqrh2EM6RiHMGrs4hObeRgmAuWFoW8R-dDJQoMFhOlnEoyT-GcvVrZP9xgxGAC2VJn6xNH0Z6fRjoMU3jgHnfCo3EZDhy1C33yUHrwjcOVzCgjShLVRw6s8XSq5AT/s320/067.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;hr /&gt;
USBカメラの映像が表示される&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEhKRXTRQOBaik_UgxcwkemR3VkgcE_Q-YFhgG06LcCN2GNWx-i1e4ovJtQOarEM4YjkTMZxtPxGG1TmnMAmKVQF_eJlNPhelD6rUlsDUJXoOSCi9pOWEde2f941ebOScoxBtQMh01xwI1/s1600/068.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEhKRXTRQOBaik_UgxcwkemR3VkgcE_Q-YFhgG06LcCN2GNWx-i1e4ovJtQOarEM4YjkTMZxtPxGG1TmnMAmKVQF_eJlNPhelD6rUlsDUJXoOSCi9pOWEde2f941ebOScoxBtQMh01xwI1/s320/068.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;hr /&gt;
USBカメラが利用出来る事が確認できたので、今度はJava プログラムから利用してみる。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;import javax.media.*;
import javax.swing.*;

public class jmf {
    public static void main(String args[]) throws Exception {
        JFrame frame = new JFrame(&quot;ImageView&quot;);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Player player = Manager.createRealizedPlayer(new MediaLocator(&quot;vfw://0&quot;));
        frame.setBounds(100, 100, 640, 480);
        frame.getContentPane().add(player.getVisualComponent());
        frame.setVisible(true);
        player.start();
    }
}
&lt;/pre&gt;
&lt;br /&gt;
Eclipseにjar追加
C:\Program Files (x86)\JMF2.1.1e\lib　の中のjar ファイルをEclipseの
メニューのプロジェクト-&amp;gt;プロパティー-&amp;gt;Java のビルド・パス-&amp;gt;ライブラリの外部Jaｒの追加ボタンから追加する。&lt;br /&gt;
&lt;br /&gt;
プログラムを実行すると、カメラ映像が表示される。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn0HoqnlawIPgR-ba5Fc4e5yz6XD27yczB7D0OTcBk1xAgXSLF38I6BkackKxZUovuCGHUYLQyWMtDQmSCEI4iQKAGIHJGCwwzt-zBD2mPYaA2laEYV7vbi0-7QNCa1pdRPbE9G-hmShVG/s1600/069.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn0HoqnlawIPgR-ba5Fc4e5yz6XD27yczB7D0OTcBk1xAgXSLF38I6BkackKxZUovuCGHUYLQyWMtDQmSCEI4iQKAGIHJGCwwzt-zBD2mPYaA2laEYV7vbi0-7QNCa1pdRPbE9G-hmShVG/s320/069.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/199000445218804842/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/07/javausbjmf.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/199000445218804842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/199000445218804842'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/07/javausbjmf.html' title='javaでUSBカメラを使う:JMF'/><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="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP5Qi6CGh96I71OYqxiS773C6NhpGchN_WLiqdf6Dsbf8Vag_1XBZLjVmrZM3HVIe3STFnYWx7bTvyyZljfZ4-zz2KNKEfHYYfC8m2FsUDneWNTsmv6uBaCi1nYT0p5__djzFyJV8r6-id/s72-c/065.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979839458424143226.post-5686437824195920163</id><published>2012-07-01T19:03:00.000+09:00</published><updated>2012-07-03T02:13:29.033+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JMF"/><title type='text'>JMFをWindows 7,64bit,Eclipseでインストール</title><content type='html'>&lt;b&gt;1.&lt;/b&gt;&lt;b style=&quot;background-color: white;&quot;&gt;jdk 32bit版のインストール&lt;/b&gt;&lt;br /&gt;
すでに64bit版がインストールしている場合でも、インストールする。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2.JMFをダウンロードしてくる。&lt;/b&gt;&lt;br /&gt;
ダウンロードサイト：&lt;a href=&quot;http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-java-client-419417.html#7372-jmf-2.1.1e-oth-JPR&quot;&gt;http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-java-client-419417.html#7372-jmf-2.1.1e-oth-JPR&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ダウンロードしたファイル：jmf-2_1_1e-windows-i586.exe&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ダウンロードしたファイルをダブルクリックしてインストール。&lt;br /&gt;
解凍からインストールに進まない場合は、jdk 32bitのインストールが完了していない場合があります。&lt;br /&gt;
&lt;br /&gt;
インストールが完了したらデスクトップにJMStudioのアイコンが表示される。&lt;br /&gt;
&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHLvt9n4WMPFQTB-uIdIyEKQiV3q05IcdHKIhM3B107kcBoy8An1W2mRE-knYN54aBS9znRc6J7ZRwbfSK8PLeRcnYO8KXmAQp8oAZLShmiV21iLIYYD2e-066BMgQDA7nZPleyCGrXAAw/s1600/064.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHLvt9n4WMPFQTB-uIdIyEKQiV3q05IcdHKIhM3B107kcBoy8An1W2mRE-knYN54aBS9znRc6J7ZRwbfSK8PLeRcnYO8KXmAQp8oAZLShmiV21iLIYYD2e-066BMgQDA7nZPleyCGrXAAw/s1600/064.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3.Eclipseにjar追加&lt;/b&gt;&lt;br /&gt;
C:\Program Files (x86)\JMF2.1.1e\lib　の中のjar ファイルをEclipseの&lt;br /&gt;
メニューのプロジェクト-&amp;gt;プロパティー-&amp;gt;Java のビルド・パス-&amp;gt;ライブラリの外部Jaｒの追加ボタンから追加する。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/5686437824195920163/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/07/jmfwindows-764biteclipse.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/5686437824195920163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/5686437824195920163'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/07/jmfwindows-764biteclipse.html' title='JMFをWindows 7,64bit,Eclipseでインストール'/><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="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHLvt9n4WMPFQTB-uIdIyEKQiV3q05IcdHKIhM3B107kcBoy8An1W2mRE-knYN54aBS9znRc6J7ZRwbfSK8PLeRcnYO8KXmAQp8oAZLShmiV21iLIYYD2e-066BMgQDA7nZPleyCGrXAAw/s72-c/064.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979839458424143226.post-140632571896517096</id><published>2012-06-13T13:46:00.002+09:00</published><updated>2012-06-13T13:47:20.181+09:00</updated><title type='text'>テーブルの作成:Java Sqlite</title><content type='html'>//テーブルを作成&lt;br /&gt;
stmt.execute( &quot;create table data( id INTEGER )&quot; );&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
//テーブルが無い場合に作成&lt;br /&gt;
stmt.execute(&quot;create table if not exists data ( id INTEGER )&quot;);&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/140632571896517096/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/06/java-sqlite.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/140632571896517096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/140632571896517096'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/06/java-sqlite.html' title='テーブルの作成:Java Sqlite'/><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-1979839458424143226.post-8189203643442486581</id><published>2012-06-12T07:05:00.000+09:00</published><updated>2012-06-12T07:05:47.699+09:00</updated><title type='text'>サーバソケット</title><content type='html'>&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;
import java.io.*;
import java.net.*;

public class echoServer {
    public static void main(String args[]) {
        // ソケットや入出力用のストリームの宣言
        ServerSocket echoServer = null;
        Socket clientSocket = null;
        
        String line;
        BufferedReader is;
        PrintStream os;
        
        // ポート9999番を開く
        try {
         //待ち受けポートを指定して新しいサーバソケットを生成しています。
            echoServer = new ServerSocket(9999);
            System.out.println(&quot;EchoServerが起動しました(port=&quot; + echoServer.getLocalPort() + &quot;)&quot;);
            
            //acceptメソッドを呼び出し、クライアントからの接続待機状態に入ります。クライアントからの接続要求があると、socketにはクライアントとの通信に利用できるSocketのインスタンスが代入されます。
            clientSocket = echoServer.accept();
            System.out.println(&quot;接続されました &quot;+ clientSocket.getRemoteSocketAddress() );
            
            is = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
            os = new PrintStream(clientSocket.getOutputStream());

            // クライアントからのメッセージを待ち、受け取ったメッセージをそのまま返す
            while ( (line = is.readLine()) != null ) {
                System.out.println(&quot;受信: &quot; + line);
                os.println(line);
                System.out.println(&quot;送信: &quot; + line);
              }
        }
        catch (IOException e) {
            System.out.println(e);
        }
        
    }
}
&lt;/pre&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;
import java.io.*;
import java.net.*;

public class echoClient {
    public static void main(String[] args) {
        //　ソケットや入出力用のストリームの宣言
        Socket echoSocket = null;
        DataOutputStream os = null;
        BufferedReader is = null;

        // ポート9999番を開く
        try {
            echoSocket = new Socket(&quot;localhost&quot;, 9999);
            os = new DataOutputStream(echoSocket.getOutputStream());
            is = new BufferedReader(new InputStreamReader(echoSocket.getInputStream()));
        } catch (UnknownHostException e) {
            System.err.println(&quot;Don&#39;t know about host: localhost&quot;);
        } catch (IOException e) {
            System.err.println(&quot;Couldn&#39;t get I/O for the connection to: localhost&quot;);
        }

        // サーバーにメッセージを送る
        if (echoSocket != null &amp;&amp; os != null &amp;&amp; is != null) {
            try {
                // メッセージを送ります
                os.writeBytes(&quot;HELLO\n&quot;);

                // サーバーからのメッセージを受け取り画面に表示します
                String responseLine;
                if ((responseLine = is.readLine()) != null) {
                    System.out.println(&quot;Server: &quot; + responseLine);
                }

                // 開いたソケットなどをクローズ
                os.close();
                is.close();
                echoSocket.close();
            } catch (UnknownHostException e) {
                System.err.println(&quot;Trying to connect to unknown host: &quot; + e);
            } catch (IOException e) {
                System.err.println(&quot;IOException: &quot; + e);
            }
        }
    }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/8189203643442486581/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/06/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/8189203643442486581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/8189203643442486581'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/06/blog-post.html' title='サーバソケット'/><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-1979839458424143226.post-8207938313396245472</id><published>2012-05-26T12:43:00.000+09:00</published><updated>2013-08-14T12:51:32.494+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQLite"/><title type='text'>SQLlite:グループ化</title><content type='html'>検索対象データベース&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikq8UDzuuV7iHueWxh3zBWQjS_LJyry1St6T6O7bx6dFo7qUvE4R8mlwsajtJvf58IUQxxEM41aUQ5btmTS_ZihFyqZiwGKVc05qMouIQMkT0Jqq5fvmwKCklRCHoQZgIKws5VMw-uPk5r/s1600/011.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikq8UDzuuV7iHueWxh3zBWQjS_LJyry1St6T6O7bx6dFo7qUvE4R8mlwsajtJvf58IUQxxEM41aUQ5btmTS_ZihFyqZiwGKVc05qMouIQMkT0Jqq5fvmwKCklRCHoQZgIKws5VMw-uPk5r/s320/011.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;集計関数&lt;/b&gt;&lt;br /&gt;
MAX　最大値&lt;br /&gt;
MIN　最小値&lt;br /&gt;
AVG　平均値&lt;br /&gt;
COUNT　データの個数
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;合計(Sum)&lt;/b&gt;&lt;br /&gt;
name別にpriceの合計を計算して表示&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;ResultSet rs = stmt.executeQuery(&quot;SELECT name,Sum(name) FROM data GROUP BY name &quot;); 

while (rs.next()) {
 System.out.println(&quot;name = &quot; + rs.getString(&quot;name&quot;));
 System.out.println(&quot;price = &quot; + rs.getInt(2));
}
&lt;/pre&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
name = いちご&lt;br /&gt;
price = 110&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 201&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;データの個数(Count)&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;ResultSet rs = stmt.executeQuery(&quot;SELECT name,Count(name) FROM data GROUP BY name &quot;);

while (rs.next()) {
 System.out.println(&quot;name = &quot; + rs.getString(&quot;name&quot;));
 System.out.println(&quot;count = &quot; + rs.getInt(2));
}
&lt;/pre&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
name = いちご&lt;br /&gt;
count= 1&lt;br /&gt;
name = りんご&lt;br /&gt;
count= 2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;複数の集計関数を指定&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;ResultSet rs = stmt.executeQuery(&quot;SELECT name,Sum(price),Avg(price) FROM data GROUP BY name &quot;);

while (rs.next()) {
 System.out.println(&quot;name = &quot; + rs.getString(&quot;name&quot;));
 System.out.println(&quot;合計 = &quot; + rs.getInt(2));
 System.out.println(&quot;平均 = &quot; + rs.getFloat(3));
}
&lt;/pre&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
name = いちご&lt;br /&gt;
合計 = 110&lt;br /&gt;
平均 = 110.0&lt;br /&gt;
name = りんご&lt;br /&gt;
合計 = 201&lt;br /&gt;
平均 = 100.5&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;列名の指定(AS)&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;ResultSet rs = stmt.executeQuery(&quot;SELECT name,Sum(price) AS &#39;合計&#39; FROM data GROUP BY name &quot;);

while (rs.next()) {
 System.out.println(&quot;name = &quot; + rs.getString(&quot;name&quot;));
 System.out.println(&quot;合計 = &quot; + rs.getInt(&quot;合計&quot;));
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;特定の集計行のみの表示(HAVING)&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;ResultSet rs = stmt.executeQuery(&quot;SELECT name,Sum(price) AS &#39;合計&#39; FROM data GROUP BY name HAVING Sum(price) &amp;gt; 200 &quot;);

while (rs.next()) {
 System.out.println(&quot;name = &quot; + rs.getString(&quot;name&quot;));
 System.out.println(&quot;合計 = &quot; + rs.getInt(&quot;合計&quot;));
}
&lt;/pre&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
name = りんご&lt;br /&gt;
合計 = 201&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/8207938313396245472/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/05/sqllite_6285.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/8207938313396245472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/8207938313396245472'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/05/sqllite_6285.html' title='SQLlite:グループ化'/><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="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikq8UDzuuV7iHueWxh3zBWQjS_LJyry1St6T6O7bx6dFo7qUvE4R8mlwsajtJvf58IUQxxEM41aUQ5btmTS_ZihFyqZiwGKVc05qMouIQMkT0Jqq5fvmwKCklRCHoQZgIKws5VMw-uPk5r/s72-c/011.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979839458424143226.post-3488060667176963878</id><published>2012-05-26T12:16:00.000+09:00</published><updated>2013-08-14T12:50:50.101+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQLite"/><title type='text'>SQLlite:並べ替え</title><content type='html'>&lt;b&gt;ORDER BY句&lt;/b&gt;&lt;br /&gt;
カラム名を指定して並べ替え&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data ORDER BY price &quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 1&lt;br /&gt;
date = 5/25&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 100&lt;br /&gt;
id = 3&lt;br /&gt;
date = 5/23&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 101&lt;br /&gt;
id = 2&lt;br /&gt;
date = 5/24&lt;br /&gt;
name = いちご&lt;br /&gt;
price = 110&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ORDER BY句　昇順&lt;/b&gt;&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data ORDER BY price ASC &quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 1&lt;br /&gt;
date = 5/25&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 100&lt;br /&gt;
id = 3&lt;br /&gt;
date = 5/23&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 101&lt;br /&gt;
id = 2&lt;br /&gt;
date = 5/24&lt;br /&gt;
name = いちご&lt;br /&gt;
price = 110&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ORDER BY句　降順&lt;/b&gt;&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data ORDER BY price DESC &quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 2&lt;br /&gt;
date = 5/24&lt;br /&gt;
name = いちご&lt;br /&gt;
price = 110&lt;br /&gt;
id = 3&lt;br /&gt;
date = 5/23&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 101&lt;br /&gt;
id = 1&lt;br /&gt;
date = 5/25&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 100&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ORDER BY句　複数カラムの指定&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data ORDER BY price,id &quot;);&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
指定を省略した場合は昇順&lt;/div&gt;
&lt;div&gt;
text型とimage型の列は指定できない。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/3488060667176963878/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/05/sqllite_26.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/3488060667176963878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/3488060667176963878'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/05/sqllite_26.html' title='SQLlite:並べ替え'/><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-1979839458424143226.post-957477874140364177</id><published>2012-05-25T10:18:00.002+09:00</published><updated>2013-08-14T12:50:18.834+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQLite"/><title type='text'>SQLlite:検索</title><content type='html'>検索対象のデータベース&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikq8UDzuuV7iHueWxh3zBWQjS_LJyry1St6T6O7bx6dFo7qUvE4R8mlwsajtJvf58IUQxxEM41aUQ5btmTS_ZihFyqZiwGKVc05qMouIQMkT0Jqq5fvmwKCklRCHoQZgIKws5VMw-uPk5r/s1600/011.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikq8UDzuuV7iHueWxh3zBWQjS_LJyry1St6T6O7bx6dFo7qUvE4R8mlwsajtJvf58IUQxxEM41aUQ5btmTS_ZihFyqZiwGKVc05qMouIQMkT0Jqq5fvmwKCklRCHoQZgIKws5VMw-uPk5r/s320/011.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;テーブルのデータ表示&lt;/b&gt;&lt;br /&gt;
ResultSet rs = stmt.executeQuery( &quot;select * from data&quot; );&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
表示：&lt;/div&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;Class.forName(&quot;org.sqlite.JDBC&quot;);
Connection connection = null;
// データベースに接続 なければ作成される
String databaseFullPass = &quot;jdbc:sqlite:&quot; + &quot;E:/yamato/tvData/test.db&quot;;

connection = DriverManager.getConnection( databaseFullPass );
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery( &quot;select * from data&quot;);

while( rs.next() ) {
    System.out.println(&quot;id = &quot; + rs.getInt(&quot;id&quot;));
    System.out.println(&quot;date = &quot; + rs.getString(&quot;date&quot;));
    System.out.println(&quot;name = &quot; + rs.getString(&quot;name&quot;));
　　System.out.println(&quot;price = &quot; + rs.getInt(&quot;price&quot;));
}
&lt;/pre&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 1&lt;br /&gt;
date = 5/25&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 100&lt;br /&gt;
id = 2&lt;br /&gt;
date = 5/24&lt;br /&gt;
name = いちご&lt;br /&gt;
price = 110&lt;br /&gt;
id = 3&lt;br /&gt;
date = 5/23&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 101&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;WHERE句の使い方&lt;/b&gt;&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data WHERE name = &#39;りんご&#39;&quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 1&lt;br /&gt;
date = 5/25&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 100&lt;br /&gt;
id = 3&lt;br /&gt;
date = 5/23&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 101&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;WHERE句+AND&lt;/b&gt;&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data WHERE name = &#39;りんご&#39; AND price = &#39;101&#39;&quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 3&lt;br /&gt;
date = 5/23&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 101&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;WHERE句+OR&lt;/b&gt;&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data WHERE name = &#39;りんご&#39; OR price = &#39;110&#39;&quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 1&lt;br /&gt;
date = 5/25&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 100&lt;br /&gt;
id = 2&lt;br /&gt;
date = 5/24&lt;br /&gt;
name = いちご&lt;br /&gt;
price = 110&lt;br /&gt;
id = 3&lt;br /&gt;
date = 5/23&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 101&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;WHERE句+NOT&lt;/b&gt;&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data WHERE NOT name = &#39;りんご&#39; &quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 2&lt;br /&gt;
date = 5/24&lt;br /&gt;
name = いちご&lt;br /&gt;
price = 110&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;WHERE句+比較演算子&lt;/b&gt;&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data WHERE name = &#39;りんご&#39; AND price = &#39;100&#39; &amp;nbsp;&quot;);&lt;br /&gt;
&lt;br /&gt;
priceが50以上101未満のデータを抽出&lt;br /&gt;
priceのデータ型がINTEGERでないと範囲指定できない。&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data WHERE name = &#39;りんご&#39; AND price &amp;gt; 50 and price &amp;lt; 101 &quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 1&lt;br /&gt;
date = 5/25&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 100&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;WHERE句+&lt;/b&gt;&lt;b&gt;BETWEEN条件&lt;/b&gt;&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data WHERE price BETWEEN 50 and 100 &quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 1&lt;br /&gt;
date = 5/25&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 100&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;IN条件&lt;/b&gt;
&lt;br /&gt;
指定した値のリストにマッチするか&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data WHERE price IN ( 100 , 110) &quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 1&lt;br /&gt;
date = 5/25&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 100&lt;br /&gt;
id = 2&lt;br /&gt;
date = 5/24&lt;br /&gt;
name = いちご&lt;br /&gt;
price = 110&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;LIKE&lt;/b&gt;&lt;b&gt;条件&lt;/b&gt;&lt;br /&gt;
文字の検索条件を指定する。&lt;br /&gt;
%は「任意の文字数の任意の文字」&lt;br /&gt;
_は「1文字の任意の文字」,_は一文字にマッチ&lt;br /&gt;
&lt;br /&gt;
__  ２文字の任意の文字列&lt;br /&gt;
a__b    aで始まりbで終わる4文字の文字列&lt;br /&gt;
&lt;pre class=&quot;fixmid&quot;&gt;&lt;/pre&gt;
&lt;br /&gt;
例：&lt;br /&gt;
name LIKE &#39;a%&#39;は、nameがaで始まる任意の長さの文字列&lt;br /&gt;
name LIKE &#39;a%b&#39;は、nameがaで始まりbで終わる任意の長さの文字列&lt;br /&gt;
&lt;br /&gt;
name LIKE &#39;a_&#39;は、nameがaで始まる2文字の文字列&lt;br /&gt;
name LIKE &#39;a_%b&#39;は、nameが aで始まりbで終わる3文字以上の任意の長さの文字列&lt;br /&gt;
&lt;br /&gt;
ResultSet rs = stmt.executeQuery(&quot;SELECT * FROM data WHERE name LIKE &#39;り%&#39; &quot;);&lt;br /&gt;
&lt;br /&gt;
結果：&lt;br /&gt;
id = 1&lt;br /&gt;
date = 5/25&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 100&lt;br /&gt;
id = 3&lt;br /&gt;
date = 5/23&lt;br /&gt;
name = りんご&lt;br /&gt;
price = 101&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/957477874140364177/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/05/sqllite.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/957477874140364177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/957477874140364177'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/05/sqllite.html' title='SQLlite:検索'/><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="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikq8UDzuuV7iHueWxh3zBWQjS_LJyry1St6T6O7bx6dFo7qUvE4R8mlwsajtJvf58IUQxxEM41aUQ5btmTS_ZihFyqZiwGKVc05qMouIQMkT0Jqq5fvmwKCklRCHoQZgIKws5VMw-uPk5r/s72-c/011.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979839458424143226.post-3210760764827236815</id><published>2012-05-24T10:29:00.003+09:00</published><updated>2012-05-24T10:29:59.349+09:00</updated><title type='text'>javacコマンドで文字コード指定</title><content type='html'>&lt;br /&gt;
&lt;pre class=&quot;syntax-highlight&quot;&gt;D:\lab\&lt;span class=&quot;highlight&quot;&gt;Java&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;highlight&quot;&gt;java&lt;/span&gt;c &lt;span class=&quot;synSpecial&quot;&gt;-encoding&lt;/span&gt; UTF&lt;span class=&quot;synConstant&quot;&gt;-8&lt;/span&gt; Test.&lt;span class=&quot;highlight&quot;&gt;java&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;syntax-highlight&quot;&gt;&lt;span class=&quot;highlight&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;syntax-highlight&quot;&gt;&lt;span class=&quot;highlight&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;syntax-highlight&quot;&gt;&lt;span class=&quot;highlight&quot;&gt;:16: エラー: この文字は、エンコーディングMS932にマップできません
               // TODO 閾ｪ蜍慕函謌舌＆繧後◆ catch 繝悶Ο繝?け&lt;/span&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/3210760764827236815/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/05/javac.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/3210760764827236815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/3210760764827236815'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/05/javac.html' title='javacコマンドで文字コード指定'/><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-1979839458424143226.post-8274285817834143678</id><published>2012-05-22T10:32:00.001+09:00</published><updated>2012-05-22T10:35:19.140+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="文字列操作"/><title type='text'>カッコで囲まれている文字の取得</title><content type='html'>&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;String regex = &quot;\\((.+?)\\)&quot;;//正規表現で指定
String target = &quot;(abc)def(ghi)jkl&quot;;
List&amp;lt;String&amp;gt; omaewamoshindeiru = new ArrayList&amp;lt;String&amp;gt;();
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(target);
while (matcher.find()) {
    omaewamoshindeiru.add(matcher.group(1));
}
System.out.println( omaewamoshindeiru.get(0) );//abc
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/8274285817834143678/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/05/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/8274285817834143678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/8274285817834143678'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/05/blog-post.html' title='カッコで囲まれている文字の取得'/><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-1979839458424143226.post-351381575688976370</id><published>2012-05-17T17:09:00.000+09:00</published><updated>2012-05-17T17:09:35.117+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WebDriver"/><title type='text'>WebDriver：特定のリンクアドレスを取得する</title><content type='html'>gooで始まるリンクアドレスを取得する。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

public class firefoxTest {

 public static void main(String[] args) {

  WebDriver driver = new HtmlUnitDriver();

  // URLを開く
  driver.get(&quot;http://127.0.0.1/~yamato/fx7/WebDriverTest/index.html&quot;);

  // 検索結果のURLを取得
  WebElement link = driver.findElement(By.partialLinkText(&quot;goo&quot;));
  System.out.println(link.getAttribute(&quot;href&quot;));
 }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
検索結果：
&lt;br /&gt;
https://www.google.co.jp/&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/351381575688976370/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/05/webdriver_95.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/351381575688976370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/351381575688976370'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/05/webdriver_95.html' title='WebDriver：特定のリンクアドレスを取得する'/><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-1979839458424143226.post-1036687494866085704</id><published>2012-05-17T16:23:00.001+09:00</published><updated>2012-05-18T07:50:32.179+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WebDriver"/><title type='text'>WebDriver：ページのリンクを取得する</title><content type='html'>&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

public class firefoxTest {

 public static void main(String[] args) {

  WebDriver driver = new HtmlUnitDriver();

  // URLを開く
  driver.get(&quot;http://127.0.0.1/~yamato/fx7/WebDriverTest/index.html&quot;);

  // Aタグを取得
  List&amp;lt;WebElement&amp;gt; cheese = driver.findElements(By.tagName(&amp;quot;a&amp;quot;));

  // 取得した要素の0番目のリンクアドレス
  System.out.println(cheese.get(0).getAttribute(&quot;href&quot;));
  
  // 取得した要素の0番目のリンクテキスト
  System.out.println(cheese.get(0).getText());
 }
}

&lt;/webelement&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/1036687494866085704/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/05/webdriver_4994.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/1036687494866085704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/1036687494866085704'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/05/webdriver_4994.html' title='WebDriver：ページのリンクを取得する'/><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-1979839458424143226.post-4216663089550889142</id><published>2012-05-17T15:27:00.001+09:00</published><updated>2012-05-17T15:27:57.951+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WebDriver"/><title type='text'>WebDriver：IDを指定してテキストを取得する</title><content type='html'>&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

public class firefoxTest {

 public static void main(String[] args) {

  // ブラウザ(Firefox)を起動
  // WebDriver driver = new FirefoxDriver();
  WebDriver driver = new HtmlUnitDriver();

  // URLを開く
  driver.get(&quot;http://127.0.0.1/~yamato/fx7/WebDriverTest/index.html&quot;);

  WebElement addDynamicElement = driver.findElement(By.id(&quot;add&quot;));

  String actual = addDynamicElement.getText();
  
  System.out.println( actual );

 }
}

&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/4216663089550889142/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/05/webdriverid.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/4216663089550889142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/4216663089550889142'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/05/webdriverid.html' title='WebDriver：IDを指定してテキストを取得する'/><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-1979839458424143226.post-8117513429393910886</id><published>2012-05-17T11:28:00.001+09:00</published><updated>2012-05-17T11:28:55.599+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WebDriver"/><title type='text'>WebDriver：ページのタイトル取得</title><content type='html'>&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

public class firefoxTest {

 public static void main(String[] args) {

  // ブラウザ(Firefox)を起動
  // WebDriver driver = new FirefoxDriver();
  WebDriver driver = new HtmlUnitDriver();

  // URLを開く
  driver.get(&quot;http://127.0.0.1/~yamato/fx7/WebDriverTest/index.html&quot;);

  System.out.println(driver.getTitle());

 }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/8117513429393910886/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/05/webdriver_17.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/8117513429393910886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/8117513429393910886'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/05/webdriver_17.html' title='WebDriver：ページのタイトル取得'/><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-1979839458424143226.post-2229468193066353311</id><published>2012-05-17T09:14:00.003+09:00</published><updated>2012-05-20T09:32:34.545+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WebDriver"/><title type='text'>WebDriver 準備</title><content type='html'>selenium-java-2.21.0.zip　をダウンロードする。&lt;br /&gt;
&lt;br /&gt;
解凍する。&lt;br /&gt;
selenium-java-2.21.0.jar　と&lt;br /&gt;
libs　フォルダのの中のファイルをプロジェクトのjavaビルドパスに追加する。&lt;br /&gt;
&lt;br /&gt;
参考&lt;br /&gt;
その他のhtmlテストツール&lt;br /&gt;
HtmlUnit&lt;br /&gt;
HttpUnit：：Httpプロトコルのテストを重視した作り&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/2229468193066353311/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/05/webdriver.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/2229468193066353311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/2229468193066353311'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/05/webdriver.html' title='WebDriver 準備'/><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-1979839458424143226.post-473733690760355046</id><published>2012-01-21T23:47:00.002+09:00</published><updated>2012-01-21T23:47:38.124+09:00</updated><title type='text'>名前の一括変更</title><content type='html'>&lt;br /&gt;名前の一括変更　：　Alt + Shift + R</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/473733690760355046/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/01/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/473733690760355046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/473733690760355046'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/01/blog-post.html' title='名前の一括変更'/><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-1979839458424143226.post-5992746792727393204</id><published>2012-01-21T22:04:00.003+09:00</published><updated>2012-03-13T12:46:12.529+09:00</updated><title type='text'>HTMLEditorKit 基本情報</title><content type='html'>一行ずつ処理するのに便利&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://java.sun.com/j2se/1.3/ja/docs/ja/api/javax/swing/text/html/HTMLEditorKit.html&quot;&gt;http://java.sun.com/j2se/1.3/ja/docs/ja/api/javax/swing/text/html/HTMLEditorKit.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
クラス HTMLEditorKit.ParserCallback&lt;br /&gt;
handleStartTag　　は、開始タグと終了タグを持つタグを取得する。
&lt;br /&gt;
handleEndTag　　　は、開始タグと終了タグを持つタグを取得する。
&lt;br /&gt;
handleSimpleTag　は、終了タグを持たないタグを取得する。
&lt;br /&gt;
handleText　　　　は、HTMLの文字列の取得・処理を行います。
&lt;br /&gt;
handleComment　　は、コメントを取得する。&lt;br /&gt;
handleEndOfLineString　は、ストリームの末尾を取得する。

&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;import javax.swing.text.*;
import javax.swing.text.html.*;
import javax.swing.text.html.parser.ParserDelegator;
import java.io.*;

public class HtmlParser{

 public static void main(String[] args){
  HtmlParser p = new HtmlParser();
  p.exec();
 }

 public void exec() {
  Reader reader;
  try {

   FileInputStream is = new FileInputStream(&quot;E:/html/text.html&quot;);
   InputStreamReader in = new InputStreamReader(is, &quot;SJIS&quot;);

   reader = new BufferedReader(in);

   MyParserCallback cb = new MyParserCallback();
   ParserDelegator pd = new ParserDelegator();
   pd.parse(reader, cb, true);
   reader.close();
  } catch (Exception e) {
   e.printStackTrace();
  }
 }

 class MyParserCallback extends HTMLEditorKit.ParserCallback {
  public void handleStartTag(HTML.Tag tag, MutableAttributeSet attr, int pos){
   System.out.println(&quot;スタートタグが呼ばれました&quot;);

  }
  public void handleText(char[] data, int pos) {
   System.out.println( new String(data) );
        }

  public void handleSimpleTag(HTML.Tag tag, MutableAttributeSet attr,int pos) {
   System.out.println(&quot;--------------  終了タグを持たないタグが呼ばれました&quot;);
  }
 }

}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://yamato-java.blogspot.com/feeds/5992746792727393204/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://yamato-java.blogspot.com/2012/01/htmleditorkit.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/5992746792727393204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979839458424143226/posts/default/5992746792727393204'/><link rel='alternate' type='text/html' href='http://yamato-java.blogspot.com/2012/01/htmleditorkit.html' title='HTMLEditorKit 基本情報'/><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></feed>