<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Simple example</title><link>https://sourceforge.net/p/redcomm/wiki/Simple%2520example/</link><description>Recent changes to Simple example</description><atom:link href="https://sourceforge.net/p/redcomm/wiki/Simple%20example/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 12 Dec 2011 13:40:20 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/redcomm/wiki/Simple%20example/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Simple example modified by Robin Altay</title><link>https://sourceforge.net/p/redcomm/wiki/Simple%2520example/</link><description>&lt;pre&gt;--- v8 
+++ v9 
@@ -123,4 +123,4 @@
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Thats it! You've now written your first application, which communicates with the serial port.
-You implemented your own *SerialPortReaderListener* to be notified when data is received. You we're also capable of writing the code that is needed to connect with the port through an configuration file.
+You implemented your own *SerialPortReaderListener* which is notified when data is received. You we're also capable of writing the code that is needed to connect with the port through an configuration file.
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Altay</dc:creator><pubDate>Mon, 12 Dec 2011 13:40:20 -0000</pubDate><guid>https://sourceforge.netd574530d7e76cdb0eb5e0e4f4ae52352f13eeb31</guid></item><item><title>WikiPage Simple example modified by Robin Altay</title><link>https://sourceforge.net/p/redcomm/wiki/Simple%2520example/</link><description>&lt;pre&gt;--- v7 
+++ v8 
@@ -42,8 +42,8 @@
 Now right click your project and select "Clean and build".
 
 After that right click the "redcomm_example" package and choose "New-&gt;JFrame Form". Click "finish".
-Insert some UI elements as shown below:
-fsdf
+Insert some GUI elements as shown below:
+![GUI layout](http://img6.imagebanana.com/img/6u6gembh/simple_example_gui.png)
 
 Open up the code of your JFrame. First you need to declare an attribute of type "SerialPort" and an boolean "connected".
 So put the following code in there:
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Altay</dc:creator><pubDate>Mon, 12 Dec 2011 13:31:14 -0000</pubDate><guid>https://sourceforge.net2c8af518a772f260230d8fca8e714983b2501dbb</guid></item><item><title>WikiPage Simple example modified by Robin Altay</title><link>https://sourceforge.net/p/redcomm/wiki/Simple%2520example/</link><description>&lt;pre&gt;--- v6 
+++ v7 
@@ -3,7 +3,7 @@
 
 In the following you will learn how to setup and write your first RedComm application in order to communicate with the serial port.
 
-Its assumed that you installed redcomm as stated here: [installation (windows)]
+Its assumed that you installed redcomm as stated here: [installation (windows)](https://sourceforge.net/p/redcomm/wiki/Installation%20%28Windows%29/)
 
 Now startup Netbeans and create a new "Java application". Uncheck the option "create main class" and click finish.
 First you need to add references to RxTx.jar and RedComm.jar. To do this right click on the "Libraries" node in your project structure and choose "Add JAR/Folder". Select "RxTx.jar" and click open. Do the same for "RedComm.jar".
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Altay</dc:creator><pubDate>Mon, 12 Dec 2011 13:28:44 -0000</pubDate><guid>https://sourceforge.net0291d857c187a70ee3df6af4c8bf055ac734a55f</guid></item><item><title>WikiPage Simple example modified by Robin Altay</title><link>https://sourceforge.net/p/redcomm/wiki/Simple%2520example/</link><description>&lt;pre&gt;--- v5 
+++ v6 
@@ -3,7 +3,7 @@
 
 In the following you will learn how to setup and write your first RedComm application in order to communicate with the serial port.
 
-Its assumed that you installed redcomm as stated here: [installation under windows]
+Its assumed that you installed redcomm as stated here: [installation (windows)]
 
 Now startup Netbeans and create a new "Java application". Uncheck the option "create main class" and click finish.
 First you need to add references to RxTx.jar and RedComm.jar. To do this right click on the "Libraries" node in your project structure and choose "Add JAR/Folder". Select "RxTx.jar" and click open. Do the same for "RedComm.jar".
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Altay</dc:creator><pubDate>Mon, 12 Dec 2011 13:28:20 -0000</pubDate><guid>https://sourceforge.net6af140357b05988e9e34468e194c6c6bc6c05a47</guid></item><item><title>WikiPage Simple example modified by Robin Altay</title><link>https://sourceforge.net/p/redcomm/wiki/Simple%2520example/</link><description>&lt;pre&gt;--- v4 
+++ v5 
@@ -107,5 +107,20 @@
             lblConnectionState.setForeground(Color.RED); // Set label color
             connected = false; // Now we're disconnected
         }
-    }                                                
+    }                       
+                         
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Now double click the "Send" button and paste this:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+private void btnSendActionPerformed(java.awt.event.ActionEvent evt) {                                        
+        if (connected) {
+            serialPort.write(txtTx.getText()); // Write data onto the serial port
+        }
+    }   
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Thats it! You've now written your first application, which communicates with the serial port.
+You implemented your own *SerialPortReaderListener* to be notified when data is received. You we're also capable of writing the code that is needed to connect with the port through an configuration file.
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Altay</dc:creator><pubDate>Mon, 12 Dec 2011 13:26:28 -0000</pubDate><guid>https://sourceforge.net866e8fb1bd892d7f71a6cf8c6a4a7ede7c136632</guid></item><item><title>WikiPage Simple example modified by Robin Altay</title><link>https://sourceforge.net/p/redcomm/wiki/Simple%2520example/</link><description>&lt;pre&gt;--- v3 
+++ v4 
@@ -70,41 +70,42 @@
 
 Double click your "Connect" Button and paste this code:
 
-:::java
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 private void tglButtonConnectActionPerformed(java.awt.event.ActionEvent evt) {                                                 
 
         if (tglButtonConnect.isSelected()) {
             try {
                 /*
                  * Connect to serial port with parameters from the specified 
                  * configuration file ("port.properties").
                  */
                 serialPort.connect("port.properties");
                 lblConnectionState.setText("Connected"); // Set label text.
                 lblConnectionState.setForeground(Color.GREEN); // Set label color.
                 /*
                  * Add TextArea txtRx to the list of observers.
                  * Everytime a new serial event will be generated txtRx will be 
                  * notified about that event and is able to handle the data e.g.
                  * display it.
                  */
                 serialPort.notifyOnEvent(txtRx);
-                connected = true; // Now we're connected to the com port.
+                connected = true; // Now we are connected to the com port.
             } catch (NoSuchPortException ex) {
                 Logger.getLogger(SimpleCom.class.getName()).log(Level.SEVERE, null, ex);
             } catch (PortInUseException ex) {
                 Logger.getLogger(SimpleCom.class.getName()).log(Level.SEVERE, null, ex);
             } catch (UnsupportedCommOperationException ex) {
                 Logger.getLogger(SimpleCom.class.getName()).log(Level.SEVERE, null, ex);
             } catch (IOException ex) {
                 Logger.getLogger(SimpleCom.class.getName()).log(Level.SEVERE, null, ex);
             } catch (TooManyListenersException ex) {
                 Logger.getLogger(SimpleCom.class.getName()).log(Level.SEVERE, null, ex);
             }
         } else {
             serialPort.disconnect(); // Disconnect from com port
             lblConnectionState.setText("Disconnected"); // Set label text
             lblConnectionState.setForeground(Color.RED); // Set label color
             connected = false; // Now we're disconnected
         }
     }                                                
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Altay</dc:creator><pubDate>Mon, 12 Dec 2011 13:21:55 -0000</pubDate><guid>https://sourceforge.net327806822e21970c2582e20f3fdaf2df0b5ffd9d</guid></item><item><title>WikiPage Simple example modified by Robin Altay</title><link>https://sourceforge.net/p/redcomm/wiki/Simple%2520example/</link><description>&lt;pre&gt;--- v2 
+++ v3 
@@ -70,6 +70,7 @@
 
 Double click your "Connect" Button and paste this code:
 
+:::java
 private void tglButtonConnectActionPerformed(java.awt.event.ActionEvent evt) {                                                 
 
         if (tglButtonConnect.isSelected()) {
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Altay</dc:creator><pubDate>Mon, 12 Dec 2011 13:21:06 -0000</pubDate><guid>https://sourceforge.net2b069901cf43e83ef2c3f1bb6e355cdd93b40da8</guid></item><item><title>WikiPage Simple example modified by Robin Altay</title><link>https://sourceforge.net/p/redcomm/wiki/Simple%2520example/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -1,0 +1,109 @@
+Simple example:
+===============
+
+In the following you will learn how to setup and write your first RedComm application in order to communicate with the serial port.
+
+Its assumed that you installed redcomm as stated here: [installation under windows]
+
+Now startup Netbeans and create a new "Java application". Uncheck the option "create main class" and click finish.
+First you need to add references to RxTx.jar and RedComm.jar. To do this right click on the "Libraries" node in your project structure and choose "Add JAR/Folder". Select "RxTx.jar" and click open. Do the same for "RedComm.jar".
+
+After setting up your application it's time to create some GUI.
+First of all create a new source code package. Right click "Source Packages" and choose "New-&gt;Java Package". Name it "redcomm_example" and click "finish".
+Now right click the new package and choose "New-&gt;Java Class". Name it "TextArea" and click "finish".
+*TextArea* will be a simple TextAre which will display the received data from the com port.
+Open up "TextArea.java" and put in this code:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+package redcomm_example;
+
+import altay.redcomm.SerialEvent;
+import altay.redcomm.SerialPortReaderListener;
+import javax.swing.JTextArea;
+
+/**
+ *
+ * @author Robin Altay
+ */
+public class TextArea extends JTextArea implements SerialPortReaderListener {
+
+    @Override
+    public void handleEvent(SerialEvent e) {
+        setText(new String(e.getData()));
+    }
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+*TextArea* extends *JTextArea*, because as stated above you want to implement an own TextArea, without the need to write the whole text managing stuff, swing behaviour etc. on your own. So your *TextArea* will basically behave like an normal *JTextArea*. 
+Next it is implementing *SerialPortReaderListener*. This will give you the possibility to handle incoming serial port events. In your *handleEvent(Serial event e)* Method you simply display the incoming data ("e.getData()") in the *TextArea*.
+
+Thats all for handling incoming data. As you see its very easy to implement data handling and you get a nice encapsulated Component, which manages itself. 
+
+Now right click your project and select "Clean and build".
+
+After that right click the "redcomm_example" package and choose "New-&gt;JFrame Form". Click "finish".
+Insert some UI elements as shown below:
+fsdf
+
+Open up the code of your JFrame. First you need to declare an attribute of type "SerialPort" and an boolean "connected".
+So put the following code in there:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+import altay.redcomm.SerialPort;
+
+/**
+ *
+ * @author Robin Altay
+ */
+public class NewJFrame extends javax.swing.JFrame {
+    private SerialPort serialPort;
+    private boolean connected = false;
+
+    /** Creates new form NewJFrame */
+    public NewJFrame() {
+        initComponents();
+        
+        serialPort = new SerialPort();
+    }
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Double click your "Connect" Button and paste this code:
+
+private void tglButtonConnectActionPerformed(java.awt.event.ActionEvent evt) {                                                 
+
+        if (tglButtonConnect.isSelected()) {
+            try {
+                /*
+                 * Connect to serial port with parameters from the specified 
+                 * configuration file ("port.properties").
+                 */
+                serialPort.connect("port.properties");
+                lblConnectionState.setText("Connected"); // Set label text.
+                lblConnectionState.setForeground(Color.GREEN); // Set label color.
+                /*
+                 * Add TextArea txtRx to the list of observers.
+                 * Everytime a new serial event will be generated txtRx will be 
+                 * notified about that event and is able to handle the data e.g.
+                 * display it.
+                 */
+                serialPort.notifyOnEvent(txtRx);
+                connected = true; // Now we're connected to the com port.
+            } catch (NoSuchPortException ex) {
+                Logger.getLogger(SimpleCom.class.getName()).log(Level.SEVERE, null, ex);
+            } catch (PortInUseException ex) {
+                Logger.getLogger(SimpleCom.class.getName()).log(Level.SEVERE, null, ex);
+            } catch (UnsupportedCommOperationException ex) {
+                Logger.getLogger(SimpleCom.class.getName()).log(Level.SEVERE, null, ex);
+            } catch (IOException ex) {
+                Logger.getLogger(SimpleCom.class.getName()).log(Level.SEVERE, null, ex);
+            } catch (TooManyListenersException ex) {
+                Logger.getLogger(SimpleCom.class.getName()).log(Level.SEVERE, null, ex);
+            }
+        } else {
+            serialPort.disconnect(); // Disconnect from com port
+            lblConnectionState.setText("Disconnected"); // Set label text
+            lblConnectionState.setForeground(Color.RED); // Set label color
+            connected = false; // Now we're disconnected
+        }
+    }                                                
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Altay</dc:creator><pubDate>Mon, 12 Dec 2011 13:20:44 -0000</pubDate><guid>https://sourceforge.net445017f9a508265bb405ab769d0ba82ba0868e82</guid></item><item><title>WikiPage Simple example modified by Robin Altay</title><link>https://sourceforge.net/p/redcomm/wiki/Simple%2520example/</link><description/><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Altay</dc:creator><pubDate>Mon, 12 Dec 2011 11:26:17 -0000</pubDate><guid>https://sourceforge.net03aadae5734a1c6b70854b74eb758fcafe66d7b8</guid></item></channel></rss>