<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
    <title type="html">Java Technology Fundamentals</title>
    <subtitle type="html">Learn about the Java programming language and platform, and how to create applications.</subtitle>
    <id>http://blogs.sun.com/JavaFundamentals/feed/entries/atom</id>
            
        <link rel="alternate" type="text/html" href="http://blogs.sun.com/JavaFundamentals/" />
        <updated>2009-03-30T14:32:14-07:00</updated>
    <generator uri="http://roller.apache.org" version="4.0.0.14u1 (BSC) (20090309015207)">Apache Roller Weblogger</generator>
        <link rel="self" href="http://feeds.feedburner.com/javatechfundamentals" type="application/atom+xml" /><entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/the_numbers_classes</id>
        <title type="html">The Numbers Classes</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/7mtpadHUdgs/the_numbers_classes" />
        <published>2009-01-07T10:02:20-08:00</published>
        <updated>2009-01-07T10:02:20-08:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="basics" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="developers" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="learning" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="numbers" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="primatives" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="students" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="young" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Working with numbers can be a large part of application programming.
Follow this tutorial to get familiar with the Numbers classes, and how
to work with numbers in your applications.</summary>
        <content type="html">&lt;p&gt;Working with numbers can be a large part of application programming. Follow this tutorial to get familiar with the Numbers classes, and how to work with numbers in your applications.&lt;/p&gt; 
  &lt;blockquote&gt;
When working with numbers, most of the time you use the primitive types in your code.
For example:

    
    
    &lt;blockquote&gt; 
      &lt;pre&gt;int i = 500;
float gpa = 3.65f;
byte mask = 0xff;
&lt;/pre&gt; 
    &lt;/blockquote&gt;
There are, however, reasons to use objects in place of primitives, and the 
Java platform provides &lt;i&gt;wrapper&lt;/i&gt; classes for each of the primitive data types. These 
classes &amp;quot;wrap&amp;quot; the primitive in an object. Often, the wrapping is done by the compiler—if 
you use a primitive where an object is expected, the compiler &lt;i&gt;boxes&lt;/i&gt; the primitive in its 
wrapper class for you. Similarly, if you use a number object when a primitive is expected, the compiler 
&lt;i&gt;unboxes&lt;/i&gt; the object for you.

    
    
    &lt;p&gt;
Here is an example of boxing and unboxing:
&lt;/p&gt; 
    &lt;blockquote&gt; 
      &lt;pre&gt;Integer x, y;
x = 12;
y = 15;
System.out.println(x+y);
&lt;/pre&gt; 
    &lt;/blockquote&gt;
When &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; are assigned integer values, the compiler boxes the integers because 
&lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; are integer objects. In the &lt;code&gt;println()&lt;/code&gt; statement, &lt;code&gt;x&lt;/code&gt; 
and &lt;code&gt;y&lt;/code&gt; are unboxed so that they can be added as integers.

    
    
    &lt;p&gt;
All of the
 numeric wrapper classes are subclasses of the abstract class &lt;code&gt;Number&lt;/code&gt;:

&lt;!-- figure --&gt; &lt;/p&gt;&lt;center&gt;&lt;img height="146" align="bottom" width="345" alt="The class hierarchy of Number." src="http://java.sun.com/docs/books/tutorial/figures/java/objects-numberHierarchy.gif" /&gt;&lt;/center&gt; 
    &lt;blockquote&gt;&lt;hr /&gt;&lt;b&gt;Note:&lt;/b&gt;&amp;nbsp;There are four other subclasses of &lt;code&gt;Number&lt;/code&gt; that are not discussed here. &lt;code&gt;BigDecimal&lt;/code&gt; and 
&lt;code&gt;BigInteger&lt;/code&gt; are used for high-precision calculations. &lt;code&gt;AtomicInteger&lt;/code&gt; and 
&lt;code&gt;AtomicLong&lt;/code&gt; are used for multi-threaded applications.
&lt;hr /&gt;&lt;/blockquote&gt;
There are three reasons that you might use a &lt;code&gt;Number&lt;/code&gt; object 
rather than a primitive:


    
    
    &lt;ol&gt; 
      &lt;li&gt;
As an argument of a method that expects an object (often used when manipulating collections 
of numbers).

        
        
        &lt;p&gt; &lt;/p&gt; 
      &lt;/li&gt; 
      &lt;li&gt;
To use constants defined by
the class, such as &lt;code&gt;MIN_VALUE&lt;/code&gt; and
&lt;code&gt;MAX_VALUE&lt;/code&gt;, that provide the upper and lower bounds of the data type.

        
        
        &lt;p&gt; &lt;/p&gt; 
      &lt;/li&gt; 
      &lt;li&gt;To use class methods for converting values to and from other primitive types,
for converting to and from strings, and for converting between number systems (decimal, octal, 
hexadecimal, binary).
&lt;/li&gt; 
    &lt;/ol&gt; 
    &lt;p&gt;

The following table lists the instance methods that all the subclasses of
the &lt;code&gt;Number&lt;/code&gt; class implement.
&lt;/p&gt; 
    &lt;p&gt; &lt;/p&gt; 
    &lt;table cellspacing="3" cellpadding="4" border="1" width="100%"&gt; &lt;caption&gt;&lt;b&gt;Methods Implemented by all Subclasses of Number&lt;/b&gt;&lt;/caption&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;th&gt;Method&lt;/th&gt; 
          &lt;th width="50%"&gt;Description&lt;/th&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;byte byteValue()&lt;/code&gt;&lt;br /&gt; &lt;code&gt;short shortValue()&lt;/code&gt;&lt;br /&gt; &lt;code&gt;int intValue()&lt;/code&gt;&lt;br /&gt; &lt;code&gt;long longValue()&lt;/code&gt;&lt;br /&gt; &lt;code&gt;float floatValue()&lt;/code&gt;&lt;br /&gt; &lt;code&gt;double doubleValue()&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Converts the value of this &lt;code&gt;Number&lt;/code&gt; object to the primitive
data type returned.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;
int compareTo(Byte anotherByte)
&lt;br /&gt;
int compareTo(Double anotherDouble)
&lt;br /&gt;
int compareTo(Float anotherFloat)
&lt;br /&gt;
int compareTo(Integer anotherInteger)
&lt;br /&gt;
int compareTo(Long anotherLong)
&lt;br /&gt;
int compareTo(Short anotherShort)
&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Compares this &lt;code&gt;Number&lt;/code&gt; object to the argument.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;
boolean equals(Object obj)
&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Determines whether this number object is equal to the argument. 
&lt;br /&gt;
The methods return &lt;code&gt;true&lt;/code&gt; if the argument is not &lt;code&gt;null&lt;/code&gt; and is an object of the same type and 
with the same numeric value.
&lt;br /&gt;
There are some extra requirements for &lt;code&gt;Double&lt;/code&gt; and &lt;code&gt;Float&lt;/code&gt; 
objects that are described in the Java API documentation.



&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
    &lt;p&gt; &lt;/p&gt; 
    &lt;p&gt;
Each &lt;code&gt;Number&lt;/code&gt; class contains other methods that are useful for converting numbers to and from strings 
and for converting between number systems. The following table lists these methods in the &lt;code&gt;Integer&lt;/code&gt; class. 
Methods for the other &lt;code&gt;Number&lt;/code&gt; subclasses are similar:
&lt;/p&gt; 
    &lt;p&gt; &lt;/p&gt; 
    &lt;table cellspacing="3" cellpadding="4" border="1" width="100%"&gt; &lt;caption&gt;&lt;b&gt;Conversion Methods, &lt;code&gt;Integer&lt;/code&gt; Class&lt;/b&gt;&lt;/caption&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;th&gt;Method&lt;/th&gt; 
          &lt;th width="50%"&gt;Description&lt;/th&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;
static Integer decode(String s)

&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Decodes a string into an integer. Can accept string representations of decimal, octal, or hexadecimal numbers 
as input.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;
static int parseInt(String s)
&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Returns an integer (decimal only).
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;
static int parseInt(String s, int radix)
&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Returns an integer, given a string representation of decimal, binary, octal, or hexadecimal 
(&lt;code&gt;radix&lt;/code&gt; equals 10, 2, 8, or 16 respectively) numbers as input.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;
String toString()
&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Returns a &lt;code&gt;String&lt;/code&gt; object representing the value of this &lt;code&gt;Integer&lt;/code&gt;.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;
static String toString(int i)

&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Returns a &lt;code&gt;String&lt;/code&gt; object representing the specified integer.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;
static Integer valueOf(int i)
&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Returns an &lt;code&gt;Integer&lt;/code&gt; object holding the value of the specified primitive.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;
static Integer valueOf(String s)
&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Returns an &lt;code&gt;Integer&lt;/code&gt; object holding the value of the specified string representation.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;code&gt;
static Integer valueOf(String s, int radix)
&lt;/code&gt; &lt;/td&gt; 
          &lt;td&gt;
Returns an &lt;code&gt;Integer&lt;/code&gt; object holding the integer value of the specified string representation, 
parsed with the value of radix. For example, if s = &amp;quot;333&amp;quot; and radix = 8, the method returns the base-ten 
integer equivalent of the octal number 333. 
&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/blockquote&gt; 
  &lt;div class="NavBit"&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/java/data/numbers.html" target="_top"&gt;« Previous&lt;/a&gt;
            •
            &lt;a href="http://java.sun.com/docs/books/tutorial/java/TOC.html" target="_top"&gt;Trail&lt;/a&gt;
            •
            &lt;a href="http://java.sun.com/docs/books/tutorial/java/data/numberformat.html" target="_top"&gt;Next »&lt;/a&gt; &lt;/div&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/7mtpadHUdgs" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/the_numbers_classes</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/application_basics_with_ants_young</id>
        <title type="html">Application Basics With Ants (Young Developer Series, Part 3)</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/JlSOvDUab9Q/application_basics_with_ants_young" />
        <published>2008-12-01T09:06:19-08:00</published>
        <updated>2008-12-01T09:06:19-08:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="developers" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="learning" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="programming" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="student" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="young" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn about Java packages, variables, and ways that objects interact with each other through methods.</summary>
        <content type="html">&lt;table width="100%" cellspacing="0" cellpadding="0" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td valign="top" class="smaller"&gt;&lt;i&gt;By &lt;a href="http://java.sun.com/features/authors.html#nourie"&gt;Dana Nourie&lt;/a&gt;, December 2008
&lt;/i&gt;&lt;/td&gt; 
        &lt;td width="10"&gt; &lt;/td&gt; 
        &lt;td valign="bottom" align="right"&gt; 
          &lt;div class="sitelinks" style="padding: 0px;"&gt; 
            &lt;table cellspacing="0" cellpadding="0" border="0"&gt; 
              &lt;tbody&gt; 
                &lt;tr&gt; &lt;!--
&lt;td valign="bottom" align="right"&gt;&lt;img src="/im/ic_email.gif" width="14" height="12" border="0" hspace="4" vspace="1" alt=" " /&gt;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="#{link placeholder}"&gt;E-mail&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="/jsp_utils/PrintPage.jsp" target="printFriendlyView" onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}openPopup('','printFriendlyView',710,650,'no',1,1,0,0,0,0); return true;"&gt;&lt;img src="/im/ic_print.gif" width="14" height="12" alt="Print-friendly Version" border="0" hspace="4" /&gt;Print-friendly Version&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;img src="/im/ic_download_thin.gif" width="9" height="14" hspace="4" border="0" alt=" " /&gt;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="#{link placeholder}"&gt;Download&lt;/a&gt;&lt;/td&gt;
--&gt; &lt;/tr&gt; 
              &lt;/tbody&gt; 
            &lt;/table&gt; 
          &lt;/div&gt; &lt;br /&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img width="1" height="4" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;!--  END VCD4 BYLINE AND TOOLS  --&gt; 
  &lt;p&gt;Learn about Java packages, variables, and ways that objects interact with each other through methods.&lt;/p&gt; 
  &lt;p&gt;In the articles &lt;a href="http://java.sun.com/developer/technicalArticles/wombat_basics/"&gt;Wombat Object Basics&lt;/a&gt; and &lt;a href="http://java.sun.com/developer/technicalArticles/wombat_world/"&gt;Wombat Classes Basics&lt;/a&gt;,
you learned about objects, classes, methods, and language syntax. Now,
in Part 3 of the Young Developer series, you'll learn what is involved
in writing a Java application that relies on other Java classes (or &lt;a href="http://java.sun.com/javase/6/docs/api/"&gt;Java API&lt;/a&gt;), what variables are, how to use variables, and how objects interact through methods.&lt;/p&gt; 
  &lt;p&gt;As in the last article, to follow along, you will need these installed on your computer:&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;The &lt;a href="http://java.sun.com/javase/downloads/"&gt;Java SE&lt;/a&gt; software&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.greenfoot.org/download/" target="_blank"&gt;Greenfoot&lt;/a&gt;&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;This article is aimed at anyone interested in Java programming who
is from the age of 10 to 100 and who has no programming experience. We
recommend that you have read and followed the instructions in &lt;a href="http://java.sun.com/developer/technicalArticles/wombat_basics/"&gt;Wombat Object Basics&lt;/a&gt; and &lt;a href="http://java.sun.com/developer/technicalArticles/wombat_basics/"&gt;Wombat Classes Basics&lt;/a&gt; before you move on to this article.&lt;/p&gt; 
  &lt;div&gt;&lt;b&gt;Looking at Packages and Variables in Ants&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img width="1" height="4" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;For this tutorial, open the Ants scenario by going to the Scenario
menu, and selecting Open. The scenarios folder should automatically be
visible. Choose ants, and then click Open as shown in Figure 1.&lt;/p&gt; &lt;!-- BEGIN IMAGE WITH CAPTION --&gt; 
  &lt;table width="389" cellspacing="0" cellpadding="2" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center" class="grey3"&gt; &lt;img width="389" height="312" src="http://java.sun.com/developer/technicalArticles/basics_ants/images/openants.jpg" alt="Opening the Ants Scenario" /&gt; 
          &lt;div class="pad3"&gt; &lt;span class="dkcaption1"&gt;&lt;b&gt;Figure 1.&lt;/b&gt; &lt;i&gt;Opening the Ants Scenario&lt;/i&gt;&lt;/span&gt;&lt;/div&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;!-- END IMAGE WITH CAPTION --&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;A new window opens and displays the Ants scenario. If you do not see
the sand-colored world on the screen, click the Compile All button at
the bottom of the scenario main screen.&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/basics_ants/"&gt;Read the rest of this article . . . &lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/JlSOvDUab9Q" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/application_basics_with_ants_young</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/security</id>
        <title type="html">Security</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/yiZolIUSzDk/security" />
        <published>2008-11-10T13:23:46-08:00</published>
        <updated>2008-11-10T13:23:46-08:00</updated> 
        <category term="/Applications" label="Applications" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">In this trail you'll learn how the built-in 
Java security features protect you 
from malevolent programs.</summary>
        <content type="html">&lt;p&gt; &lt;/p&gt; 
  &lt;p&gt; &lt;b&gt;Trail: Security Features in Java SE&lt;/b&gt;&lt;/p&gt; 
  &lt;blockquote&gt; &lt;/blockquote&gt;

In this trail you'll learn how the built-in 
Java™ security features protect you 
from malevolent programs. You'll see how to use tools to control access to 
resources, to generate and to check digital signatures,
and to create and to manage 
keys needed for signature generation and checking. You'll also see how to 
incorporate cryptography services, such as digital signature generation 
and checking, into your programs.


  
  &lt;p&gt;The security features provided by the Java Development Kit 
(JDK™) 
are intended for a variety of audiences:

&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;&lt;b&gt;Users running programs&lt;/b&gt;:

      
      &lt;blockquote&gt; 
        &lt;p&gt;Built-in security functionality protects you from malevolent
programs (including viruses), 
maintains the privacy of your files and information about you,
and authenticates the identity of each code provider.
You can subject applications and applets to security
controls when you need to. 
&lt;/p&gt; 
      &lt;/blockquote&gt; 
      &lt;p&gt; &lt;/p&gt; 
    &lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;Developers&lt;/b&gt;:
      
      &lt;p&gt; &lt;/p&gt; 
      &lt;blockquote&gt;
You can use API methods to incorporate security functionality into
your programs, including cryptography services and
security checks.
The API framework enables you to define and integrate your own
permissions (controlling access to specific resources), 
cryptography service implementations, security manager implementations,
and policy implementations.
In addition, classes are provided for management of your 
public/private key pairs and
public key certificates from people you trust.
        
        &lt;p&gt; &lt;/p&gt; 
      &lt;/blockquote&gt; 
    &lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;Systems administrators, developers, and users&lt;/b&gt;:

      
      &lt;blockquote&gt;
JDK tools manage your keystore (database of keys and certificates);
generate digital signatures for JAR files,
and verify the authenticity of such signatures
and the integrity of the signed contents; and
create and modify the policy 
files that define your installation's security policy.
&lt;/blockquote&gt; 
    &lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt; &lt;!-- 
&lt;blockquote&gt;&lt;hr&gt;&lt;b&gt;Note:&lt;/b&gt;&amp;nbsp; Nearly all of the security features
documented in this trail were added to the 
JDK for its 1.2
release. Thus, the code examples in the following lessons
will work only on Java platforms that 
are compatible with JDK 1.2. 
Individual browsers may have some different behavior,
unless you use the 
&lt;a class="OutsideLink" target="_blank" href="http://java.sun.com/products/plugin/"&gt;Java Plug-in&lt;/a&gt;  to download the latest Java Runtime Environment 
(JRE&lt;sup&gt;&lt;font size="-2"&gt;TM&lt;/font&gt;&lt;/sup&gt;) compatible with 
JDK 1.2.
&lt;hr&gt;&lt;/blockquote&gt;

--&gt; &lt;/p&gt; 
  &lt;h2&gt;Trail Lessons&lt;/h2&gt; &lt;!--    OVERVIEW    --&gt; &lt;!-- *** comment out the Summaries trail for now per Charlie --&gt; &lt;!-- 

&lt;p&gt;

&lt;a href="overview/index.html"&gt;
&lt;img src="/roller-ui/images/coreIcon.gif" align=left width=20 height=20 border=0&gt;
&lt;b&gt;Security Features Overview&lt;/b&gt;&lt;/a&gt;
briefly describes the security features available in JDK 6.

 **** end overview --&gt; &lt;!--    QUICK TOUR  1  --&gt; 
  &lt;p&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/security/tour1/index.html"&gt; &lt;img height="20" border="0" align="left" width="20" src="http://java.sun.com/docs/books/tutorial/images/coreIcon.gif" /&gt; &lt;b&gt;Quick Tour of Controlling Applets&lt;/b&gt;&lt;/a&gt;
shows how resource accesses, 
such as reading or writing a file, 
are not permitted for unsigned applets unless
explicitly allowed by a permission in a policy file.

&lt;!--    QUICK TOUR  2   --&gt; &lt;/p&gt; 
  &lt;p&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/security/tour2/index.html"&gt; &lt;img height="20" border="0" align="left" width="20" src="http://java.sun.com/docs/books/tutorial/images/coreIcon.gif" /&gt; &lt;b&gt;Quick Tour of Controlling Applications&lt;/b&gt;&lt;/a&gt;
builds on the previous lesson, showing that when applications
are run under a security manager, resource accesses may be
controlled in exactly the same way as for unsigned applets.

&lt;!--    API AND TOOLS OVERVIEW WRT SIGNING    --&gt; &lt;/p&gt; 
  &lt;p&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/security/sigcert/index.html"&gt; &lt;img height="20" border="0" align="left" width="20" src="http://java.sun.com/docs/books/tutorial/images/coreIcon.gif" /&gt; &lt;b&gt;API and Tools Use for Secure Code and File Exchanges&lt;/b&gt;&lt;/a&gt;
defines digital signatures, certificates, and keystores and discusses why they are needed.
It also reviews information applicable to the next three lessons
regarding the steps commonly needed for using the tools or the API to generate
signatures, export/import certificates, and so on. 


&lt;!--    TOOLS SIGNING CODE  --&gt; &lt;/p&gt; 
  &lt;p&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/security/toolsign/index.html"&gt; &lt;img height="20" border="0" align="left" width="20" src="http://java.sun.com/docs/books/tutorial/images/coreIcon.gif" /&gt; &lt;b&gt;Signing Code and Granting It Permissions&lt;/b&gt;&lt;/a&gt;
illustrates the use of  all the security-related tools. 
It shows the steps that a developer would take
to sign and to distribute code for others
to run. The lesson also shows how someone
who will run the code (or a system administrator) 
could add an entry in a policy file
to grant the code permission for the resource accesses it needs.


&lt;!--    TOOLS USE FOR TWO-PARTY FILE EXCHANGE    --&gt; &lt;/p&gt; 
  &lt;p&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/security/toolfilex/index.html"&gt; &lt;img height="20" border="0" align="left" width="20" src="http://java.sun.com/docs/books/tutorial/images/coreIcon.gif" /&gt; &lt;b&gt;Exchanging Files&lt;/b&gt;&lt;/a&gt;
shows use of the tools by one person to sign an important document, such as a 
contract, and to export the public key certificate for the public key
corresponding to the private key used to sign the contract.
Then the lesson shows how another person, 
who receives the contract, the signature, and
the public key certificate, can import the
certificate and verify the signature.


&lt;!--    API USE FOR TWO-PARTY FILE EXCHANGE    --&gt; &lt;/p&gt; 
  &lt;p&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/security/apisign/index.html"&gt; &lt;img height="20" border="0" align="left" width="20" src="http://java.sun.com/docs/books/tutorial/images/coreIcon.gif" /&gt; &lt;b&gt;Generating and Verifying Signatures&lt;/b&gt;&lt;/a&gt;
walks you step by step through an example of writing a Java
program using the JDK Security API to generate keys, to generate a
digital signature for data using the private key, and to export the
public key and the signature to files.
Then the example shows writing a second program, which may be expected
to run on a different person's computer, that imports the public key
and verifies the authenticity of the signature.
Finally, the example discusses potential weaknesses of the
approach used by the basic programs and demonstrates possible
alternative approaches and methods of supplying and importing keys,
including in certificates.
&lt;!--    IMPLEMENTING YOUR OWN PERMISSION    --&gt; &lt;/p&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/security/userperm/index.html"&gt; &lt;img height="20" border="0" align="left" width="20" src="http://java.sun.com/docs/books/tutorial/images/coreIcon.gif" /&gt; &lt;b&gt;Implementing Your Own Permission&lt;/b&gt;&lt;/a&gt;
demonstrates how to write a class that defines its
own special permission.



  
  &lt;p&gt;&amp;nbsp;******************* &lt;br /&gt;&lt;/p&gt; 
  &lt;div&gt;&lt;b&gt;Test Your Java Knowledge -&amp;nbsp;Chance to Win 1 of 100 books!&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt; &lt;/b&gt;&lt;/div&gt; 
  &lt;div&gt;&lt;br /&gt; &lt;/div&gt; 
  &lt;div&gt; 
    &lt;p&gt;&lt;a href="%20http://developers.sun.com/members/sdn_quiz/quiz.jsp"&gt;Take
the SDN Quiz&lt;/a&gt; to see how much you know about Java. Join or log into the
Sun Developer Network and answer the questions correctly for a chance
to win one of 100 Hello World(s) -- From Code to Culture: A 10 Year
Celebration of Java Technology (Hardcover). &lt;a href="%20http://developers.sun.com/members/sdn_quiz/quiz.jsp"&gt;Register to take the Quiz
and a chance to Win Today!&lt;/a&gt;&lt;/p&gt; 
    &lt;p&gt;No purchase necessary. Void where prohibited. Open to legal residents
of U.S. (excluding Puerto Rico) and Canada (excluding Quebec) 18 years
or older. Entrants are responsible for complying with their employers'
policies regarding acceptance of promotional items. Entries accepted
from 11/04/08 to 12/01/08. 100 winners will receive one copy of the
book Hello World(s) -- From Code to Culture: A 10 Year Celebration of
Java Technology (Hardcover) (US $24.99).&lt;a href="http://developers.sun.com/aboutsdn/sdn_contest.html"&gt; For complete Official Rules,
visit here&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt; 
  &lt;/div&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/yiZolIUSzDk" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/security</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/uml_developing_applications</id>
        <title type="html">UML: Developing Applications</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/Dq0OXMPm5QY/uml_developing_applications" />
        <published>2008-10-28T12:32:35-07:00</published>
        <updated>2008-10-28T12:32:35-07:00</updated> 
        <category term="/Applications" label="Applications" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java-se" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="uml" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">In this tutorial, you learn how to use the UML features of the IDE
to create a simple UML class diagram.</summary>
        <content type="html">&lt;div class="articledate" style="margin-left: 0px; font-style: italic;"&gt; 
    &lt;p&gt;&lt;i&gt;Contributed by &lt;a href="mailto:sherry.barkodar@sun.com"&gt;Sherry Barkodar &lt;/a&gt; 
 and maintained by &lt;a href="mailto:cynthia.castillo@sun.com"&gt;Cindy Castillo&lt;/a&gt; 
 and &lt;a href="mailto:bob.may@sun.com"&gt;&lt;i&gt;Bob May &lt;/i&gt;&lt;/a&gt; 

    November 2007&lt;/i&gt; [Revision number: V1-4]&lt;br /&gt;
    This publication is applicable to NetBeans IDE 6.0 and 6.1 releases.&lt;br /&gt; &lt;/p&gt; 
  &lt;/div&gt; 
  &lt;p&gt;In this tutorial, you learn how to use the UML features of the IDE
to create a simple UML class diagram. You then use the code generation
and reverse engineering features to develop a simple banking
application, which you can test by executing a test class. This banking
application is greatly simplified; a real model for an application of
this type would require more detail. The purpose of this tutorial is to
introduce some of the IDE's UML features, not to teach you about UML
concepts or the Java programming language.&lt;!-- START Link to Support and Docs paragraph ----------------------------------------------------------* --&gt; &lt;!-- END Link to Support and Docs paragraph ------------------------------------------------------------* --&gt; &lt;!-- START Note about videos in your-tutorial ----------------------------------------------------------* --&gt; &lt;!-- Include this note only if you actually have videos in your doc, otherwise, delete this paragraph --* --&gt; &lt;!-- Update the image reference below so it references the file in your images directory ---------------* --&gt; &lt;/p&gt; 
  &lt;div class="indent"&gt; &lt;!-- ======================================================================================== --&gt; &lt;/div&gt; 
  &lt;p class="align-center"&gt;&lt;b&gt;Expected duration: &lt;i&gt;25&lt;/i&gt; minutes&lt;/b&gt;&lt;/p&gt; 
  &lt;div class="indent"&gt; &lt;img height="114" width="114" src="http://www.netbeans.org/images/articles/60/netbeans-stamp60-61.gif" class="stamp" alt="Content on this page applies to NetBeans IDE 6.0" title="Content on this page applies to the NetBeans IDE 6.0 and 6.1" /&gt; 
    &lt;ul&gt;&lt;/ul&gt; 
  &lt;/div&gt; 
  &lt;h2&gt;&lt;a name="tut_req"&gt;&lt;/a&gt;Tutorial Requirements&lt;/h2&gt; 
  &lt;p&gt;Before you proceed, make sure you review the requirements in this section.&lt;/p&gt; &lt;!-- ======================================================================================== --&gt; 
  &lt;h3 class="tutorial"&gt;Prerequisites&lt;/h3&gt; 
  &lt;p&gt;To use this tutorial, the IDE must be installed on your system and
you should be familiar with the basic parts of the IDE. You should also
have a basic familiarity with the Java programming language and UML.
For a basic understanding of the IDE, see the IDE Basics topics in the
online help. A good resource for UML techniques and theory is the
official UML resource page at &lt;a href="http://www.uml.org/" target="_blank" title="http://www.uml.org/"&gt;http://www.uml.org/&lt;/a&gt;.&lt;/p&gt; &lt;!-- ======================================================================================== --&gt; 
  &lt;h3 class="tutorial"&gt;System Requirements&lt;/h3&gt; 
  &lt;p&gt;This tutorial assumes that your system meets the requirements specified in the Systems Requirements section of the &lt;a href="http://www.netbeans.org/community/releases/60/relnotes.html"&gt;NetBeans 6.1 Release Notes&lt;/a&gt;.&lt;/p&gt; &lt;!-- ======================================================================================== --&gt; 
  &lt;h3&gt;Software Needed for This Tutorial&lt;/h3&gt; 
  &lt;p&gt;To follow this tutorial, you need the software and resources listed in the following
table.&lt;/p&gt; 
  &lt;table&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;th class="tblheader" scope="col"&gt;Software or Resource&lt;/th&gt; 
        &lt;th class="tblheader" scope="col"&gt;Version Required&lt;/th&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td class="tbltd1"&gt;NetBeans IDE&lt;/td&gt; 
        &lt;td class="tbltd1"&gt;&lt;a href="http://www.netbeans.org/downloads/index.html"&gt;version 6.1&lt;/a&gt; or&lt;br /&gt;
                version 6.0&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td class="tbltd1"&gt;Java Development Kit (JDK)&lt;/td&gt; 
        &lt;td class="tbltd1"&gt; 
          &lt;p&gt;&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;version 6&lt;/a&gt; or&lt;br /&gt;
                version 5&lt;/p&gt; 
          &lt;p&gt; &lt;/p&gt; 
          &lt;p align="left"&gt; &lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; 
  &lt;h2&gt;Creating the Java Project for the Application&lt;/h2&gt; 
  &lt;p&gt;In this section , you create a new Java project for the Java application you are going to develop in this tutorial. &lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li class="tut"&gt;From the main menu, choose File &amp;gt; New Project and then do the following in the New Project wizard:&lt;br /&gt; 
      &lt;ol type="a"&gt; 
        &lt;li class="tut"&gt;Under Categories, select Java.&lt;/li&gt; 
        &lt;li class="tut"&gt;Under Projects, select Java Application&lt;/li&gt; 
        &lt;li class="tut"&gt;Click Next.&lt;/li&gt; 
      &lt;/ol&gt; 
    &lt;/li&gt; 
    &lt;li class="tut"&gt;In the Project Name field, type &lt;tt&gt;JavaPrj&lt;/tt&gt;.&lt;/li&gt; 
    &lt;li class="tut"&gt;For the Project Location field, click Browse, navigate to any directory on your computer. Click Open and type &lt;tt&gt;MyPrj&lt;/tt&gt;.&lt;/li&gt; 
    &lt;li class="tut"&gt;Clear the Set as Main Project and the Create Main Class checkboxes.&lt;/li&gt; 
    &lt;li class="tut"&gt;Click Finish.&lt;br /&gt;
    A progress dialog box appears.&lt;br /&gt;
    When the new &lt;tt&gt;JavaPrj&lt;/tt&gt; project is created, it appears in the Projects window.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p class="align-center"&gt;&lt;a onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}demoWin=open(this.href,this.target,&amp;quot;resizable=yes,menubar=yes,status=yes,toolbar=no,height=640,width=860,scrollbars=yes&amp;quot;);demoWin.focus();return false" target="demoWin" href="http://www.netbeans.org/kb/60/uml/fe-files/umljavaprj.html"&gt;&lt;img class="b-none" src="http://www.netbeans.org/images/articles/uml_fe/flash_demo_button_med.gif" /&gt;&amp;nbsp;View Demo&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="align-center"&gt;&lt;a href="http://www.netbeans.org/kb/60/uml/fe.html#top"&gt;top&lt;/a&gt;&lt;/p&gt; &lt;br /&gt; &lt;!-- ===================================================================================== --&gt; 
  &lt;h2&gt;&lt;a name="UMLProject"&gt;&lt;/a&gt;Creating the UML Project and the Class Diagram&lt;/h2&gt; 
  &lt;p&gt;In this section, you create the UML project (or UML project) and
class diagram for the application. A UML project is the mechanism by
which you store and manage a collection of files for a UML model. A UML
model contains all of the model's diagrams, their associated elements,
and metadata related to the UML model.&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li class="tut"&gt;To create the UML project, choose File &amp;gt; New Project and then do the following:&lt;br /&gt; 
      &lt;ol type="a"&gt; 
        &lt;li class="tut"&gt;Under Categories, select UML.&lt;/li&gt; 
        &lt;li class="tut"&gt;Under Projects, select Java-Platform Model.&lt;/li&gt; 
        &lt;li class="tut"&gt;Click Next.&lt;/li&gt; 
      &lt;/ol&gt;
      The New Java-Platform Model dialog box opens.
    
    
    &lt;/li&gt; 
    &lt;li class="tut"&gt;In the Project Name field, type &lt;tt&gt;UMLPrj&lt;/tt&gt;.&lt;br /&gt;
    Notice that when you type the Project Name, the IDE automatically suggests this name for the name of the Project Folder.&lt;/li&gt; 
    &lt;li class="tut"&gt;Verify that the Project Location is &lt;tt&gt;MyPrj&lt;/tt&gt;.&lt;/li&gt; 
    &lt;li class="tut"&gt;Click Finish.&lt;br /&gt;
    The IDE creates the UML project and the Create New Diagram dialog box appears.&lt;/li&gt; 
    &lt;li class="tut"&gt;In the Diagram Type list, select Class Diagram.&lt;/li&gt; 
    &lt;li class="tut"&gt;In the Diagram Name field, type &lt;tt&gt;BankClassDiagram&lt;/tt&gt;.&lt;/li&gt; 
    &lt;li class="tut"&gt;Leave &lt;tt&gt;UMLPrj&lt;/tt&gt; in the Namespace field and click Finish.&lt;br /&gt;
    The IDE does the following:&lt;br /&gt; 
      &lt;ul&gt; 
        &lt;li class="tut"&gt;Adds the &lt;tt&gt;UMLPrj&lt;/tt&gt; project node in the Projects window.&lt;/li&gt; 
        &lt;li class="tut"&gt;Creates a &lt;tt&gt;BankClassDiagram&lt;/tt&gt; node under the &lt;tt&gt;Model&lt;/tt&gt; node&lt;/li&gt; 
        &lt;li class="tut"&gt;Displays the new diagram in the Diagram editor (the diagram is empty at this point)&lt;/li&gt; 
        &lt;li class="tut"&gt;Opens the Modeling Palette&lt;/li&gt; 
      &lt;/ul&gt; 
    &lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p class="align-center"&gt;&lt;a onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}demoWin=open(this.href,this.target,&amp;quot;resizable=yes,menubar=yes,status=yes,toolbar=no,height=640,width=860,scrollbars=yes&amp;quot;);demoWin.focus();return false" target="demoWin" href="http://www.netbeans.org/kb/60/uml/fe-files/umlprj.html"&gt;&lt;img class="b-none" src="http://www.netbeans.org/images/articles/uml_fe/flash_demo_button_med.gif" /&gt;&amp;nbsp;View Demo&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="align-center"&gt;&lt;a href="http://www.netbeans.org/kb/60/uml/fe.html#top"&gt;top&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="align-center"&gt; &lt;!-- ===================================================================================== --&gt; &lt;/p&gt; 
  &lt;h2&gt;&lt;a name="classdiagram"&gt;&lt;/a&gt;Adding and Defining Class Elements&lt;/h2&gt; 
  &lt;p&gt;Now, add and define the class elements that will make up your Java
application. You use the Class icon from the Modeling Palette to create
the class elements.&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li class="tut"&gt;From the Basic section of the Modeling Palette, select the Class icon &lt;img alt="image of Class icon is displayed." src="http://www.netbeans.org/images/articles/uml_fe/Class.png" /&gt; and click in the Diagram editor.&lt;br /&gt;
    This action places a class element on the Diagram editor.&lt;/li&gt; 
    &lt;li class="tut"&gt;Deselect the Class icon by right-clicking anywhere in the Diagram editor.&lt;/li&gt; 
    &lt;li class="tut"&gt;Select the newly added class element, type &lt;tt&gt;BankAccount&lt;/tt&gt; and press Enter.&lt;br /&gt;
    The IDE does the following: &lt;br /&gt; 
      &lt;ul&gt; 
        &lt;li class="tut"&gt;Labels the element &lt;tt&gt;BankAccount&lt;/tt&gt;&lt;/li&gt; 
        &lt;li class="tut"&gt;Creates a public operation, &lt;tt&gt;BankAccount()&lt;/tt&gt;&lt;/li&gt; 
        &lt;li class="tut"&gt;Displays the properties of the &lt;tt&gt;BankAccount&lt;/tt&gt; class in the Properties window&lt;/li&gt; 
      &lt;/ul&gt; 
    &lt;/li&gt; 
    &lt;li class="tut"&gt;With the &lt;tt&gt;BankAccount&lt;/tt&gt; class element selected in the Diagram editor, right-click the word &lt;tt&gt;Attributes&lt;/tt&gt; and choose Insert Attribute from the pop-up menu.&lt;br /&gt;
    A one-line editor opens and displays the following information:&lt;br /&gt; 
      &lt;pre class="examplecode"&gt;visibility type &lt;b&gt;name&lt;/b&gt;[ranges]=initialValue{name=value}&lt;/pre&gt; 
    &lt;/li&gt; 
    &lt;li class="tut"&gt;Type &lt;tt&gt;balance&lt;/tt&gt; and press Enter.&lt;br /&gt;
    A private attribute named &lt;tt&gt;balance&lt;/tt&gt; of type &lt;tt&gt;int&lt;/tt&gt; appears on the &lt;tt&gt;BankAccount&lt;/tt&gt; class. The following operations are created on the class:&lt;br /&gt; 
      &lt;ul&gt; 
        &lt;li class="tut"&gt;&lt;tt&gt;public int getBalance()&lt;/tt&gt;&lt;/li&gt; 
        &lt;li class="tut"&gt;&lt;tt&gt;public void setBalance(int val)&lt;/tt&gt;&lt;/li&gt; 
      &lt;/ul&gt; 
    &lt;/li&gt; 
    &lt;li class="tut"&gt;&lt;a name="add_op"&gt;&lt;/a&gt;With the &lt;tt&gt;BankAccount&lt;/tt&gt;
class element still selected in the Diagram editor, right-click the
word Operations and choose Insert Operation from the pop-up menu. &lt;br /&gt;
    A one-line editor opens and displays the following information:&lt;br /&gt; 
      &lt;pre class="examplecode"&gt;visibility returnType &lt;b&gt;name&lt;/b&gt;(parameter) {properties...}&lt;/pre&gt; 
    &lt;/li&gt; 
    &lt;li class="tut"&gt;Type &lt;tt&gt;withdraw&lt;/tt&gt;, move your cursor (use the forward arrow on your keyboard) into the parentheses, type &lt;tt&gt;int amount&lt;/tt&gt; and press Enter.&lt;br /&gt;
    The IDE adds the new operation in the class element as follows:
      
      
      
      &lt;pre class="examplecode"&gt;public void withdraw(int amount)&lt;/pre&gt; 
    &lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p class="align-center"&gt;&lt;a onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}demoWin=open(this.href,this.target,&amp;quot;resizable=yes,menubar=yes,status=yes,toolbar=no,height=640,width=860,scrollbars=yes&amp;quot;);demoWin.focus();return false" target="demoWin" href="http://www.netbeans.org/kb/60/uml/fe-files/umladdclass.html"&gt;&lt;img class="b-none" src="http://www.netbeans.org/images/articles/uml_fe/flash_demo_button_med.gif" /&gt;&amp;nbsp;View Demo&lt;/a&gt; &lt;/p&gt; 
  &lt;p class="align-center"&gt;&lt;a href="http://www.netbeans.org/kb/60/uml/fe.html#top"&gt;top&lt;/a&gt;&lt;br /&gt; &lt;!-- ======================================================================================= --&gt; &lt;/p&gt; 
  &lt;h2&gt;&lt;a name="add_cmpnts"&gt;&lt;/a&gt;Adding More Elements to the Diagram&lt;/h2&gt; 
  &lt;p&gt;In this section, you use more UML icons from the Modeling Palette to
add interfaces, packages, attributes, and operations to your
application.&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li class="tut"&gt;From the Basic section of the Modeling Palette, select the Package icon &lt;img alt="image of Package icon" src="http://www.netbeans.org/images/articles/uml_fe/DTPackage.png" /&gt;.&lt;br /&gt; &lt;br /&gt; &lt;b&gt;Note: &lt;/b&gt;If necessary, scroll down to see the additional Modeling icons.&lt;/li&gt; 
    &lt;li class="tut"&gt;Click in the Diagram editor to add a package element to the class diagram.&lt;/li&gt; 
    &lt;li class="tut"&gt;Right-click anywhere in the Diagram editor to deselect the Package icon.&lt;br /&gt; &lt;br /&gt; &lt;b&gt;Note: &lt;/b&gt;As
you add modeling elements to the diagram, you can select them and drag
them to new locations in the Diagram editor to improve the appearance
of the diagram. Be careful when you right-click, as in some positions,
this action opens a pop-up menu for the Diagram editor. If this
happens, just click again in the white space of the Diagram editor.&lt;/li&gt; 
    &lt;li class="tut"&gt;With the package element selected, type &lt;tt&gt;bankpack&lt;/tt&gt; and press Enter.&lt;/li&gt; 
    &lt;li class="tut"&gt;From the Basic section of the Modeling Palette, select the Interface icon &lt;img alt="image of Interface icon" src="http://www.netbeans.org/images/articles/uml_fe/Interface.png" /&gt; and click in the Diagram editor.&lt;/li&gt; 
    &lt;li class="tut"&gt;Right-click anywhere in the Diagram editor to deselect the Interface icon.&lt;/li&gt; 
    &lt;li class="tut"&gt;With the interface element selected, type &lt;tt&gt;Bank&lt;/tt&gt; and press Enter.&lt;/li&gt; 
    &lt;li class="tut"&gt;Add a &lt;tt&gt;deposit&lt;/tt&gt; operation to the &lt;tt&gt;Bank&lt;/tt&gt; interface.&lt;br /&gt;
    You add operations to interfaces the same way you add them to classes (&lt;a href="http://www.netbeans.org/kb/60/uml/fe.html#add_op"&gt;Step 6 in the preceding section&lt;/a&gt;). Define the operation as follows: &lt;br /&gt; 
      &lt;pre class="examplecode"&gt;public void deposit(int amount)&lt;/pre&gt; 
    &lt;/li&gt; 
    &lt;li class="tut"&gt;From the Modeling Palette, select the Class icon &lt;img alt="image of Class icon" src="http://www.netbeans.org/images/articles/uml_fe/Class.png" /&gt; and click in the Diagram editor two times.&lt;/li&gt; 
    &lt;li class="tut"&gt;Right-click anywhere in the Diagram editor to deselect the Class icon.&lt;br /&gt; &lt;br /&gt; &lt;b&gt;Note: &lt;/b&gt;If
you draw too many class elements, deselect the Class icon, then
right-click the class element you want to delete and select Edit &amp;gt;
Delete.&lt;/li&gt; 
    &lt;li class="tut"&gt;Name the class elements &lt;tt&gt;Checking&lt;/tt&gt; and &lt;tt&gt;AccountTest&lt;/tt&gt; and resize the elements if necessary.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p class="align-center"&gt;&lt;a onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}demoWin=open(this.href,this.target,&amp;quot;resizable=yes,menubar=yes,status=yes,toolbar=no,height=640,width=860,scrollbars=yes&amp;quot;);demoWin.focus();return false" target="demoWin" href="http://www.netbeans.org/kb/60/uml/fe-files/umladdelement.html"&gt;&lt;img class="b-none" src="http://www.netbeans.org/images/articles/uml_fe/flash_demo_button_med.gif" /&gt;&amp;nbsp;View Demo&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="align-center"&gt;&lt;a href="http://www.netbeans.org/kb/60/uml/fe.html#top"&gt;top&lt;/a&gt;&lt;/p&gt; &lt;br /&gt; &lt;!-- ======================================================================================= --&gt; 
  &lt;h2&gt;&lt;a name="add_associations"&gt;&lt;/a&gt;Identifying Associations Between Elements&lt;/h2&gt; 
  &lt;p&gt;In this section, you use the UML icons from the Modeling Palette to identify the association between class elements.&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li class="tut"&gt;From the Basic section of the Modeling Palette, select the Implementation icon &lt;img height="16" width="16" alt="image of Implementation icon" src="http://www.netbeans.org/images/articles/uml_fe/Implementation.png" /&gt; and click inside the &lt;b&gt;&lt;tt&gt;BankAccount&lt;/tt&gt;&lt;/b&gt; class element.&lt;/li&gt; 
    &lt;li class="tut"&gt;Click inside the &lt;tt&gt;Bank&lt;/tt&gt; interface element and right-click anywhere in the Diagram editor to deselect the Implementation icon.&lt;br /&gt;
An implementation link appears between the class and the interface
element. An implementation link denotes a relationship between a class
and an interface.&lt;/li&gt; 
    &lt;li class="tut"&gt;From the Basic section of the Modeling Palette, select the Generalization icon &lt;img alt="image of Generalization icon" src="http://www.netbeans.org/images/articles/uml_fe/GeneraLink.png" /&gt;.&lt;/li&gt; 
    &lt;li class="tut"&gt;Click inside the &lt;tt&gt;Checking&lt;/tt&gt; class element (the subclass), then click inside the BankAccount class element (the superclass).&lt;br /&gt;
  The Select Methods to Redefine dialog box appears.&lt;/li&gt; 
    &lt;li class="tut"&gt;Select the &lt;tt&gt;withdraw&lt;/tt&gt; method and click OK.&lt;br /&gt;
    The IDE does the following: &lt;br /&gt; 
      &lt;ul&gt; 
        &lt;li class="tut"&gt;Closes the dialog box&lt;/li&gt; 
        &lt;li class="tut"&gt;Adds the &lt;tt&gt;withdraw&lt;/tt&gt; method to the Checking class&lt;/li&gt; 
        &lt;li class="tut"&gt;Adds the Generalization link between the two related Class elements&lt;/li&gt; 
      &lt;/ul&gt;
A generalization link shows the relationship between a subclass and its
superclass. Subclasses are refinements of the superclass, meaning they
can inherit features (attributes and operations) from the superclass.
    
    
    &lt;/li&gt; 
    &lt;li class="tut"&gt;Right-click in any white space in the Diagram editor to deselect the Generalization icon.&lt;/li&gt; 
    &lt;li class="tut"&gt;From the Basic section of the Modeling Palette, select the Nested Link icon &lt;img alt="image of Nested Link icon" src="http://www.netbeans.org/images/articles/uml_fe/NestedLink.png" /&gt; and click inside the &lt;tt&gt;BankAccount&lt;/tt&gt; element and then inside the &lt;tt&gt;bankpack&lt;/tt&gt; package element.&lt;/li&gt; 
    &lt;li class="tut"&gt;Use the Nested Link icon as described in the prior step and connect the &lt;tt&gt;Checking&lt;/tt&gt;, &lt;tt&gt;AccountTest&lt;/tt&gt;, and &lt;tt&gt;Bank&lt;/tt&gt; elements with the &lt;tt&gt;bankpack&lt;/tt&gt; package.&lt;/li&gt; 
    &lt;li class="tut"&gt;Deselect the Nested Link icon. &lt;br /&gt;
A nested link denotes how elements are organized into groups. In this
case, you organized all the class elements into a group in the &lt;tt&gt;bankpack&lt;/tt&gt; package.&lt;/li&gt; 
    &lt;li class="tut"&gt;Press Ctrl-S anywhere in the Diagram editor to save the changes made to the model. &lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p class="align-center"&gt;&lt;a onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}demoWin=open(this.href,this.target,&amp;quot;resizable=yes,menubar=yes,status=yes,toolbar=no,height=640,width=860,scrollbars=yes&amp;quot;);demoWin.focus();return false" target="demoWin" href="http://www.netbeans.org/kb/60/uml/fe-files/umlassociation.html"&gt;&lt;img class="b-none" src="http://www.netbeans.org/images/articles/uml_fe/flash_demo_button_med.gif" /&gt;&amp;nbsp;View Demo&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="align-center"&gt;&lt;a href="http://www.netbeans.org/kb/60/uml/fe.html#top"&gt;top&lt;/a&gt;&lt;/p&gt; &lt;br /&gt; &lt;!-- ======================================================================================= --&gt; 
  &lt;h2&gt;&lt;a name="codegen"&gt;&lt;/a&gt;Generating Java Source Code&lt;/h2&gt; 
  &lt;p&gt;In this section, using the Generate Code feature of UML you generate
the Java source code for the UML model that you created in the previous
sections.&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li class="tut"&gt;In the Projects window, right-click the &lt;tt&gt;UMLPrj&lt;/tt&gt; node and choose Generate Code from the pop-up menu.&lt;br /&gt;
  The Generate Code dialog box appears. and specifies the Target Project.&lt;/li&gt; 
    &lt;li class="tut"&gt;Accept the default checkboxes in the Generate Code dialog box.&lt;/li&gt; 
    &lt;li class="tut"&gt;Click OK.&lt;br /&gt;
    The IDE generates the code and the output window displays the progress of the code generation process.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p class="align-center"&gt;&lt;a onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}demoWin=open(this.href,this.target,&amp;quot;resizable=yes,menubar=yes,status=yes,toolbar=no,height=640,width=860,scrollbars=yes&amp;quot;);demoWin.focus();return false" target="demoWin" href="http://www.netbeans.org/kb/60/uml/fe-files/umlgeneratecode.html"&gt;&lt;img class="b-none" src="http://www.netbeans.org/images/articles/uml_fe/flash_demo_button_med.gif" /&gt;&amp;nbsp;View Demo&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="align-center"&gt;&lt;a href="http://www.netbeans.org/kb/60/uml/fe.html#top"&gt;top&lt;/a&gt;&lt;/p&gt; &lt;!-- ======================================================================================= --&gt; 
  &lt;h2&gt;&lt;a name="reveng"&gt;&lt;/a&gt;Continuing Development Using Reverse Engineering&lt;/h2&gt; 
  &lt;p&gt;In this section, you continue with your application development by
modifying the generated source code in the Source editor and using the
Reverse Engineer feature to update your UML model of your application.&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li class="tut"&gt;In the Projects window, expand the &lt;tt&gt;UMLPrj&lt;/tt&gt; &amp;gt; &lt;tt&gt;Model &amp;gt; bankpack &lt;/tt&gt; node.&lt;/li&gt; 
    &lt;li class="tut"&gt;Right-click the &lt;tt&gt;BankAccount&lt;/tt&gt; node and choose Navigate To Source from the pop-up menu.&lt;/li&gt; 
    &lt;li class="tut"&gt;Add the following code to the &lt;tt&gt;deposit&lt;/tt&gt; method in the Source Editor: &lt;br /&gt; 
      &lt;pre class="examplecode"&gt;setBalance(getBalance() + amount);&lt;/pre&gt; 
    &lt;/li&gt; 
    &lt;li class="tut"&gt;Under the &lt;tt&gt;UMLPrj&lt;/tt&gt; &amp;gt; &lt;tt&gt;Model&lt;/tt&gt; &amp;gt; &lt;tt&gt;bankpack&lt;/tt&gt; node in the Projects window, right-click the &lt;tt&gt;AccountTest&lt;/tt&gt; node and choose Navigate To Source from the pop-up menu.&lt;/li&gt; 
    &lt;li class="tut"&gt;Type (or copy and paste) the following code in the Source Editor:&lt;br /&gt; 
      &lt;pre class="examplecode"&gt;public static void main(String[] args) {
Checking myChecking = new Checking();
myChecking.deposit(100);
System.out.println("Checking Balance is: " +
myChecking.getBalance() );
}&lt;/pre&gt;
    This code creates a new &lt;tt&gt;Checking&lt;/tt&gt; object and specifies a deposit of $100, then prints the results.
  
    
    
    &lt;/li&gt; 
    &lt;li class="tut"&gt;Right-click in the Source Editor and choose Format Code.&lt;/li&gt; 
    &lt;li class="tut"&gt;Press Ctrl-S anywhere in the Source Editor to save the changes made to the &lt;tt&gt;AccountTest.java&lt;/tt&gt; source file.&lt;/li&gt; 
    &lt;li class="tut"&gt;Right-click in the Source Editor again and choose Reverse Engineer from the pop-up menu.
    The Reverse Engineer dialog box appears.&lt;/li&gt; 
    &lt;li class="tut"&gt;Select Use Existing UML Project in the Reverse Engineer dialog box and choose &lt;tt&gt;UMLPrj&lt;/tt&gt; as the target project.&lt;/li&gt; 
    &lt;li class="tut"&gt;Click OK to invoke the reverse engineering process.&lt;/li&gt; 
    &lt;li class="tut"&gt;The



popup Model Element Overwrite Authorization dialog appears, requesting
that you confirm your overwriting the AccountTest model element. Click
Yes/ Yes to All.&lt;/li&gt; 
    &lt;li class="tut"&gt;Click the BankClassDiagram tab.
    Notice that the newly entered &lt;tt&gt;main&lt;/tt&gt; method now appears in the &lt;tt&gt;AccountTest&lt;/tt&gt;
class element in the class diagram. By using the Reverse Engineer
feature, the changes made to the Java source project can be reflected
in the corresponding UML model project. &lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p class="align-center"&gt;&lt;a onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}demoWin=open(this.href,this.target,&amp;quot;resizable=yes,menubar=yes,status=yes,toolbar=no,height=640,width=860,scrollbars=yes&amp;quot;);demoWin.focus();return false" target="demoWin" href="http://www.netbeans.org/kb/60/uml/fe-files/umlreverseengin.html"&gt;&lt;img class="b-none" src="http://www.netbeans.org/images/articles/uml_fe/flash_demo_button_med.gif" /&gt;&amp;nbsp;View Demo&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="align-center"&gt;&lt;a href="http://www.netbeans.org/kb/60/uml/fe.html#top"&gt;top&lt;/a&gt;&lt;br /&gt; &lt;!-- ======================================================================================= --&gt; &lt;/p&gt; 
  &lt;h2&gt;&lt;a name="execute"&gt;&lt;/a&gt;Testing Your Work&lt;/h2&gt; 
  &lt;p&gt;Now build and run your project.&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li class="tut"&gt;In the Projects window, right-click the &lt;tt&gt;JavaPrj&lt;/tt&gt; node and choose Build  from the pop-up menu.&lt;/li&gt; 
    &lt;li class="tut"&gt;In the Projects window, right-click the &lt;tt&gt;JavaPrj&lt;/tt&gt; node and choose Run  from the pop-up menu.
  The Run Project dialog box appears.&lt;/li&gt; 
    &lt;li class="tut"&gt;In the Run Project dialog box, click OK to select the &lt;code&gt;bankpack.AccountTest&lt;/code&gt; as the main class.
    The IDE executes the application and displays the following output in the Output window:
      
      
      
      &lt;pre class="examplecode"&gt;Checking Balance is: 100&lt;/pre&gt; 
    &lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;You have now completed the application.&lt;/p&gt; 
  &lt;p class="align-center"&gt;&lt;a onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}demoWin=open(this.href,this.target,&amp;quot;resizable=yes,menubar=yes,status=yes,toolbar=no,height=640,width=860,scrollbars=yes&amp;quot;);demoWin.focus();return false" target="demoWin" href="http://www.netbeans.org/kb/60/uml/fe-files/umlrun.html"&gt;&lt;img class="b-none" src="http://www.netbeans.org/images/articles/uml_fe/flash_demo_button_med.gif" /&gt;&amp;nbsp;View Demo&lt;/a&gt; &lt;/p&gt; 
  &lt;p class="align-center"&gt;&lt;a href="http://www.netbeans.org/kb/60/uml/fe.html#top"&gt;top&lt;/a&gt;&lt;!-- ======================================================================================= --&gt; &lt;/p&gt; 
  &lt;h2&gt;Summary&lt;/h2&gt; 
  &lt;p&gt;In this tutorial, you designed a class diagram for a simple banking application. You learned how to perform the following tasks:&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li class="tut"&gt;Create a UML project&lt;/li&gt; 
    &lt;li class="tut"&gt;Use the UML icons from the Modeling Palette to create classes, interfaces, packages, attributes, and operations&lt;/li&gt; 
    &lt;li class="tut"&gt;Link the classes together with UML associations&lt;/li&gt; 
    &lt;li class="tut"&gt;View the elements that you created in the Diagram editor in the UML project as represented in the Projects window&lt;/li&gt; 
    &lt;li class="tut"&gt;Generate
the source code for the elements created in the Diagram editor in the
UML project and view the generated source in the Source Editor.&lt;/li&gt; 
    &lt;li class="tut"&gt;Use
the Code Generation and reverse engineering features to go back and
forth between modeling and developing code in the Source Editor&lt;/li&gt; 
    &lt;li class="tut"&gt;Compile and execute classes from the Source Editor&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p class="align-center"&gt;&lt;a href="http://www.netbeans.org/kb/60/uml/fe.html#top"&gt;top&lt;/a&gt;&lt;/p&gt; &lt;!-- ======================================================================================== --&gt; 
  &lt;h2&gt;&lt;a name="next_steps"&gt;&lt;/a&gt;Next Steps&lt;/h2&gt; 
  &lt;ul&gt; 
    &lt;li&gt; 
      &lt;p&gt;To learn more about the UML feature, complete the Reverse Engineering tutorial. &lt;/p&gt; 
    &lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/Dq0OXMPm5QY" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/uml_developing_applications</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/getting_started_with_the_netbeans</id>
        <title type="html">Getting Started With the NetBeans IDE BlueJ Plugin</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/gOM9r0_nj7o/getting_started_with_the_netbeans" />
        <published>2008-09-30T09:39:30-07:00</published>
        <updated>2008-09-30T09:39:30-07:00</updated> 
        <category term="/Applications" label="Applications" />
        <category term="bluej" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ide" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java-se" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">This article gets you started using the NetBeans BlueJ plugin.
First, you'll discover how easy it is to load existing projects and
edit them, and then you'll learn to create a new project and use
drag-and-drop features to create a graphical user interface (GUI).</summary>
        <content type="html">&lt;p&gt;&lt;i&gt;By &lt;a href="http://java.sun.com/features/authors.html#nourie"&gt;Dana Nourie&lt;/a&gt;&lt;/i&gt;&lt;/p&gt; 
  &lt;p&gt; &lt;a target="_blank" href="http://www.bluej.org/"&gt;BlueJ&lt;/a&gt; is an
integrated development environment (IDE) specifically designed for
teaching students object-oriented programming using the Java
programming language. Although BlueJ covers the introductory phase of
learning to program, the &lt;a target="_blank" href="http://www.netbeans.org/"&gt;NetBeans IDE&lt;/a&gt;
offers powerful tools for professional developers. Taking the
inevitable step from one into the other has been a difficult barrier
for students -- until now.
&lt;/p&gt; 
  &lt;p&gt;
The collaboration of the NetBeans IDE and BlueJ teams has resulted in the &lt;a target="_blank" href="http://www.bluej.org/netbeans/"&gt;NetBeans BlueJ plugin&lt;/a&gt;.
This tool creates a smooth migration path for students learning the
Java programming language from beginner's stage through to the use of
professional development tools. In addition, this IDE provides a
seamless path for students to switch from educational tools into a
full-featured, professional IDE. The BlueJ plugin makes the transition
between these two environments easier for students and teachers. Even
if you are not familiar with BlueJ, the NetBeans BlueJ plugin is a
great way to learn to use an IDE.
&lt;/p&gt; 
  &lt;p&gt;This article gets you started using the NetBeans BlueJ plugin.
First, you'll discover how easy it is to load existing projects and
edit them, and then you'll learn to create a new project and use
drag-and-drop features to create a graphical user interface (GUI).
&lt;/p&gt; 
  &lt;p&gt;Developers unfamiliar with the BlueJ software will also learn
everything they need to get started with this IDE and will benefit by
following along with the examples.
&lt;/p&gt; 
  &lt;p&gt;
To follow the descriptions and code examples, download the &lt;a target="_blank" href="http://www.netbeans.org/"&gt;NetBeans IDE&lt;/a&gt; version 6.1 or later. In addition, download the BlueJ project &lt;a href="http://java.sun.com/developer/technicalArticles/tools/bluej/source/calculator.zip"&gt;Calculator.zip&lt;/a&gt;,
which the first part of this article uses as an example. In the second
part of the article, you create a small application called Address Book
to learn various other IDE features.
&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/tools/bluej/"&gt;Read the article . . . &lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;p&gt;*************&lt;/p&gt; 
  &lt;p&gt;Learn about &lt;a href="/SLevents/"&gt;Sun Microsystems events in Second Life &lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;*************&lt;/p&gt; 
  &lt;p&gt;Discover resources for &lt;a href="http://developers.sun.com/students/"&gt;Student Developers&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;*************&lt;/p&gt; 
  &lt;p&gt;Join developers and &lt;a href="/DanaInGeeksville/entry/virtual_classrooms_in_geeksville"&gt;students in virtual learning&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;*************&lt;/p&gt; 
  &lt;p&gt;&lt;a href="/DanaInGeeksville/entry/learning_in_second_life"&gt;Learning in Second Life&lt;/a&gt;&lt;br /&gt;&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/gOM9r0_nj7o" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/getting_started_with_the_netbeans</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/welcome_to_the_mac_java</id>
        <title type="html">Welcome to the Mac Java Community</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/l2K2CT3zYPY/welcome_to_the_mac_java" />
        <published>2008-09-18T10:12:48-07:00</published>
        <updated>2008-09-18T10:16:34-07:00</updated> 
        <category term="/Community" label="Community" />
        <category term="community" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="macs" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">&lt;p&gt;
This community is for all things Macintosh and Java related. That may
mean developing Java code on the Mac, with the various tools available
to Mac developers... or it may mean running your Java code on the Mac,
using available technologies to deliver a great experience to your
Mac-based users... or even tying into technologies like Cocoa. If you
have Mac-specific projects, weblogs, questions, or advice, this is the
place to be.</summary>
        <content type="html">&lt;p&gt;&lt;a href="http://community.java.net/mac/"&gt;This community&lt;/a&gt; is for all things Macintosh and Java related. That may
mean developing Java code on the Mac, with the various tools available
to Mac developers... or it may mean running your Java code on the Mac,
using available technologies to deliver a great experience to your
Mac-based users... or even tying into technologies like Cocoa. If you
have Mac-specific projects, weblogs, questions, or advice, this is the
place to be.
&lt;/p&gt; 
  &lt;p&gt;Here are some of the items you'll find on this Mac Java&amp;nbsp; Community page:&lt;/p&gt; 
  &lt;p&gt;&lt;br /&gt; &lt;a href="http://weblogs.java.net/blog/fabriziogiudici/archive/2008/09/bye_bye_mac_os.html"&gt; &lt;img hspace="6" height="68" border="0" align="left" width="99" vspace="3" alt="Fabrizio Giudici" src="http://community.java.net/images/people/fabrizio_giudici.jpg" /&gt; &lt;/a&gt; &lt;span class="big"&gt;&lt;b&gt;&lt;a href="http://weblogs.java.net/blog/fabriziogiudici/archive/2008/09/bye_bye_mac_os.html"&gt;Bye bye, Mac OS X?&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
If you follow my blog, you know that I've a bad attitude towards
Apple's gear, even though (or just because?) I've been an Apple user
for three years now. I've been frustrated by a) lack of support for
Java updates, b) Mac OS X not performing as I need (Linux on the same
hardware box is faster) and c) the scarce quality of my MacBook Pro
(first generation). So, this week I can officially say that - at the
moment - Mac OS X is no more my primary operating system. &amp;nbsp;&lt;span class="rightarrowblue"&gt;—&lt;/span&gt; &lt;a href="http://weblogs.java.net/blog/fabriziogiudici/"&gt;
Fabrizio&amp;nbsp;Giudici&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;p&gt;&lt;img src="http://images.apple.com/uk/education/whyapple/images/open_pic.gif" /&gt; &lt;span class="big"&gt;&lt;b&gt;&lt;a href="http://landonf.bikemonkey.org/code/java/SoyLatte_Meets_OpenJDK.20080819.html"&gt;OpenJDK 7 for Mac OS X&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Landon Fuller has &lt;a href="http://landonf.bikemonkey.org/code/java/SoyLatte_Meets_OpenJDK.20080819.html"&gt;announced&lt;/a&gt; that OpenJDK7 is now runnable on Mac OS X (and the BSDs) as part of the &lt;a href="http://openjdk.java.net/projects/bsd-port/"&gt; OpenJDK BSD Port&lt;/a&gt; project, culminating the efforts of his &lt;a href="http://landonf.bikemonkey.org/static/soylatte/"&gt;SoyLatte&lt;/a&gt;
project to bring the latest open-source JDK to the Mac. &amp;quot;The move to
OpenJDK -- and Sun's re-licensing of the code under the GPL license --
opens the project to any interested contributor.&amp;quot; He suggests there's
more work to do with &lt;a href="http://www.sun.com/software/opensource/java/faq.jsp#k1"&gt;JCK&lt;/a&gt; conformance testing, enabling dtrace support, PowerPC and ARM support via the &lt;a href="http://openjdk.java.net/projects/zero/"&gt;Zero&lt;/a&gt; project, Core Audio-based sound support, and more.  To facilitate user testing, Landon has also posted &lt;a href="http://landonf.bikemonkey.org/code/java/OpenJDK_7_Binaries.20080820.html"&gt;OpenJDK 7 binaries&lt;/a&gt; for Darwin (and, by extension, for Mac OS X).&amp;nbsp; &lt;/p&gt; 
  &lt;p&gt;&lt;img src="/theaquarium/resource/VisualVM-140_105px.jpg" /&gt; &lt;span class="big"&gt;&lt;b&gt;&lt;a href="/theaquarium/entry/running_visualvm_on_macos_x"&gt;Running VisualVM on MacOS X&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt; &lt;a href="/theaquarium"&gt;The Aquarium&lt;/a&gt; points out a tip for &lt;a href="/theaquarium/entry/running_visualvm_on_macos_x"&gt;Running VisualVM on MacOS X&lt;/a&gt;:  &amp;quot;I wrote about VisualVM yesterday
(&lt;a href="/theaquarium/entry/visualvm_1_0_now_available"&gt;entry&lt;/a&gt;)
but I had missed
&lt;a href="/octav/entry/visualvm_now_part_of_the"&gt;Octavian's Introduction&lt;/a&gt;
where he gives instructions on how to use
&lt;a href="http://visualvm.dev.java.net/"&gt;VisualVM&lt;/a&gt; on MacOS X.
As a reminder,
to run the VisualVM client you need a recent JVM, so you will need to use the
&lt;a href="http://developer.apple.com/java/download/"&gt;latest JVM from Apple&lt;/a&gt;,
but the app can run in a variety of JVMs,
remote or local to VisualVM.
VisualVM can even save the data into a snapshot and process it offline.&amp;quot; 
&lt;/p&gt; 
  &lt;p&gt;&lt;img src="http://www.apple.com/downloads/macosx/apple/macosx_updates/images/macosx10411comboupdateppc_20071114153049-thumb.jpg" /&gt; &lt;span class="big"&gt;&lt;b&gt;&lt;a href="http://www.apple.com/support/downloads/javaformacosx105update1.html"&gt;Java SE 6 for Mac OS X 10.5.2&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Available via Software Update, &lt;a href="http://www.apple.com/support/downloads/javaformacosx105update1.html"&gt;Java for Mac OS X 10.5 Update 1&lt;/a&gt;
adds Java SE 6 version 1.6.0_05 to your Mac. This version of Java is
only for Mac OS X v10.5.2 and later, and only runs on 64-bit Intel
machines. Developers may want to check out the &lt;a href="http://developer.apple.com/releasenotes/Java/JavaLeopardRN/Introduction/chapter_1_section_1.html"&gt;release notes&lt;/a&gt;,
which detail major new features including an API to work with the Dock
icon (getting and setting the image, adding a badge, setting a dock
menu, etc.), the ability to provide document-modal dialog sheets,
support for Java DTrace probes, AppleScript as a supported language to
the javax.script API, and more.&amp;nbsp; &lt;/p&gt; 
  &lt;p&gt;And there is a whole lot more. Visit &lt;a href="http://community.java.net/mac/"&gt;Mac Java Community&lt;/a&gt; today!&lt;/p&gt; 
  &lt;p&gt;****************************&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;p class="entryTitle"&gt;&lt;a href="/DanaInGeeksville/entry/virtual_classrooms_in_geeksville"&gt;Virtual Classrooms in Geeksville&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="entryContent"&gt; 
                            Over the last few years I've been spending a lot of time online
learning a whole lot of stuff. There is no better tool to teach us
about computing, programming languages, and software than the computer
itself. Of course, I realize it's not the computer but the site or the
program, but virtual learning is hugely successful and for good
reasons. And it's not limited to computer topics, thank goodness.[&lt;a class="readmore" href="/DanaInGeeksville/entry/virtual_classrooms_in_geeksville"&gt;Read More&lt;/a&gt;]
                    &lt;/p&gt; 
  &lt;p class="entryTitle"&gt;&lt;a href="/DanaInGeeksville/entry/learning_in_second_life"&gt;Learning in Second Life&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="entryContent"&gt; &lt;a href="http://www.secondlife.com/"&gt;Second Life (SL)&lt;/a&gt; is easy to
misunderstand, and many people have the wrong idea that it is some kind
of game environment, or a place where people just chat and act silly.
On the contrary, Second Life has many places of learning from Science
Friday, to Buddhist meditations, to technical seminars[&lt;a class="readmore" href="/DanaInGeeksville/entry/learning_in_second_life"&gt;Read More&lt;/a&gt;]
                    &lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/l2K2CT3zYPY" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/welcome_to_the_mac_java</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/a_personal_data_storage_application</id>
        <title type="html">A Personal Data Storage Application With Embedded Java DB</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/yN76t-J3sSA/a_personal_data_storage_application" />
        <published>2008-09-05T09:57:49-07:00</published>
        <updated>2008-09-05T09:57:49-07:00</updated> 
        <category term="/Applications" label="Applications" />
        <category term="databases" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="db" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="desktop" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">In this application, we will use NetBeans to create a simple desktop
application to store info on your personal music collection. We will
use Java DB, which has an embedded mode so that it can be packaged
within the application. The application will also make use of the Beans
Binding library and the Java Persistence API.</summary>
        <content type="html">&lt;p&gt;&lt;a href="http://weblogs.java.net/blog/pkeegan/archive/2008/08/a_personal_data_1.html"&gt;by Patrick Keegan&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;Most of the tutorials I've run across talk about creating
applications that connect with a database that is managed from a
server. This is appropriate for most business applications. However,
sometimes you might want to create a more portable application that
carries its own data with it, such as an application in which a user
manages personal data.&lt;/p&gt; 
  &lt;p&gt;In this application, we will use NetBeans to create a simple desktop
application to store info on your personal music collection. We will
use Java DB, which has an embedded mode so that it can be packaged
within the application. The application will also make use of the Beans
Binding library and the Java Persistence API.&lt;/p&gt; 
  &lt;h3&gt;Setting Up the Database&lt;/h3&gt; 
  &lt;p&gt;First we will create a &amp;quot;connection&amp;quot;. This isn't a connection to a
real database but it gives us a place to create a database structure,
which we can then use to generate application code.&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;In NetBeans, open the Services window and expand the Drivers node.&lt;/li&gt; 
    &lt;li&gt;Right-click Java DB (Embedded) and choose Connect Using.
&lt;/li&gt;&lt;img height="212" width="283" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-connectusing.png" alt="embedded-connectusing.png" /&gt; 
    &lt;li&gt;For Database URL, enter &lt;code&gt;jdbc:derby:Recordings;create=true&lt;/code&gt;.&lt;/li&gt; 
    &lt;li&gt;For User Name, enter &lt;code&gt;APP&lt;/code&gt;.&lt;/li&gt; 
    &lt;li&gt;Enter whatever you wish the password and click OK.
&lt;img height="359" width="527" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-dbconnwiz.png" alt="embedded-dbconnwiz.png" /&gt;&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;Now we need to generate the database structure. We will do so by
executing an SQL script that defines a single table and its columns.&lt;/p&gt; 
  &lt;p&gt;To generate the database structure:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;In the Services window, scroll down to the &lt;code&gt;jdbc:derby:Recordings;create=true&lt;/code&gt; node, right-click, and choose Execute Command.
&lt;img height="118" width="401" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-executecommand.png" alt="embedded-executecommand.png" /&gt;&lt;/li&gt; 
    &lt;li&gt;Paste the following code into the editor.

      
      
      &lt;pre&gt;create table "APP".RECORD
(
	ARTIST VARCHAR(30) NOT NULL,
	TITLE VARCHAR(30) NOT NULL PRIMARY KEY,
	FORMAT VARCHAR(30) NOT NULL,
	RATING INTEGER,
	CONDITION VARCHAR(10),
	COMMENTS VARCHAR(30)
)


&lt;/pre&gt; 
    &lt;/li&gt; 
    &lt;li&gt;Click the Run SQL button to execute the command.
&lt;/li&gt;&lt;img height="113" width="257" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-executescript.png" alt="embedded-executescript.png" /&gt; 
    &lt;li&gt;Right-click the &lt;code&gt;jdbc:derby:Recordings;create=true&lt;/code&gt; node and choose Refresh.&lt;/li&gt; 
    &lt;li&gt;Expand the node and then expand the Tables node. 
&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;h3&gt;Creating the Application&lt;/h3&gt; 
  &lt;p&gt;With the database structure set up, we can now use the Java Desktop
Application project template to create a basic CRUD application based
on that structure.&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Choose File | New Project.&lt;/li&gt; 
    &lt;li&gt;In the wizard select the Java | Java Desktop Application template.

&lt;img height="427" width="567" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-javadesktop.png" alt="embedded-javadesktop.png" /&gt;&lt;/li&gt; 
    &lt;li&gt;In the Name and Location page of the wizard, select the Database Application skeleton.
&lt;img height="389" width="580" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-wiznamelocation.png" alt="embedded-wiznamelocation.png" /&gt;&lt;/li&gt; 
    &lt;li&gt;In the Master Table page of the wizard, select the connection for the Recordings database.
&lt;img height="384" width="633" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-wizmastertable.png" alt="embedded-wizmastertable.png" /&gt;&lt;/li&gt; 
    &lt;li&gt;In the Detail Options page, click Finish.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;Once you complete the wizard, you have a basic CRUD application that
should be ready to build and run. Here is how the application looks in
the Design view of the GUI Builder:&lt;/p&gt; &lt;img height="456" width="456" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-designview.png" alt="embedded-designview.png" /&gt; 
  &lt;h3&gt;Building, Testing, and Distributing the Application&lt;/h3&gt; 
  &lt;p&gt;Before building and running, make sure that you have all of the necessary libraries by expanding the project's Libraries node.&lt;/p&gt; &lt;img height="232" width="289" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-libraries.png" alt="embedded-libraries.png" /&gt; 
  &lt;p&gt;You should see libraries for the Swing Application Framework, Beans
Binding, TopLink (which contains classes from the Java Persistence
API), and Derby (Java DB). Depending on your setup, it might happen
that TopLink and Derby are not added. If those libraries are not
listed, you need to add the libraries manually. The TopLink library is
available within the IDE's list of libraries. You can get the Derby JAR
file from an installation of JDK 6, Glassfish, or from a Java DB or
Derby standalone installation.&lt;/p&gt; 
  &lt;p&gt;&lt;b&gt;To add the TopLink library:&lt;/b&gt;&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Right-click the Libraries node and choose Add Library.&lt;/li&gt; 
    &lt;li&gt;From the Available Libraries list, add TopLink Essentials.&lt;/li&gt; 
  &lt;/ol&gt; &lt;img height="124" width="234" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-addlibrary.png" alt="embedded-addlibrary.png" /&gt; 
  &lt;p&gt;&lt;b&gt;To add derby.jar:&lt;/b&gt;&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Right-click the Libraries node and choose Add JAR/Folder.&lt;/li&gt; 
    &lt;li&gt;Navigate to your Derby/Java DB installation and select derby.jar. (I used the copy I found in &lt;code&gt;C:\Program Files\glassfish-v2ur2\javadb\lib&lt;/code&gt;, but you might have it as part of your JDK.)&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;&lt;b&gt;To build and test run the project:&lt;/b&gt;&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Press F11 to build the project. (If this project is not your main
project, right-click the project's node in the Projects window and
choose Build.)&lt;/li&gt; 
    &lt;li&gt;Press F6 to run the project in the IDE. (If this project is not
your main project, right-click the project's node in the Projects
window and choose Run.)&lt;/li&gt; 
    &lt;li&gt;In the running application, add a few records and save them.&lt;/li&gt; 
  &lt;/ol&gt; &lt;img height="421" width="416" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-runningapp.png" alt="embedded-runningapp.png" /&gt; 
  &lt;p&gt;The database is created and saved in your project directory. You can
glimpse the database files that were created in the test run by opening
the Files window and expanding the node for your project. &lt;/p&gt; &lt;img height="333" width="177" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-fileswindow.png" alt="embedded-fileswindow.png" /&gt; 
  &lt;p&gt;You'll notice that there is a sub-folder called Recordings (based on the database name) which contains the database files. &lt;/p&gt; 
  &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; If you run the application directly from
dist/Recordings.jar, the database once again will be empty. When you
add records, the database files will be created in a location that
depends conventions of your operating system. I run on Vista, and so my
database files are created in the VirtualStore folder of my Windows
user directory.&lt;/p&gt; 
  &lt;p&gt;You can distribute the application by zipping up the project's dist
folder and giving it to the user. The dist folder contains the
application's main JAR file, Recordings.jar, and the &lt;code&gt;lib&lt;/code&gt; folder. The  &lt;code&gt;lib&lt;/code&gt; folder contains various libraries essential for the project, including &lt;code&gt;derby.jar&lt;/code&gt;, which contains pretty much all of Java DB (which is just 2.2 MB).&lt;/p&gt; &lt;img height="255" width="246" src="http://weblogs.java.net/blog/pkeegan/archive/embedded-dist.png" alt="embedded-dist.png" /&gt; 
  &lt;p&gt;Once they unzip the file, they can run the Recordings.jar file,
either by double-clicking it (if they have the .jar file extension
associated with Java on their system) or by running it from the command
line with the command &lt;code&gt;java -jar Recordings.jar&lt;/code&gt;.&lt;/p&gt; 
  &lt;p&gt;So there you have it - a portable database application with no hand coding.&lt;/p&gt; 
  &lt;h3&gt;Bonus Note on the Database Structure&lt;/h3&gt; 
  &lt;p&gt;For purposes of quickly showing how to use Java DB as an embedded
db, I used and over-simplified database structure, especially regarding
the primary key. So that you can you can have multiple entries for the
same artist, you might want to create an auto-generated identity field
and make that the primary key instead. For example:&lt;/p&gt; 
  &lt;pre&gt;create table "APP".RECORD
(
    ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
    ARTIST VARCHAR(30) NOT NULL,
    TITLE VARCHAR(30) NOT NULL PRIMARY KEY,
    FORMAT VARCHAR(30) NOT NULL,
    RATING INTEGER,
    CONDITION VARCHAR(10),
    COMMENTS VARCHAR(30)
);

ALTER TABLE "APP".RECORD
    ADD CONSTRAINT CONTACTS2008_PK Primary Key (ID);
&lt;/pre&gt; 
  &lt;p&gt;Then after creating the project, you would need to modify the Recordings entity class by inserting the line &lt;code&gt;@GeneratedValue(strategy=GenerationType.IDENTITY)&lt;code&gt;@Id&lt;/code&gt;. &lt;/code&gt;&lt;/p&gt; 
  &lt;p&gt;***********************&lt;/p&gt; 
  &lt;p class="entryTitle"&gt;&lt;a href="/DanaInGeeksville/entry/learning_in_second_life"&gt;Learning in Second Life&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="entryContent"&gt; &lt;a href="http://www.secondlife.com/"&gt;Second Life (SL)&lt;/a&gt; is easy to
misunderstand, and many people have the wrong idea that it is some kind
of game environment, or a place where people just chat and act silly.
On the contrary, Second Life has many places of learning from Science
Friday, to Buddhist meditations, to technical seminars[&lt;a class="readmore" href="/DanaInGeeksville/entry/learning_in_second_life"&gt;Read More&lt;/a&gt;]
                    &lt;/p&gt; 
  &lt;p&gt;******************&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;p class="entryTitle"&gt;&lt;a href="/DanaInGeeksville/entry/virtual_classrooms_in_geeksville"&gt;Virtual Classrooms in Geeksville&lt;/a&gt;&lt;/p&gt; 
  &lt;p class="entryContent"&gt; 
                            Over the last few years I've been spending a lot of time online
learning a whole lot of stuff. There is no better tool to teach us
about computing, programming languages, and software than the computer
itself. Of course, I realize it's not the computer but the site or the
program, but virtual learning is hugely successful and for good
reasons. And it's not limited to computer topics, thank goodness.[&lt;a class="readmore" href="/DanaInGeeksville/entry/virtual_classrooms_in_geeksville"&gt;Read More&lt;/a&gt;]
                    &lt;/p&gt; 
  &lt;p&gt;********************&lt;/p&gt; 
  &lt;p&gt;&lt;a href="/students/"&gt;Participate in MySQL-GlassFish Student Contest and Win $500&lt;/a&gt; &lt;br /&gt;&lt;/p&gt; 
  &lt;p&gt; Use MySQL database and GlassFish application server to develop a web
application and write a review for...&lt;br /&gt; &lt;/p&gt; 
  &lt;ul style="color: #0000ff;"&gt; 
    &lt;li&gt;A chance to win a grand prize of &lt;span style="font-weight: bold; color: #ff0000;"&gt;$500&lt;/span&gt; in Visa
debit card, and&lt;/li&gt; 
    &lt;li&gt;&lt;span style="font-weight: bold;"&gt;Five&lt;/span&gt; chances to win
a prize of &lt;span style="font-weight: bold; color: #ff0000;"&gt;$250&lt;/span&gt;
in Visa debit card&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;p&gt; &lt;br /&gt;&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/yN76t-J3sSA" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/a_personal_data_storage_application</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/java_se_application_design_with</id>
        <title type="html">Java SE Application Design With MVC</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/s76ygV0hR5s/java_se_application_design_with" />
        <published>2008-08-27T12:44:26-07:00</published>
        <updated>2008-08-27T12:44:26-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="applications" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="development" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn what MVC is, the interaction between components, and issues with application design.</summary>
        <content type="html">&lt;table width="100%" cellspacing="0" cellpadding="0" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td valign="top" class="smaller"&gt;&lt;i&gt;By &lt;a href="http://java.sun.com/features/authors.html#eckstein"&gt;Robert Eckstein&lt;/a&gt;,&amp;nbsp;
&lt;/i&gt;&lt;/td&gt; 
        &lt;td width="10"&gt; &lt;/td&gt; 
        &lt;td valign="bottom" align="right"&gt; 
          &lt;div class="sitelinks" style="padding: 0px;"&gt; 
            &lt;table cellspacing="0" cellpadding="0" border="0"&gt; 
              &lt;tbody&gt; 
                &lt;tr&gt; &lt;!--
&lt;td valign="bottom" align="right"&gt;&lt;img src="/im/ic_email.gif" width="14" height="12" border="0" hspace="4" vspace="1" alt=" " /&gt;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="#{link placeholder}"&gt;E-mail&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="/jsp_utils/PrintPage.jsp" target="printFriendlyView" onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}openPopup('','printFriendlyView',710,650,'no',1,1,0,0,0,0); return true;"&gt;&lt;img src="/im/ic_print.gif" width="14" height="12" alt="Print-friendly Version" border="0" hspace="4" /&gt;Print-friendly Version&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;img src="/im/ic_download_thin.gif" width="9" height="14" hspace="4" border="0" alt=" " /&gt;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="#{link placeholder}"&gt;Download&lt;/a&gt;&lt;/td&gt;
--&gt; &lt;/tr&gt; 
              &lt;/tbody&gt; 
            &lt;/table&gt; 
          &lt;/div&gt; &lt;br /&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;!--  END VCD4 BYLINE AND TOOLS  --&gt; 
  &lt;p&gt;&lt;b&gt;Contents&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
- &lt;a href="http://java.sun.com/developer/technicalArticles/javase/mvc/#1"&gt;What Is Model-View-Controller (MVC)?&lt;/a&gt; &lt;br /&gt;
- &lt;a href="http://java.sun.com/developer/technicalArticles/javase/mvc/#2"&gt;Interaction Between MVC Components &lt;/a&gt;&lt;br /&gt;
- &lt;a href="http://java.sun.com/developer/technicalArticles/javase/mvc/#3"&gt;Modifying the MVC Design&lt;/a&gt; &lt;br /&gt;
- &lt;a href="http://java.sun.com/developer/technicalArticles/javase/mvc/#4"&gt;Using the Modified MVC&lt;/a&gt; &lt;br /&gt;
- &lt;a href="http://java.sun.com/developer/technicalArticles/javase/mvc/#5"&gt;Issues With Application Design&lt;/a&gt; &lt;br /&gt;
- &lt;a href="http://java.sun.com/developer/technicalArticles/javase/mvc/#6"&gt;Common Swing Component Listeners&lt;/a&gt; &lt;br /&gt;
- &lt;a href="http://java.sun.com/developer/technicalArticles/javase/mvc/#7"&gt;Conclusion&lt;/a&gt; &lt;br /&gt;
- &lt;a href="http://java.sun.com/developer/technicalArticles/javase/mvc/#8"&gt;For More Information&lt;/a&gt;&lt;/p&gt; &lt;!-- BEGIN VCD6 ARTICLE COMPONENT --&gt; &lt;a name="1"&gt;&lt;/a&gt; 
  &lt;div&gt;&lt;b&gt;What Is Model-View-Controller (MVC)?&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;If you've programmed with graphical user interface (GUI) libraries
in the past 10 years or so, you have likely come across the
model-view-controller (MVC) design. MVC was first introduced by
&lt;a href="http://en.wikipedia.org/wiki/Trygve_Reenskaug" target="_blank"&gt;Trygve
Reenskaug&lt;/a&gt;, a Smalltalk developer at the Xerox Palo Alto Research
Center in 1979, and helps to decouple data access and business logic
from the manner in which it is displayed to the user. More precisely,
MVC can be broken down into three elements:
&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt; &lt;b&gt;Model&lt;/b&gt; - The model represents data and the rules that
govern access to and updates of this data. In enterprise software, a
model often serves as a software approximation of a real-world
process.
&lt;/li&gt; 
    &lt;li&gt; &lt;b&gt;View&lt;/b&gt; - The view renders the contents of a model. It
specifies exactly how the model data should be presented. If the
model data changes, the view must update its presentation as needed.
This can be achieved by using a &lt;i&gt;push model&lt;/i&gt;, in which the view
registers itself with the model for change notifications, or a &lt;i&gt;pull
model&lt;/i&gt;, in which the view is responsible for calling the model
when it needs to retrieve the most current data.&lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;Controller&lt;/b&gt; - The controller translates the user's
interactions with the view into actions that the model will perform.
In a stand-alone GUI client, user interactions could be button
clicks or menu selections, whereas in an enterprise web application,
they appear as &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt; HTTP requests.
Depending on the context, a controller may also select a new view --
for example, a web page of results -- to present back to the user.&lt;/li&gt; 
  &lt;/ul&gt;
Although different architectures allow the three components to
interact in different ways, Figure 1 shows a common implementation of
the MVC design pattern, as shown in the &lt;a href="http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/app-arch/app-arch2.html"&gt;Sun
BluePrints Catalog&lt;/a&gt;.

&lt;br /&gt;&lt;br /&gt; &lt;!-- END VCD6 ARTICLE COMPONENT --&gt; &lt;!-- BEGIN VCD6 ARTICLE COMPONENT, variation 1 with embedded image  --&gt; 
  &lt;table width="200" cellspacing="0" cellpadding="2" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center" class="grey3"&gt;&lt;img height="385" width="550" border="0" src="http://java.sun.com/developer/technicalArticles/javase/mvc/images/Figure1.gif" alt="Figure1: A Common MVC Implementation" /&gt; 
          &lt;div class="pad3"&gt; &lt;span class="dkcaption1"&gt; &lt;b&gt;Figure1.&lt;/b&gt; &lt;i&gt;A Common MVC Implementation&lt;/i&gt; &lt;/span&gt;&lt;/div&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;!-- END VCD6 ARTICLE COMPONENT, variation 1 with embedded image  --&gt; &lt;!-- BEGIN VCD6 ARTICLE COMPONENT --&gt; &lt;a name="2"&gt;&lt;/a&gt; 
  &lt;div&gt;&lt;b&gt;Interaction Between MVC Components&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;This section will take a closer look at one way to implement
Figure 1 in the context of an application in the &lt;a href="http://java.sun.com/javase/"&gt;Java
Platform, Standard Edition 6&lt;/a&gt; (Java SE 6). Once the model, view,
and controller objects are instantiated, the following occurs:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;The view registers as a listener on the model. Any
changes to the underlying data of the model immediately result
in a broadcast change notification, which the view receives. This is
an example of the push model described earlier. Note that the model
is not aware of the view or the controller -- it simply broadcasts
change notifications to all interested listeners.
&lt;/li&gt; 
    &lt;li&gt;The controller is bound to the view. This typically means
that any user actions that are performed on the view will invoke a
registered listener method in the controller class.
&lt;/li&gt; 
    &lt;li&gt;The controller is given a reference to the underlying model.
&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;Once a user interacts with the view, the following actions occur:
&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;The view recognizes that a GUI action -- for example, pushing
a button or dragging a scroll bar -- has occurred, using a listener
method that is registered to be called when such an action occurs.
&lt;/li&gt; 
    &lt;li&gt;The view calls the appropriate method on the controller.
&lt;/li&gt; 
    &lt;li&gt;The controller accesses the model, possibly updating it in a
way appropriate to the user's action.
&lt;/li&gt; 
    &lt;li&gt;If the model has been altered, it notifies interested
listeners, such as the view, of the change. In some architectures,
the controller may also be responsible for updating the view. This
is common in Java technology-based enterprise applications.
&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;Figure 2 shows this interaction in more detail.&lt;/p&gt; &lt;!-- END VCD6 ARTICLE COMPONENT --&gt; &lt;!-- BEGIN VCD6 ARTICLE COMPONENT, variation 1 with embedded image  --&gt; 
  &lt;table width="200" cellspacing="0" cellpadding="2" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center" class="grey3"&gt;&lt;img height="450" width="600" border="0" src="http://java.sun.com/developer/technicalArticles/javase/mvc/images/Figure2.gif" alt="Figure 2: A Java SE Application Using MVC" /&gt; 
          &lt;div class="pad3"&gt; &lt;span class="dkcaption1"&gt; &lt;b&gt;Figure 2.&lt;/b&gt; &lt;i&gt;A Java SE Application Using MVC&lt;/i&gt; &lt;/span&gt;&lt;/div&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;As this article mentioned earlier, the model does not carry a
reference to the view but instead uses an event-notification model to
notify interested parties of a change. One of the consequences of
this powerful design is that the many views can have the same
underlying model. When a change in the data model occurs, each view
is notified by a property change event and can update itself
accordingly. For example, Figure 3 shows two views that use the same
data model.
&lt;/p&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;!-- END VCD6 ARTICLE COMPONENT, variation 1 with embedded image  --&gt; &lt;!-- BEGIN VCD6 ARTICLE COMPONENT, variation 1 with embedded image  --&gt; 
  &lt;table width="200" cellspacing="0" cellpadding="2" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center" class="grey3"&gt;&lt;img height="450" width="600" border="0" src="http://java.sun.com/developer/technicalArticles/javase/mvc/images/Figure3.gif" alt="Figure 3: Multiple Views Using the Same Model" /&gt; 
          &lt;div class="pad3"&gt; &lt;span class="dkcaption1"&gt; &lt;b&gt;Figure 3.&lt;/b&gt; &lt;i&gt;Multiple Views Using the Same Model&lt;/i&gt; &lt;/span&gt;&lt;/div&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;!-- END VCD6 ARTICLE COMPONENT, variation 1 with embedded image  --&gt; &lt;!-- BEGIN VCD6 ARTICLE COMPONENT --&gt; &lt;a name="3"&gt;&lt;/a&gt; 
  &lt;div&gt;&lt;b&gt;Modifying the MVC Design&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;A more recent implementation of the MVC design places the
controller between the model and the view. This design, which is
common in the &lt;a href="http://developer.apple.com/cocoa/" target="_blank"&gt;Apple
Cocoa&lt;/a&gt; framework, is shown in Figure 4.&lt;/p&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;!-- END VCD6 ARTICLE COMPONENT --&gt; &lt;!-- BEGIN VCD6 ARTICLE COMPONENT, variation 1 with embedded image  --&gt; 
  &lt;table width="200" cellspacing="0" cellpadding="2" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center" class="grey3"&gt;&lt;img height="400" width="600" border="0" src="http://java.sun.com/developer/technicalArticles/javase/mvc/images/Figure4.gif" alt="Figure 4: An MVC Design Placing the Controller Between the Model and the View" /&gt; 
          &lt;div class="pad3"&gt; &lt;span class="dkcaption1"&gt; &lt;b&gt;Figure 4.&lt;/b&gt; &lt;i&gt;An MVC Design Placing the Controller Between the Model and the View&lt;/i&gt; &lt;/span&gt;&lt;/div&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;!-- END VCD6 ARTICLE COMPONENT, variation 1 with embedded image  --&gt; &lt;!-- BEGIN VCD6 ARTICLE COMPONENT --&gt; 
  &lt;p&gt;The primary difference between this design and the more
traditional version of MVC is that the notifications of state changes
in model objects are communicated to the view &lt;i&gt;through&lt;/i&gt; the
controller. Hence, the controller mediates the flow of data between
model and view objects in both directions. View objects, as always,
use the controller to translate user actions into property updates on
the model. In addition, changes in model state are communicated to
view objects through an application's controller objects.
&lt;/p&gt; 
  &lt;p&gt;Thus, when all three components are instantiated, the view and the
model will both register with the controller. Once a user interacts
with the view, the events are nearly identical:
&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;The view recognizes that a GUI action -- for example, pushing
a button or dragging a scroll bar -- has occurred, using a listener
method that is registered to be called when such an action occurs.
&lt;/li&gt; 
    &lt;li&gt;The view calls the appropriate method on the controller.
&lt;/li&gt; 
    &lt;li&gt;The controller accesses the model, possibly updating it in a
way appropriate to the user's action.
&lt;/li&gt; 
    &lt;li&gt;If the model has been altered, it notifies interested
listeners of the change. However, in this case, the change is sent
to the controller.
&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;
Why adopt this design? Using this modified MVC helps to more completely
decouple the model from the view. In this case, the controller can
dictate the model properties that it expects to find in one or more
models registered with the controller. In addition, it can also provide
the methods that effect the model's property changes for one or more
views that are registered with it.
&lt;/p&gt; &lt;!-- END VCD6 ARTICLE COMPONENT --&gt; &lt;!-- BEGIN VCD6 ARTICLE COMPONENT --&gt; &lt;a name="4"&gt;&lt;/a&gt; 
  &lt;div&gt;&lt;b&gt;Using the Modified MVC&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;This section of the article shows you how to put this design into
practice, starting with the model. Suppose that you want to paint
some text using a simple display model with five properties. Code
Sample 1 shows a simple component  that you can use to create such a
model.
&lt;/p&gt; &lt;!-- END VCD6 ARTICLE COMPONENT --&gt; 
  &lt;p&gt;&lt;b&gt;Code Sample 1&lt;/b&gt;&lt;/p&gt; 
  &lt;div style="overflow: auto; width: 600px;"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="10" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt; 
            &lt;pre&gt;public class TextElementModel extends AbstractModel
{

    private String text;
    private Font font;
    private Integer x;
    private Integer y;
    private Integer opacity;
    private Integer rotation;


    /**
     * Provides the means to set or reset the model to
     * a default state
     */
    public void initDefault() {

        setOpacity(89);
        setRotation(0);
        setText("Sample Text");
        setFont(new Font("Arial", Font.BOLD, 24));
        setX(50);
        setY(50);

    }

    //  Accessors


    public String getText() {
        return text;
    }

    public void setText(String text) {

        String oldText = this.text;
        this.text = text;

        firePropertyChange(
            DefaultController.ELEMENT_TEXT_PROPERTY,
            oldText, text);
    }

    public Font getFont() {
        return font;
    }

    public void setFont(Font font) {

        Font oldFont = this.font;
        this.font = font;

        firePropertyChange(
            DefaultController.ELEMENT_FONT_PROPERTY,
            oldFont, font);
    }

    //  The remaining accessors for properties are omitted.

}
&lt;/pre&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;Note that the rest of the accessors follow the standard JavaBeans
model, although they are omitted in Code Sample 1. For reference, Code
Sample 2 shows the underlying &lt;code&gt;AbstractModel&lt;/code&gt; class, which simply uses the &lt;a href="http://java.sun.com/javase/6/docs/api/java/beans/PropertyChangeEvent.html"&gt;&lt;code&gt;javax.beans.PropertyChangeSupport&lt;/code&gt;&lt;/a&gt; class to register, deregister, and notify interested listeners of changes to the model.&lt;/p&gt; 
  &lt;p&gt;&lt;b&gt;Code Sample 2&lt;/b&gt;&lt;/p&gt; 
  &lt;div style="overflow: auto; width: 600px;"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="10" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt; 
            &lt;pre&gt;public abstract class AbstractModel
{

    protected PropertyChangeSupport propertyChangeSupport;

    public AbstractModel()
    {
        propertyChangeSupport = new PropertyChangeSupport(this);
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertyChangeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertyChangeSupport.removePropertyChangeListener(listener);
    }

    protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
        propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
    }


}
&lt;/pre&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;&lt;b&gt;The Controller&lt;/b&gt;&lt;/p&gt; 
  &lt;p&gt;Between the model and view lies the controller. First, take a look
at the code for the abstract controller superclass, as shown in Code
Sample 3.&lt;/p&gt; 
  &lt;p&gt;&lt;b&gt;Code Sample 3&lt;/b&gt;&lt;/p&gt; 
  &lt;div style="overflow: auto; width: 600px;"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="10" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt; 
            &lt;pre&gt;public abstract class AbstractController implements PropertyChangeListener {

    private ArrayList&lt;abstractviewpanel&gt; registeredViews;
    private ArrayList&lt;abstractmodel&gt; registeredModels;

    public AbstractController() {
        registeredViews = new ArrayList&lt;abstractviewpanel&gt;();
        registeredModels = new ArrayList&lt;abstractmodel&gt;();
    }


    public void addModel(AbstractModel model) {
        registeredModels.add(model);
        model.addPropertyChangeListener(this);
    }

    public void removeModel(AbstractModel model) {
        registeredModels.remove(model);
        model.removePropertyChangeListener(this);
    }

    public void addView(AbstractViewPanel view) {
        registeredViews.add(view);
    }

    public void removeView(AbstractViewPanel view) {
        registeredViews.remove(view);
    }


    //  Use this to observe property changes from registered models
    //  and propagate them on to all the views.


    public void propertyChange(PropertyChangeEvent evt) {

        for (AbstractViewPanel view: registeredViews) {
            view.modelPropertyChange(evt);
        }
    }


    /**
     * This is a convenience method that subclasses can call upon
     * to fire property changes back to the models. This method
     * uses reflection to inspect each of the model classes
     * to determine whether it is the owner of the property
     * in question. If it isn't, a NoSuchMethodException is thrown,
     * which the method ignores.
     *
     * @param propertyName = The name of the property.
     * @param newValue = An object that represents the new value
     * of the property.
     */
    protected void setModelProperty(String propertyName, Object newValue) {

        for (AbstractModel model: registeredModels) {
            try {

                Method method = model.getClass().
                    getMethod("set"+propertyName, new Class[] {
                                                      newValue.getClass()
                                                  }


                             );
                method.invoke(model, newValue);

            } catch (Exception ex) {
                //  Handle exception.
            }
        }
    }


}
&lt;/abstractmodel&gt;&lt;/abstractviewpanel&gt;&lt;/abstractmodel&gt;&lt;/abstractviewpanel&gt;&lt;/pre&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;The &lt;code&gt;AbstractController&lt;/code&gt; class contains two &lt;code&gt;ArrayList&lt;/code&gt;
objects, which are used to keep track of the models and views that are
registered. Note that whenever a model is registered, the controller
also registers itself as a property change listener on the model. This
way, whenever a model changes its state, the &lt;code&gt;propertyChange()&lt;/code&gt; method is called and the controller will pass this event on to the appropriate views.&lt;/p&gt; 
  &lt;p&gt;The final method, &lt;code&gt;setModelProperty()&lt;/code&gt;, employs some
magic to get its work done. In order to keep the models completely
decoupled from the controller, the code samples in this article have
employed the &lt;a href="http://java.sun.com/javase/6/docs/technotes/guides/reflection/index.html"&gt;Java
Reflection API&lt;/a&gt;. In this case, when this method is called with the
desired property name, you hunt through the registered models to
determine which one contains the appropriate method. Once you find
it, you invoke the method using the new value. If the method is not
called, the &lt;code&gt;getMethod()&lt;/code&gt; will throw a
&lt;code&gt;NoSuchMethodException&lt;/code&gt;, which the exception handler
ignores, allowing the &lt;code&gt;for-&lt;/code&gt; loop to continue.
&lt;/p&gt; 
  &lt;p&gt;Code Sample 4 shows the source code for the default controller
class. This class consists of only property constants and methods
called by the GUI event listeners of the view.
&lt;/p&gt; 
  &lt;p&gt;&lt;b&gt;Code Sample 4&lt;/b&gt;&lt;/p&gt; 
  &lt;div style="overflow: auto; width: 600px;"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="10" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt; 
            &lt;pre&gt;public class DefaultController extends AbstractController
{

    public static final String ELEMENT_TEXT_PROPERTY = "Text";
    public static final String ELEMENT_FONT_PROPERTY = "Font";
    public static final String ELEMENT_X_PROPERTY = "X";
    public static final String ELEMENT_Y_PROPERTY = "Y";
    public static final String ELEMENT_OPACITY_PROPERTY = "Opacity";
    public static final String ELEMENT_ROTATION_PROPERTY = "Rotation";

    //  Code omitted

    public void changeElementText(String newText) {
        setModelProperty(ELEMENT_TEXT_PROPERTY, newText);
    }

    public void changeElementFont(Font newFont) {
        setModelProperty(ELEMENT_FONT_PROPERTY, newFont);
    }

    public void changeElementXPosition(int newX) {
        setModelProperty(ELEMENT_X_PROPERTY, newX);
    }

    public void changeElementYPosition(int newY) {
        setModelProperty(ELEMENT_Y_PROPERTY, newY);
    }

    public void changeElementOpacity(int newOpacity) {
        setModelProperty(ELEMENT_OPACITY_PROPERTY, newOpacity);
    }

    public void changeElementRotation(int newRotation) {
        setModelProperty(ELEMENT_ROTATION_PROPERTY, newRotation);
    }

}
&lt;/pre&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;&lt;b&gt;The View&lt;/b&gt;&lt;/p&gt; 
  &lt;p&gt;This example will have two views displaying the data from the
model: a property-editor view and a graphical page view. Both of
these are implementations of a &lt;code&gt;JPanel&lt;/code&gt;, inserted into
either a &lt;code&gt;JDialog&lt;/code&gt; or &lt;code&gt;JFrame&lt;/code&gt;. The dialog box
allows the user to update the values of the model, and the frame
panel simply reflects the changes as the final textual display. The
author of this article built this example using the &lt;a href="http://www.netbeans.org/products/ide/" target="_blank"&gt;NetBeans
Swing GUI Builder&lt;/a&gt;, formerly referred to as Project Matisse, to
design the GUI forms.
&lt;/p&gt; 
  &lt;p&gt;Code Sample 5 shows the source code for the property-editor view,
the more interesting of the two. The first section is simply devoted
to initialization of the components, which for the most part was
automatically generated by the &lt;a href="http://netbeans.org/" target="_blank"&gt;NetBeans&lt;/a&gt;
integrated development environment (IDE) in the &lt;code&gt;initComponents()&lt;/code&gt;
method. All of this section is omitted but is present in the
downloadable code. Any other initialization that you need to perform
-- in this case, creating custom models for &lt;code&gt;JSpinner&lt;/code&gt; and
&lt;code&gt;JSlider&lt;/code&gt; objects or adding &lt;code&gt;DocumentListeners&lt;/code&gt;
to the &lt;code&gt;JTextField&lt;/code&gt; components -- is handled in the
&lt;code&gt;localInitialization()&lt;/code&gt; method.
&lt;/p&gt; 
  &lt;p&gt;&lt;b&gt;Code Sample 5&lt;/b&gt;&lt;/p&gt; 
  &lt;div style="overflow: auto; width: 600px;"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="10" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt; 
            &lt;pre&gt;public PropertiesViewPanel(DefaultController controller) {

        this.controller = controller;

        initComponents();
        localInitialization();

    }

    // ‹editor-fold defaultstate="collapsed" desc=" Local Initialization "›

    /**
     * Used to provide local initialization of Swing components
     * outside of the NetBeans automatic code generator
     */
    public void localInitialization() {

        opacitySpinner.setModel(new SpinnerNumberModel(100, 0, 100, 1));
        opacitySlider.setModel(new DefaultBoundedRangeModel(100, 0, 0, 100));

        rotationSpinner.setModel(new SpinnerNumberModel(0, -180, 180, 1));
        rotationSlider.setModel(new DefaultBoundedRangeModel(0, 0, -180, 180));

        text.getDocument().addDocumentListener(new DocumentListener() {

            public void insertUpdate(DocumentEvent e) {
                textDocumentChanged(e);
            }

            public void removeUpdate(DocumentEvent e) {
                textDocumentChanged(e);
            }

            public void changedUpdate(DocumentEvent e) {
                textDocumentChanged(e);
            }

        });

    }

    // ‹/editor-fold›
&lt;/pre&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;Note that the automatically generated NetBeans IDE code folds in the
source code so that the developer can collapse each of these sections
when it is not needed:
&lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;/p&gt; 
  &lt;div style="overflow: auto; width: 600px;"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="10" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt; 
            &lt;pre&gt;// ‹editor-fold defaultstate="collapsed" desc=" Local Initialization "›
// ‹/editor-fold›
&lt;/pre&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;If you're using the NetBeans IDE, this practice is highly
recommended.
&lt;/p&gt; 
  &lt;p&gt;The second section of the &lt;code&gt;PropertiesViewPanel&lt;/code&gt;
class deals exclusively with the model. In Code Sample 6, a
&lt;code&gt;modelPropertyChange()&lt;/code&gt; method is called by the controller
whenever the model reports a state change.
&lt;/p&gt; 
  &lt;p&gt;&lt;b&gt;Code Sample 6&lt;/b&gt;&lt;/p&gt; 
  &lt;div style="overflow: auto; width: 600px;"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="10" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt; 
            &lt;pre&gt;// ‹editor-fold defaultstate="collapsed" desc=" Model Event Handling Code "›

    public void modelPropertyChange(final PropertyChangeEvent evt) {

        if (evt.getPropertyName().equals(
                   DefaultController.ELEMENT_X_PROPERTY)) {
            String newStringValue = evt.getNewValue().toString();
            xPositionTextField.setText(newStringValue);
        } else if
           (evt.getPropertyName().equals(
                   DefaultController.ELEMENT_Y_PROPERTY)) {
            String newStringValue = evt.getNewValue().toString();
            yPositionTextField.setText(newStringValue);
        } else if
           (evt.getPropertyName().equals(
                   DefaultController.ELEMENT_OPACITY_PROPERTY)) {
            int newIntegerValue = (Integer)evt.getNewValue();
            opacitySpinner.setValue(newIntegerValue);
            opacitySlider.setValue(newIntegerValue);
        } else if
            (evt.getPropertyName().equals(
                   DefaultController.ELEMENT_ROTATION_PROPERTY)) {
            int newIntegerValue = (Integer)evt.getNewValue();
            rotationSpinner.setValue(newIntegerValue);
            rotationSlider.setValue(newIntegerValue);
        } else if
           (evt.getPropertyName().equals(
                   DefaultController.ELEMENT_TEXT_PROPERTY)) {
            String newStringValue = evt.getNewValue().toString();
            text.setText(newStringValue);
        } else if
           (evt.getPropertyName().equals(
                   DefaultController.ELEMENT_FONT_PROPERTY)) {
            Font f = (Font)evt.getNewValue();
            String fontString = f.getFontName() + " " + f.getSize();
            font.setText(fontString);
            currentFont = f;
        }

        //  Remainder of the code omitted

    }

    // ‹/editor-fold›
&lt;/pre&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;Again, this code sample omits portions of the code that are similar
to the sections shown.
&lt;/p&gt; 
  &lt;p&gt;The final portion consists of the GUI event listeners. Code Sample
7 contains listeners that are called whenever GUI events occur, such
as pushing the &lt;code&gt;Change Font&lt;/code&gt; button or the &lt;code&gt;Opacity&lt;/code&gt;
spinner buttons, or resetting the text in any of the text fields.
These are largely event listeners that most Swing developers are
already familiar with. If you're using the NetBeans IDE, you'll see
that the IDE can automatically generate many of these using the GUI
developer.
&lt;/p&gt; 
  &lt;p&gt;&lt;b&gt;Code Sample 7&lt;/b&gt;&lt;/p&gt; 
  &lt;div style="overflow: auto; width: 600px;"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="10" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt; 
            &lt;pre&gt; // ‹editor-fold defaultstate="collapsed" desc=" GUI Event Handling Code "›

    //  Code omitted

    private void yPositionTextFieldFocusLost(java.awt.event.FocusEvent evt) {
        try {
            controller.changeElementYPosition(
                Integer.parseInt(yPositionTextField.getText()));
        } catch (Exception e) {
            //  Handle exception.
        }
    }

    private void yPositionTextFieldActionPerformed(java.awt.event.ActionEvent evt) {
        try {
            controller.changeElementYPosition(
                Integer.parseInt(yPositionTextField.getText()));
        } catch (Exception e) {
            //  Handle exception.
        }
    }

    //  Code omitted -- code for xPosition
    //  is nearly the same as for yPosition.

    private void changeFontButtonActionPerformed(java.awt.event.ActionEvent evt) {

        JFontChooserDialog fontChooser = new
            JFontChooserDialog((Dialog)this.getTopLevelAncestor());
        fontChooser.setSelectedFont(currentFont);
        fontChooser.setVisible(true);

        Font returnedFont = fontChooser.getSelectedFont();
        if (returnedFont != null) {
            controller.changeElementFont(returnedFont);
        }
    }

    private void opacitySliderStateChanged(javax.swing.event.ChangeEvent evt) {
        controller.changeElementOpacity((int)opacitySlider.getValue());
    }

    private void rotationSliderStateChanged(javax.swing.event.ChangeEvent evt) {
        controller.changeElementRotation((int)rotationSlider.getValue());
    }

    private void opacitySpinnerStateChanged(javax.swing.event.ChangeEvent evt) {
        controller.changeElementOpacity((Integer)opacitySpinner.getValue());
    }

    private void rotationSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {
        controller.changeElementRotation((Integer)rotationSpinner.getValue());
    }

    private void textDocumentChanged(DocumentEvent evt) {

        Document document = evt.getDocument();
        try {
            controller.changeElementText(document.getText(0,
            document.getLength()));
        } catch (BadLocationException ex) {
            //  Handle exception.
        }
    }

    // ‹/editor-fold›
&lt;/pre&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;a name="5"&gt;&lt;/a&gt; 
  &lt;div&gt;&lt;b&gt;Issues With Application Design&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;Once the application is up and running, you immediately run into a problem. Consider the following chain of events:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;One of the Swing components in the view receives a change, presumably from the user action.&lt;/li&gt; 
    &lt;li&gt;The appropriate controller method is called.&lt;/li&gt; 
    &lt;li&gt;The model is updated. It notifies the controller of its property change.&lt;/li&gt; 
    &lt;li&gt;The view receives a change event from the controller and attempts to reset the value of the appropriate Swing components.&lt;/li&gt; 
    &lt;li&gt;The appropriate controller method is called, and the model is updated again.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;At this point, any of three different scenarios can occur,
depending on what Swing component you use and how robust your model
is.
&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;The Swing component that prompted the initial change refuses
to update itself the second time, noting that its property state
cannot be updated again while it is in the process of notifying
listeners of the initial state change. This primarily occurs when
you use Swing text components.
&lt;/li&gt; 
    &lt;li&gt;The model notes that the value of the second update matches
that of the first, its current value, and refuses to send a change
notification. This is always a safe programming practice, and it
automatically occurs if you use the &lt;code&gt;&lt;a href="http://java.sun.com/javase/6/docs/api/java/beans/PropertyChangeSupport.html"&gt;PropertyChangeSupport&lt;/a&gt;&lt;/code&gt;
class provided in the &lt;code&gt;&lt;a href="http://java.sun.com/javase/6/docs/api/java/beans/package-summary.html"&gt;java.beans&lt;/a&gt;&lt;/code&gt;
package. However, it does not keep the model from receiving a
redundant update.
&lt;/li&gt; 
    &lt;li&gt;No safeguards are in place on either the model or the Swing
component, and the program enters an infinite loop.
&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;This issue occurs because the Swing components are autonomous. For
example, what happens if the user presses the up arrow of the
&lt;code&gt;JSpinner&lt;/code&gt; component in &lt;code&gt;PropertiesViewPanel&lt;/code&gt;,
incrementing the spinner's value by one? After the value is updated,
a GUI event listener method that is listening for value changes is
called, &lt;code&gt;opacitySpinnerStateChanged()&lt;/code&gt;, which in turn
calls the controller and then updates the appropriate property in the
model.
&lt;/p&gt; 
  &lt;p&gt;With a traditional MVC design, the view would still contain the
previous value, and the change in the model would update the view to
the current value. However, there is no need to update the Swing
component because it has already reset itself to the correct value --
it did so before it even passed an event to the controller.
&lt;/p&gt; 
  &lt;p&gt;How do you get around this? One way is to write a mechanism that
tells the model or the controller not to propagate a change
notification under these circumstances, but this is not a good idea.
Remember that more than one view may be listening for changes on the
model. If you shut down the change notification for the model, no
other listeners, including other views, will be notified of the
change. In addition, other components in the same view may rely on
the property change notification, with a slider and spinner
combination, for example.
&lt;/p&gt; 
  &lt;p&gt;Ideally, each Swing component would be aware of its current value
and the value that the view is trying to set it to. If they match, no
change notifications will be sent. However, some Swing components
include this logic, and others do not. One possible solution is to
check the incoming changed value of the model against the current
value stored in the Swing component. If they are identical, there is
no need to reset the value of the Swing component.
&lt;/p&gt; 
  &lt;p&gt;Code Sample 8 shows an update of the &lt;code&gt;modelPropertyChange()&lt;/code&gt;
method to demonstrate this approach.
&lt;/p&gt; 
  &lt;p&gt;&lt;b&gt;Code Sample 8&lt;/b&gt;&lt;/p&gt; 
  &lt;div style="overflow: auto; width: 600px;"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="10" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt; 
            &lt;pre&gt;public void modelPropertyChange(final PropertyChangeEvent evt) {

        if (evt.getPropertyName().equals(DefaultController.ELEMENT_X_PROPERTY)) {

            String newStringValue = evt.getNewValue().toString();
            if (!xPositionTextField.getText().equals(newStringValue))
                xPositionTextField.setText(newStringValue);

        }

        //  Remaining code omitted

    }
&lt;/pre&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;The final example, which uses two delegate views, is shown in Figure
5. The second delegate makes use of the &lt;a href="http://java.sun.com/javase/technologies/desktop/media/2D/"&gt;Java
2D&lt;/a&gt; libraries to display the text, which is beyond the scope of
this article. However, the source code is relatively easy to follow
and is included in the downloadable source code.
&lt;/p&gt; &lt;!-- BEGIN VCD6 ARTICLE COMPONENT, variation 1 with embedded image  --&gt; 
  &lt;table width="200" cellspacing="0" cellpadding="2" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center" class="grey3"&gt;&lt;img height="305" width="600" border="0" src="http://java.sun.com/developer/technicalArticles/javase/mvc/images/Figure5.gif" alt="Figure 5. Both Views Attached to a Single Model" /&gt; 
          &lt;div class="pad3"&gt; &lt;span class="dkcaption1"&gt; &lt;b&gt;Figure 5.&lt;/b&gt; &lt;i&gt;Both Views Attached to a Single Model&lt;/i&gt; &lt;/span&gt;&lt;/div&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;!-- END VCD6 ARTICLE COMPONENT, variation 1 with embedded image  --&gt; &lt;a name="6"&gt;&lt;/a&gt; 
  &lt;div&gt;&lt;b&gt;Common Swing Component Listeners&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;As this article has shown throughout, part of the initialization
of each delegate or controller requires you to subscribe to various
Swing component events. However, individual Swing components can
often generate multiple event types. Table 1 presents some common
listener methods.
&lt;/p&gt; &lt;!-- BEGIN CUSTOMIZED FOR MVC ARTICLE ONLY TABLE 1  --&gt; 
  &lt;div style="overflow: auto; width: 700px;"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td class="headerbar1"&gt; 
            &lt;div class="headerpadding2"&gt;Table 1. Common Swing Event Listener Methods&lt;/div&gt; 
          &lt;/td&gt; 
          &lt;td align="right" class="headerbar1"&gt; 
            &lt;div class="headerpadding2"&gt; &lt;/div&gt; 
          &lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
    &lt;div class="pad2x0x10x0"&gt; 
      &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="vatop" summary="Table 1. Common Swing Event Listener Methods"&gt; 
        &lt;tbody&gt; 
          &lt;tr&gt; 
            &lt;th width="30%" align="left" scope="col" class="headerbar6"&gt; 
              &lt;div class="headerpadding2"&gt;&lt;b&gt;Event to Monitor&lt;/b&gt;&lt;/div&gt; 
            &lt;/th&gt; 
            &lt;th width="70%" align="left" scope="col" class="headerbar6"&gt; 
              &lt;div class="headerpadding2"&gt;&lt;b&gt;Swing Event Listener Method&lt;/b&gt;&lt;/div&gt; 
            &lt;/th&gt; 
          &lt;/tr&gt; 
          &lt;tr&gt; 
            &lt;td colspan="3"&gt;&lt;img height="2" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JButton&lt;/code&gt; pressed; &lt;code&gt;JCheckBox&lt;/code&gt; pressed;
&lt;code&gt;JRadioButton&lt;/code&gt; pressed; &lt;code&gt;JToggleButton&lt;/code&gt;
toggled.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JButton.addActionListener(java.awt.event.ActionListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr style="background: #999999 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JSpinner&lt;/code&gt; value changed.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JSpinner.addChangeListener(javax.swing.event.ChangeListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JTextField&lt;/code&gt;, &lt;code&gt;JFormattedTextField&lt;/code&gt;,
&lt;code&gt;JPasswordField&lt;/code&gt; or &lt;code&gt;JTextArea&lt;/code&gt; character(s)
are added, changed, or deleted.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JTextField.getDocument().addDocumentListener(javax.swing.event.DocumentListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr style="background: #999999 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JTextField&lt;/code&gt; return button is pressed, or focus switches to another component.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JTextField.addActionListener(java.awt.event.ActionListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JComboBox&lt;/code&gt; new entry is selected. from list.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JComboBox.addActionListener(java.awt.event.ActionListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr style="background: #999999 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JComboBox&lt;/code&gt; editor (typically a text field)
characters are added, changed, or deleted.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JTextField editor =
((JTextField)comboBox.getEditor().getEditorComponent());&lt;/code&gt; &lt;br /&gt; &lt;code&gt;editor.getDocument().addDocumentListener(javax.swing.event.DocumentListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JComboBox&lt;/code&gt; return button is pressed.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JComboBox.addActionListener(java.awt.event.ActionListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr style="background: #999999 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JComboBox&lt;/code&gt; pop-up menu is about to become visible,
invisible, or be cancelled without a selection.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JComboBox.addPopupMenuListener(javax.swing.event.PopupMenuListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JList&lt;/code&gt; new entry is selected.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JList.addListSelectionListener(javax.swing.event.ListSelectionListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr style="background: #999999 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JTabbedPane&lt;/code&gt; new tab is selected.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JTabbedPane.addChangeListener(javax.swing.event.ChangeListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JScrollBar&lt;/code&gt; adjustment is made.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JScrollBar.addAdjustmentListener(java.awt.event.AdjustmentListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr style="background: #999999 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JScrollPane&lt;/code&gt; adjustment is made.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JScrollPane.getHorizontalScrollBar().addAdjustmentListener(java.awt.event.AdjustmentListener)&lt;/code&gt; &lt;br /&gt;&lt;code&gt;JScrollPane.getVerticalScrollBar().addAdjustmentListener(java.awt.event.AdjustmentListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JPopupMenu&lt;/code&gt; is about to become visible, invisible, or be cancelled without a selection.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JPopupMenu.addPopupMenuListener(javax.swing.event.PopupMenuListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr style="background: #999999 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JMenu&lt;/code&gt; is about to be become visible or invisible, or be cancelled without a selection.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JMenu.addMenuListener(javax.swing.event.MenuListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JMenuItem&lt;/code&gt; (in standard or pop-up menu) is selected.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JMenuItem.addActionListener(java.awt.event.ActionListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; 
          &lt;tr style="background: #999999 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt; 
            &lt;td&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JSlider&lt;/code&gt; value is changed.&lt;/div&gt; 
            &lt;/td&gt; 
            &lt;td valign="top"&gt; 
              &lt;div class="datacell"&gt;&lt;code&gt;JSlider.addChangeListener(javax.swing.event.ChangeListener)&lt;/code&gt;&lt;/div&gt; 
            &lt;/td&gt; 
          &lt;/tr&gt; &lt;!--  FINAL LINE IS OF A DIFFERENT COLOR  --&gt; 
          &lt;tr&gt; 
            &lt;td colspan="2" class="headerbar6"&gt;&lt;img height="1" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
          &lt;/tr&gt; 
        &lt;/tbody&gt; 
      &lt;/table&gt; 
    &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;!-- END CUSTOMIZED FOR MVC ARTICLE ONLY TABLE 1  --&gt; 
  &lt;/div&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;a name="7"&gt;&lt;/a&gt; 
  &lt;div&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;MVC is one of the staples of any GUI programmer's toolkit. This
article has shown how to implement a variation of the MVC design
using Java SE and the Swing libraries. In addition, it has
demonstrated some common issues that programmers may face when using
MVC, as well as listed common Swing component events that any Java
platform programmer can use when creating a view.
&lt;/p&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;a name="8"&gt;&lt;/a&gt; 
  &lt;div&gt;&lt;b&gt;For More Information&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table width="100%" cellspacing="0" cellpadding="0" border="0" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" width="1" border="0" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;ul&gt; 
    &lt;li&gt;You can download the example source code for this article
&lt;a href="http://java.sun.com/developer/technicalArticles/javase/mvc/MVCExample.zip"&gt;here&lt;/a&gt;.&lt;/li&gt; 
    &lt;li&gt;The original MVC implementation is described in the now-canonical paper
&lt;a href="http://st-www.cs.uiuc.edu/users/smarch/st-docs/mvc.html" target="_blank"&gt;Applications
Programming in Smalltalk-80: How to Use Model-View-Controller&lt;/a&gt;&lt;a href="http://st-www.cs.uiuc.edu/users/smarch/st-docs/mvc.html" target="_blank"&gt;.&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/"&gt;Creating
a GUI With Java Swing&lt;/a&gt;, also known as &lt;i&gt;The Swing Tutorial&lt;/i&gt;,
shows you how to get started using the Java Swing components.
&lt;/li&gt; 
    &lt;li&gt; &lt;a href="http://java.sun.com/products/jfc/tsc/articles/architecture/"&gt;A
Swing Architecture Overview&lt;/a&gt; gives the inside story on how Swing
uses a variant of MVC.
&lt;/li&gt; 
    &lt;li&gt;The page &lt;a href="http://java.sun.com/blueprints/patterns/MVC-detailed.html"&gt;Java
Blueprints for Model-View-Controller&lt;/a&gt; provides a good background
on the problem space and various solutions, even though its target
audience is developers using the Java EE platform.
&lt;/li&gt; 
    &lt;li&gt;
&amp;quot;&lt;a href="http://www.javadude.com/articles/vaddmvc1/mvc1.htm" target="_blank"&gt;Applying
the Model-View-Controller Design Paradigm in VisualAge for Java&lt;/a&gt;&amp;quot;
is an excellent article by Scott Stanchfield that discusses some of
common problems and solutions in using MVC with Java technology. A
follow-up article, &amp;quot;&lt;a href="http://www.javadude.com/articles/vaddmvc2/mvc2.html" target="_blank"&gt;Advanced
Model-View-Controller Techniques&lt;/a&gt;,&amp;quot; also points out some
best practices to follow when populating models with data from
underlying domain sources.
&lt;/li&gt; 
    &lt;li&gt;
If you are curious as to how the textual portion of the Java
2D libraries work, take a look at &lt;a href="http://java.sun.com/developer/technicalArticles/GUI/java2d/java2dpart1.html"&gt;this
article&lt;/a&gt;.
&lt;/li&gt; 
  &lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/s76ygV0hR5s" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/java_se_application_design_with</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/lesson_java_web_start</id>
        <title type="html">Lesson: Java Web Start</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/vhg-1Yn3jqU/lesson_java_web_start" />
        <published>2008-08-18T11:35:22-07:00</published>
        <updated>2008-08-18T11:35:22-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="start" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="web" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Java Web Start provides the power to launch full-featured applications
with a single click. Users can download and launch applications, such
as a complete spreadsheet program or an Internet chat client, without
going through complicated installation procedures.</summary>
        <content type="html">Java Web Start provides the power to launch full-featured applications
with a single click. Users can download and launch applications, such
as a complete spreadsheet program or an Internet chat client, without
going through complicated installation procedures.

  
  &lt;p&gt;

With Java Web Start, the user can launch a Java application by clicking a link in a Web page. The link points to a &lt;code&gt;JNLP&lt;/code&gt; file, which instructs Java Web Start to download, cache and run the application.

&lt;/p&gt; 
  &lt;p&gt;

Java Web Start provides Java developers and users with many deployment advantages:

&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt; With Java Web Start, you can place a single Java application on a
Web server for deployment to a wide variety of platforms, including
Windows 2003/Vista/2000/XP, Linux, and Solaris&lt;sup&gt;TM&lt;/sup&gt; &lt;/li&gt; 
    &lt;li&gt;
Java Web Start supports multiple, simultaneous versions of the Java
Standard Edition platform. Specific applications can request specific
Java versions without conflicting with the different needs of other
applications. Java Web Start automatically downloads and installs the
correct version of the Java platform as necessary based on the
application's needs and the user's environment. &lt;/li&gt; 
    &lt;li&gt; Users can launch a Java Web Start application
independently of a Web browser. The user can be off-line, or unable to
access the browser. Desktop shortcuts can also launch the application,
providing the user with the same experience as a native application. &lt;/li&gt; 
    &lt;li&gt; Java Web Start takes advantage of the inherent
security of the Java platform. By default, applications have restricted
access to local disk and network resources. Users can safely run
applications from sources that are not trusted. &lt;/li&gt; 
    &lt;li&gt;
 
 Applications launched with Java Web Start are cached locally, for improved performance.
 
 &lt;/li&gt; 
    &lt;li&gt;
Java Web Start provides limited support for applets through its
built-in applet viewer. However, this is not intended to be a full-
scale applet environment, such as the one provided by Java Plug-in.
Java Web Start's applet viewer has certain limitations; for example,
you cannot specify class files as resources, and it does not accept
policy files. &lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;
In Java Version 1.4.2 and beyond, Java Web Start is installed as part
of the JRE. Users do not have to install it separately or perform
additional tasks to use Java Web Start applications.
&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/deployment/webstart/"&gt;Read the rest of this lesson . . . &lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;Also see:&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/new2java/"&gt;New to Java Programming Center&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/new2java/learning/young_developers.jsp"&gt;Young Developers&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/"&gt;The Java Tutorial&lt;/a&gt;&lt;/p&gt; &lt;a href="http://www.new.facebook.com/profile.php?id=1366910038#/pages/Get-Started-with-Java-Programming/20602215818?ref=share"&gt;Get Started with Java Programming in Facebook&lt;/a&gt; 
  &lt;p&gt;&amp;nbsp;******&lt;/p&gt; 
  &lt;p&gt;&amp;nbsp;&lt;/p&gt; 
  &lt;pre&gt;&lt;a title="" target="" href="http://www.netbeans.org/community/releases/65/"&gt;Introducing NetBeans IDE 6.5 Beta!&lt;/a&gt; Development Simplified. 
Rapidly create web, enterprise, desktop, and mobile applications with 
Java, C/C++ , JavaScript, Ruby, Groovy, and now PHP.
&lt;p&gt;******&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/vhg-1Yn3jqU" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/lesson_java_web_start</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/wombat_classes_basics_young_developers</id>
        <title type="html">Wombat Classes Basics (Young Developers Series, Part 2)</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/lcf7AVm2ONw/wombat_classes_basics_young_developers" />
        <published>2008-08-12T13:35:16-07:00</published>
        <updated>2008-08-12T13:35:16-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="children" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="developers" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="learning" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="programming" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="young" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn where Java code is written and saved, how classes relate to one another, and how to use the Greenfoot code editor.</summary>
        <content type="html">&lt;table cellspacing="0" cellpadding="0" border="0" width="100%"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td valign="top" class="smaller"&gt;&lt;i&gt;By &lt;a href="http://java.sun.com/features/authors.html#nourie"&gt;Dana Nourie&lt;/a&gt;, August 2008
&lt;/i&gt;&lt;/td&gt; 
        &lt;td width="10"&gt; &lt;br /&gt;&lt;/td&gt; 
        &lt;td align="right" valign="bottom"&gt; 
          &lt;div style="padding: 0px;" class="sitelinks"&gt; 
            &lt;table cellspacing="0" cellpadding="0" border="0"&gt; 
              &lt;tbody&gt; 
                &lt;tr&gt; &lt;!--
&lt;td valign="bottom" align="right"&gt;&lt;img src="/im/ic_email.gif" width="14" height="12" border="0" hspace="4" vspace="1" alt=" " /&gt;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="#{link placeholder}"&gt;E-mail&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="/jsp_utils/PrintPage.jsp" target="printFriendlyView" onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}openPopup('','printFriendlyView',710,650,'no',1,1,0,0,0,0); return true;"&gt;&lt;img src="/im/ic_print.gif" width="14" height="12" alt="Print-friendly Version" border="0" hspace="4" /&gt;Print-friendly Version&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;img src="/im/ic_download_thin.gif" width="9" height="14" hspace="4" border="0" alt=" " /&gt;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="#{link placeholder}"&gt;Download&lt;/a&gt;&lt;/td&gt;
--&gt; &lt;/tr&gt; 
              &lt;/tbody&gt; 
            &lt;/table&gt; 
          &lt;/div&gt; &lt;br /&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" alt=" " src="http://java.sun.com/im/a.gif" /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;!--  END VCD4 BYLINE AND TOOLS  --&gt; 
  &lt;p&gt;Learn where Java code is written and saved, how classes relate to one another, and how to use the Greenfoot code editor.&lt;/p&gt; 
  &lt;p&gt;
In the &lt;a href="http://java.sun.com/developer/technicalArticles/wombat_basics/"&gt;Wombat Object Basics&lt;/a&gt;
article, you learned what an object is, what methods are for, and a bit
about the syntax that is used in code. In this article, you will learn
where that code is written and saved, how classes relate to one
another, and you'll learn to use the Greenfoot code editor. In
addition, certain words in this article are linked, so you can learn
more than is being taught here.
&lt;/p&gt; 
  &lt;p&gt;As in the last article, to follow along you will need:&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt; The &lt;a href="http://java.sun.com/javase/downloads/"&gt;Java SE&lt;/a&gt; software installed on your computer&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.greenfoot.org/download/"&gt;Greenfoot&lt;/a&gt;  installed on your computer&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;This article is aimed at anyone interested in Java programming who
is between the ages of 10-100 and has no programming experience. It is
recommended that you have read and followed &lt;a href="http://java.sun.com/developer/technicalArticles/wombat_basics/"&gt;Wombat Object Basics&lt;/a&gt; before moving on in this article. &lt;/p&gt; 
  &lt;div&gt;&lt;b&gt;Where Is the Code?&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;
Now that you understand that Java programs are made up of a lot of Java &lt;a title="What's an Object?" href="http://java.sun.com/docs/books/tutorial/java/concepts/object.html"&gt;objects&lt;/a&gt;,
and they interact through methods that provide the instructions for
doing things, you are ready to learn about the code. Let's not waste
any time.
&lt;/p&gt; 
  &lt;p&gt;Open Greenfoot. If the Wombats scenario is not already open, Click
Scenario in the top menu, choose Open, select wombats, and then click
Open.&lt;/p&gt; 
  &lt;p&gt;At the top of the world area, right-click &lt;code&gt;wombatWorld&lt;/code&gt; and select &lt;code&gt;void populate()&lt;/code&gt;. By invoking that &lt;code&gt;void populate()&lt;/code&gt; method, you should now see a few wombats and lots of leaves in your wombat world as shown in Figure 1.
&lt;/p&gt; &lt;!-- BEGIN IMAGE WITH CAPTION --&gt; 
  &lt;table cellspacing="0" cellpadding="2" border="0" width="390"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center" class="grey3"&gt; &lt;img height="384" width="390" src="http://java.sun.com/developer/technicalArticles/wombat_world/images/wombatworld.jpg" /&gt; 
          &lt;div class="pad3"&gt; &lt;span class="dkcaption1"&gt;&lt;b&gt;Figure 1.&lt;/b&gt; &lt;i&gt;Wombat World&lt;/i&gt;&lt;/span&gt;&lt;/div&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/wombat_world/"&gt;Read the rest of this article . . . &lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;Also see:&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/new2java/"&gt;New to Java Programming Center&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/new2java/learning/young_developers.jsp"&gt;Young Developers&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/"&gt;The Java Tutorial&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://www.new.facebook.com/profile.php?id=1366910038#/pages/Get-Started-with-Java-Programming/20602215818?ref=share"&gt;Get Started with Java Programming in Facebook&lt;/a&gt;&lt;br /&gt;&lt;/p&gt; 
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/lcf7AVm2ONw" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/wombat_classes_basics_young_developers</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/wombat_object_basics</id>
        <title type="html">Wombat Object Basics</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/PeFdTkiWdrE/wombat_object_basics" />
        <published>2008-08-08T09:37:12-07:00</published>
        <updated>2008-08-08T09:37:12-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="greenfoot" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="learning" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="students" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="tutorial" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">This article explains what Java objects are and how they interact
with each other. You will get familiar with some basic programming
terminology as well. This article is aimed at anyone interested in Java
programming who is between the ages of 10-100, and has no programming
experience.</summary>
        <content type="html">&lt;table cellspacing="0" cellpadding="0" border="0" width="100%"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td valign="top" class="smaller"&gt;&lt;i&gt;By &lt;a href="http://java.sun.com/features/authors.html#nourie"&gt;Dana Nourie&lt;/a&gt;, August 2008
&lt;/i&gt;&lt;/td&gt; 
        &lt;td width="10"&gt; &lt;/td&gt; 
        &lt;td align="right" valign="bottom"&gt; 
          &lt;div class="sitelinks" style="padding: 0px;"&gt; 
            &lt;table cellspacing="0" cellpadding="0" border="0"&gt; 
              &lt;tbody&gt; 
                &lt;tr&gt; &lt;!--
&lt;td valign="bottom" align="right"&gt;&lt;img src="/im/ic_email.gif" width="14" height="12" border="0" hspace="4" vspace="1" alt=" " /&gt;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="#{link placeholder}"&gt;E-mail&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="/jsp_utils/PrintPage.jsp" target="printFriendlyView" onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}openPopup('','printFriendlyView',710,650,'no',1,1,0,0,0,0); return true;"&gt;&lt;img src="/im/ic_print.gif" width="14" height="12" alt="Print-friendly Version" border="0" hspace="4" /&gt;Print-friendly Version&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;img src="/im/ic_download_thin.gif" width="9" height="14" hspace="4" border="0" alt=" " /&gt;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="#{link placeholder}"&gt;Download&lt;/a&gt;&lt;/td&gt;
--&gt; &lt;/tr&gt; 
              &lt;/tbody&gt; 
            &lt;/table&gt; 
          &lt;/div&gt; &lt;br /&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;!--  END VCD4 BYLINE AND TOOLS  --&gt; 
  &lt;p&gt;Java programming is easy to learn. All Java programs are made up of
objects just like the world around you. And Java objects do things with
each other like you do things with objects wherever you are.
&lt;/p&gt; 
  &lt;p&gt;This article explains what Java objects are and how they interact
with each other. You will get familiar with some basic programming
terminology as well. This article is aimed at anyone interested in Java
programming who is between the ages of 10-100, and has no programming
experience.
&lt;/p&gt; 
  &lt;p&gt;The best way to learn object basics is to look at a Java program.
So, to follow along with this article, you will need the following:
&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt; The &lt;a href="http://java.sun.com/javase/downloads/"&gt;Java SE&lt;/a&gt; software must be installed on your computer&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.greenfoot.org/download/"&gt;Greenfoot&lt;/a&gt; must be installed on your computer&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;
Open Greenfoot and let's get started!
&lt;/p&gt; 
  &lt;div&gt;&lt;b&gt;Getting to Know Wombats&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;Next, click on Scenario in the top menu, choose Open, select
wombats, then click Open. You should see something like Figure 1 below:&lt;/p&gt; &lt;!-- BEGIN IMAGE WITH CAPTION --&gt; 
  &lt;table cellspacing="0" cellpadding="2" border="0" width="476"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center" class="grey3"&gt; &lt;img height="410" width="476" src="http://java.sun.com/developer/technicalArticles/wombat_basics/images/openingscreen.jpg" /&gt; 
          &lt;div class="pad3"&gt; &lt;span class="dkcaption1"&gt;&lt;b&gt;Figure 1.&lt;/b&gt; &lt;i&gt;Wombat Scenario&lt;/i&gt;&lt;/span&gt;&lt;/div&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;!-- END IMAGE WITH CAPTION --&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;This program will be made up of several Java objects: &lt;code&gt;World&lt;/code&gt;, &lt;code&gt;wombatWorld&lt;/code&gt;, &lt;code&gt;Actor&lt;/code&gt;, &lt;code&gt;Wombat&lt;/code&gt;, &lt;code&gt;Leaf&lt;/code&gt;. &lt;/p&gt; 
  &lt;p&gt;Compare the Wombat World to the real world: We live on the object planet Earth. On the &lt;code&gt;Earth&lt;/code&gt; object are &lt;code&gt;Continent&lt;/code&gt; objects and &lt;code&gt;Ocean&lt;/code&gt; objects. On the &lt;code&gt;Continent&lt;/code&gt; objects, there are &lt;code&gt;City&lt;/code&gt; objects, &lt;code&gt;House&lt;/code&gt; objects, and &lt;code&gt;People&lt;/code&gt; objects. And many more objects.&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;p&gt;&lt;a title="Wombat Object Basics" href="http://java.sun.com/developer/technicalArticles/wombat_basics/"&gt;Read the rest of this article . . . &lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/PeFdTkiWdrE" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/wombat_object_basics</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/learning_curve_journal_part_1</id>
        <title type="html">Learning Curve Journal, Part 1: Exploring JavaFX Script</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/fkJ6sFoT2ac/learning_curve_journal_part_1" />
        <published>2008-08-01T16:42:52-07:00</published>
        <updated>2008-08-01T16:42:52-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="javafx" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="learning" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="tutorial" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">&lt;i&gt;Part 1 of the series gets you started with a simple JavaFX program,
that is, a simple program written in the JavaFX Script language. &lt;/i&gt;</summary>
        <content type="html">&lt;p&gt;&lt;i&gt;By &lt;a href="http://java.sun.com/features/authors.html#oconner"&gt;John O'Conner&lt;/a&gt;, August 2007; revised and updated by &lt;a href="http://java.sun.com/features/authors.html#ort"&gt;Ed Ort&lt;/a&gt;, July 2008
&lt;/i&gt;&lt;/p&gt; 
  &lt;p&gt;JavaFX Script is a new scripting language that developers can use to
create dynamic graphical content. On the desktop, the language provides
libraries to help you use the Swing user interface (UI) toolkit and
Java 2D APIs conveniently. It doesn't replace either Swing or Java 2D;
the goal is to make those APIs more accessible to rich content
developers. In other environments, such as mobile systems, JavaFX
Script makes use of user interface technologies other than Swing.
JavaFX Script enables you to write visually rich applications that run
across platforms and operating environments.&lt;/p&gt; 
  &lt;p&gt;The language provides both declarative and procedural syntax. You
can declaratively create a rich user interface, and then you can add
event-handling routines and operations. &lt;/p&gt; 
  &lt;p&gt;However, most of us have to start more modestly, and that's the
purpose of this article. Its goal is to show you how to get started
with JavaFX Script. First, you'll need the following: &lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;An up-to-date &lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;Java SE Development Kit (JDK)&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;Access to accurate, &lt;a href="http://java.sun.com/javafx/reference/"&gt;up-to-date information&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;The &lt;a href="http://java.sun.com/javafx/downloads/"&gt;JavaFX Script plugin&lt;/a&gt; for your integrated development environment (IDE)&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;div&gt;&lt;b&gt;Setting Up the Java Platform&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;As a developer, you no doubt have a JDK on your system. However, if
you haven't updated your system in a while, make sure you have Java SE
6. The Learning Curve Journal focuses on the compiler-based version of
JavaFX Script and its support in NetBeans IDE 6.1. To install and use
NetBeans IDE 6.1 with JavaFX technology, it is recommended that you
install the latest level of Java SE 6 on your system, which currently
is Java SE 6 Update 10 Beta. Download the latest JDK from the &lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;Java SE Downloads&lt;/a&gt;
page of the Sun Developer Network. If you use Mac OS X, you can get
Apple's latest release of the Java platform development kit, which
currently is Java for Mac OS X 10.5, Update 1, directly from their Java
section of the &lt;a href="http://developer.apple.com/java/" target="_blank"&gt;Apple Developer Connection&lt;/a&gt;.&lt;/p&gt; 
  &lt;div&gt;&lt;b&gt;Going to the Source&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;When you experiment with a new environment or language, you're going
to hit dead ends and difficult places. That's part of the deal we all
make when we adopt leading-edge technology. However, to smooth the
learning curve, good documentation and examples are absolutely
critical. Along with the &lt;a href="http://java.sun.com/javafx/"&gt;JavaFX Technology hub&lt;/a&gt; of the Sun Developer Network, the &lt;a href="http://javafx.com/" target="_blank"&gt;javafx.com&lt;/a&gt; and &lt;a href="https://openjfx.dev.java.net/" target="_blank"&gt;Project OpenJFX&lt;/a&gt; web sites provide demo resources and the latest documentation you need to get accurate information.&lt;/p&gt; 
  &lt;p&gt;Some of you will want to start programming immediately, barely
reading a word of the language reference. Others of you will read
everything you can before actually using JavaFX Script. Even if you're
the type that dives in right away, you have to start with some sort of
language specification or tutorial. Before you can scribble out the
prototypical &amp;quot;Hello, world&amp;quot; example, you need to know some basic
language syntax. The documents on the &lt;a href="http://java.sun.com/javafx/reference/"&gt;JavaFX Reference page&lt;/a&gt; are a good place to start. You can find links there to reference documents such as the &lt;a href="http://javafx.com/releases/preview1/docs/reference/JavaFX-Language.html" target="_blank"&gt;The JavaFX Script Programming Language Reference&lt;/a&gt; as well as links to many articles and tutorials such as &lt;a href="http://java.sun.com/javafx/tutorials/jfx_nb_getting_started/"&gt;Getting Started With JavaFX Technology&lt;/a&gt; and &lt;a href="http://java.sun.com/javafx/tutorials/simple_javafx_nb_app/"&gt;Creating A Simple JavaFX Application Using NetBeans IDE&lt;/a&gt;.&lt;/p&gt; 
  &lt;div&gt;&lt;b&gt;Creating a JavaFX Application&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" alt=" " /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;After you've read at least some of the language reference document,
it's time to build a simple JavaFX application. Although you can &lt;a href="http://java.sun.com/developer/technicalArticles/scripting/javafx/lc/part1/#runcomp"&gt;build and run a JavaFX application manually from a command line&lt;/a&gt;, let's do it using &lt;a href="http://www.netbeans.org/" target="blank"&gt;NetBeans IDE 6.1&lt;/a&gt;, which has many features designed to simplify developing applications. You will need to install the JavaFX plugin for NetBeans.&lt;/p&gt; 
  &lt;p&gt;&lt;a title="Learning Curve, Part 1" href="http://java.sun.com/developer/technicalArticles/scripting/javafx/lc/part1/"&gt;Read the rest of this tutorial . . . &lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;********************************&lt;/p&gt; 
  &lt;p&gt;&lt;a title="Get Started with Java Programming" href="http://www.facebook.com/profile.php?id=1366910038#/pages/Get-Started-with-Java-Programming/20602215818?ref=share"&gt;Get Started with Java Programming!&lt;/a&gt; &lt;/p&gt; 
  &lt;p&gt; Now Facebook users have a page to lead them to content that can help
them learn Java programming. Log in to your Facebook account and Become
a Fan of&amp;nbsp; &lt;a title="Get Started with Java Programming" href="http://www.facebook.com/profile.php?id=1366910038#/pages/Get-Started-with-Java-Programming/20602215818?ref=share"&gt;Get Started with Java Programming!&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;********************************&lt;/p&gt; 
  &lt;p&gt;&lt;a title="New to Java Programming Center" href="http://java.sun.com/new2java/"&gt;New to Java Programming Center&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;The New to Java Programming Center helps developers who are new to the
Java platform find what they need to set up their system, understand
the various technologies, and create applications for the desktop, web,
and devices. &lt;/p&gt; 
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/fkJ6sFoT2ac" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/learning_curve_journal_part_1</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/young_developer_learning_path</id>
        <title type="html">Young Developer Learning Path</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/CkCpqMRDeeo/young_developer_learning_path" />
        <published>2008-07-30T09:33:55-07:00</published>
        <updated>2008-07-30T09:33:55-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="developers" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="greenfoot" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="learning" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="students" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="tools" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="young" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">This article
describes the tools you can use to learn Java programming. You decide
which tool to start with based on what you currently know.</summary>
        <content type="html">By &lt;a href="http://java.sun.com/features/authors.html#nourie"&gt;Dana Nourie&lt;/a&gt;, July 2008
 
          
         
          
  
  &lt;div style="padding: 0px;" class="sitelinks"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; &lt;!--
&lt;td valign="bottom" align="right"&gt;&lt;img src="/im/ic_email.gif" width="14" height="12" border="0" hspace="4" vspace="1" alt=" " /&gt;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="#{link placeholder}"&gt;E-mail&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="/jsp_utils/PrintPage.jsp" target="printFriendlyView" onclick="if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}if(window.parent &amp;amp;&amp;amp; window.parent.Xinha){return false}openPopup('','printFriendlyView',710,650,'no',1,1,0,0,0,0); return true;"&gt;&lt;img src="/im/ic_print.gif" width="14" height="12" alt="Print-friendly Version" border="0" hspace="4" /&gt;Print-friendly Version&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td valign="bottom" align="right"&gt;&lt;img src="/im/ic_download_thin.gif" width="9" height="14" hspace="4" border="0" alt=" " /&gt;&lt;/td&gt;
&lt;td valign="bottom" class="smaller" nowrap="nowrap"&gt;&lt;a href="#{link placeholder}"&gt;Download&lt;/a&gt;&lt;/td&gt;
--&gt; &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;br /&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" alt=" " src="http://java.sun.com/im/a.gif" /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; &lt;!--  END VCD4 BYLINE AND TOOLS  --&gt; 
  &lt;p&gt;Learning the Java platform is an adventure. There is so much you can
do with Java technologies. Yet, figuring out what you want to do and
where to start is the first hurdle you need to clear. This article
describes the tools you can use to learn Java programming. You decide
which tool to start with based on what you currently know. After
reading about the tools, you'll discover resources to learn about the
technologies, and the details of the Java programming language.&lt;/p&gt; &lt;!-- BEGIN IMAGE WITH CAPTION --&gt; 
  &lt;table cellspacing="0" cellpadding="2" border="0" width="450"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center" class="grey3"&gt; &lt;img height="320" width="450" alt="Greenfoot Lunarlander" src="http://java.sun.com/developer/technicalArticles/young_dev_learning_path/images/screen-lunarlander.jpg" /&gt; 
          &lt;div class="pad3"&gt; &lt;span class="dkcaption1"&gt;&lt;b&gt;Figure 1.&lt;/b&gt; &lt;i&gt;Greenfoot Lunarlander&lt;/i&gt;&lt;/span&gt;&lt;/div&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;!-- END IMAGE WITH CAPTION --&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;The adventure of learning the Java platform should be fun, clear,
and exciting. Start with one of the tools listed below, work your way
into the next tool, and include the resources as you feel ready. Before
you know it, you'll be creating exciting Java applications.&lt;/p&gt; 
  &lt;div&gt;&lt;b&gt;Before You Begin&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;Before you read about the tools and resources, you need the Java
Standard Edition (Java SE) for any of the tools listed below to work.&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://java.sun.com/javase/downloads/?intcmp=1281"&gt;Download Java SE&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;Once Java SE is installed on your computer, you are ready to consider the various teaching tools.&lt;/p&gt; 
  &lt;div&gt;&lt;b&gt;Tools Overview&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;Which tool you decide to use depends on what you already know about
programming, and specifically Java programming. All of the tools listed
here are designed to show you programming visually instead of just a
bunch of confusing lines of code. The tools demonstrate the
relationships between &lt;a title="What's an Object?" href="http://java.sun.com/docs/books/tutorial/java/concepts/object.html"&gt;objects&lt;/a&gt;
(you'll learn about objects within the tools), and how to make those
objects interact and do things. Yet, each tool has been designed with a
certain audience in mind.&lt;/p&gt; 
  &lt;p&gt;If you start with no programming experience and move from one tool
to the next, the basic learning path is: Greenfoot &amp;gt; BlueJ &amp;gt; the
NetBeans IDE BlueJ Edition, as shown in Figure 2:&lt;/p&gt; &lt;!-- BEGIN IMAGE WITH CAPTION --&gt; 
  &lt;table cellspacing="0" cellpadding="2" border="0" width="437"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center" class="grey3"&gt; &lt;img height="177" width="437" alt="Learning Path for new developers" src="http://java.sun.com/developer/technicalArticles/young_dev_learning_path/images/path.jpg" /&gt; 
          &lt;div class="pad3"&gt; &lt;span class="dkcaption1"&gt;&lt;b&gt;Figure 2.&lt;/b&gt; &lt;i&gt;Tools Learning Path&lt;/i&gt;&lt;/span&gt;&lt;/div&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;!-- END IMAGE WITH CAPTION --&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; 
  &lt;p&gt;Many of you, however, may know some programming, or you may know a
little of another programming language, or maybe you've taken a class
or two but need greater understanding. The descriptions of each tool
below will help you decide which tool is best for you based on where
are you are starting on your learning path now.&lt;/p&gt; 
  &lt;div&gt;&lt;b&gt;The Learning Tools&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;Each of the tools helps you visualize what is happening when you
create a program. They help you see the objects and interactions so you
can better understand the abstract concepts. All are intended to help
you learn Java programming in a fun, clear way.&lt;/p&gt; &lt;!-- BEGIN VCH3 PHOTO COMPONENT  --&gt; 
  &lt;table cellspacing="0" cellpadding="2" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center"&gt; &lt;img height="64" border="0" width="64" src="http://java.sun.com/developer/technicalArticles/young_dev_learning_path/images/greenfoot-icon-64.png" /&gt;&lt;b&gt;Greenfoot&lt;/b&gt; [&lt;a target="_blank" title="Download Greenfoot" href="http://www.greenfoot.org/download/"&gt;Download&lt;/a&gt;]
&lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;!-- END VCH3 PHOTO COMPONENT --&gt; 
  &lt;p&gt;Greenfoot is aimed at high school level (13+), but that doesn't mean
someone younger or older won't benefit from it. Basically, Greenfoot is
aimed at school level programming. The emphasis is to get something
exciting and fun on screen very quickly. It's an easy entry into
programming, for people who want to see what programming is like. It's
great for people who have had no prior interest in programming.
Greenfoot is fun, it's exciting, and it generates interest because it's
specialized for building graphical 2D applications. This makes what you
create visually fun. It's intended to draw you in to programming. Once
you're hooked, you can graduate on to BlueJ, and then later to the
NetBeans IDE BlueJ Edition.&lt;/p&gt; 
  &lt;p&gt;Download &lt;a target="_blank" href="http://www.greenfoot.org/doc/intro1.html"&gt;Quick Intro Tutorial&lt;/a&gt;&lt;/p&gt; &lt;!-- BEGIN VCH3 PHOTO COMPONENT  --&gt; 
  &lt;table cellspacing="0" cellpadding="2" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center"&gt; &lt;img height="64" border="0" width="64" src="http://java.sun.com/developer/technicalArticles/young_dev_learning_path/images/bluej-64-toned.jpg" /&gt;&lt;b&gt;BlueJ&lt;/b&gt; [&lt;a target="_blank" title="Download BlueJ" href="http://www.bluej.org/download/download.html"&gt;Download&lt;/a&gt;]
&lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;!-- END VCH3 PHOTO COMPONENT --&gt; 
  &lt;p&gt;BlueJ is aimed more at intro university level. It assumes that you
know that you are interested in learning programming, and you want to
do it in an organized way. BlueJ is generic. It can be used to develop
any kind of application. BlueJ teaches the fundamentals of &lt;a href="http://java.sun.com/docs/books/tutorial/java/concepts/object.html"&gt;objects&lt;/a&gt;, &lt;a href="http://java.sun.com/books/tutorial/java/javaOO/methods.html"&gt;methods&lt;/a&gt;, and &lt;a href="http://java.sun.com/docs/books/tutorial/java/javaOO/initial.html"&gt;fields&lt;/a&gt;,
and shows you visually the relationships between everything you create.
You learn the nuts and bolts of the Java programming language, and can
also see what is happening visually. Special emphasis is placed on
visualization and interaction techniques to create a highly interactive
environment that encourages experimentation and exploration.&lt;/p&gt; 
  &lt;table cellspacing="0" cellpadding="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr align="left" valign="top"&gt; 
        &lt;td colspan="2"&gt;BlueJ Supports:&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr align="left" valign="top"&gt; 
        &lt;td&gt; 
          &lt;p&gt;&lt;img hspace="0" height="11" border="0" align="top" width="11" vspace="0" alt="RingsDataListIcon.gif" src="http://www.bluej.org/images/decor/bullet.gif" id="Picture2" /&gt; &lt;/p&gt; 
        &lt;/td&gt; 
        &lt;td&gt; 
          &lt;p&gt;Fully Integrated Environment &lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr align="left" valign="top"&gt; 
        &lt;td&gt; 
          &lt;p&gt;&lt;img hspace="0" height="11" border="0" align="top" width="11" vspace="0" alt="RingsDataListIcon.gif" src="http://www.bluej.org/images/decor/bullet.gif" id="Picture5" /&gt; &lt;/p&gt; 
        &lt;/td&gt; 
        &lt;td&gt; 
          &lt;p&gt;Graphical Class Structure Display &lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr align="left" valign="top"&gt; 
        &lt;td&gt; 
          &lt;p&gt;&lt;img hspace="0" height="11" border="0" align="top" width="11" vspace="0" alt="RingsDataListIcon.gif" src="http://www.bluej.org/images/decor/bullet.gif" id="Picture4" /&gt; &lt;/p&gt; 
        &lt;/td&gt; 
        &lt;td&gt; 
          &lt;p&gt;Graphical and Textual Editing &lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr align="left" valign="top"&gt; 
        &lt;td&gt; 
          &lt;p&gt;&lt;img hspace="0" height="11" border="0" align="top" width="11" vspace="0" alt="RingsDataListIcon.gif" src="http://www.bluej.org/images/decor/bullet.gif" id="Picture6" /&gt; &lt;/p&gt; 
        &lt;/td&gt; 
        &lt;td&gt; 
          &lt;p&gt;Built-in Editor, Compiler, Virtual Machine, Debugger, etc. &lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr align="left" valign="top"&gt; 
        &lt;td&gt; 
          &lt;p&gt;&lt;img hspace="0" height="11" border="0" align="top" width="11" vspace="0" alt="RingsDataListIcon.gif" src="http://www.bluej.org/images/decor/bullet.gif" id="Picture3" /&gt; &lt;/p&gt; 
        &lt;/td&gt; 
        &lt;td&gt; 
          &lt;p&gt;Easy-to-use Interface, deal for beginners &lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr align="left" valign="top"&gt; 
        &lt;td&gt; 
          &lt;p&gt;&lt;img hspace="0" height="11" border="0" align="top" width="11" vspace="0" alt="RingsDataListIcon.gif" src="http://www.bluej.org/images/decor/bullet.gif" id="Picture7" /&gt; &lt;/p&gt; 
        &lt;/td&gt; 
        &lt;td&gt; 
          &lt;p&gt;Interactive Object Creation &lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr align="left" valign="top"&gt; 
        &lt;td&gt; 
          &lt;p&gt;&lt;img hspace="0" height="11" border="0" align="top" width="11" vspace="0" alt="RingsDataListIcon.gif" src="http://www.bluej.org/images/decor/bullet.gif" id="Picture8" /&gt; &lt;/p&gt; 
        &lt;/td&gt; 
        &lt;td&gt; 
          &lt;p&gt;Interactive Object Calls &lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr align="left" valign="top"&gt; 
        &lt;td&gt; 
          &lt;p&gt;&lt;img hspace="0" height="11" border="0" align="top" width="11" vspace="0" alt="RingsDataListIcon.gif" src="http://www.bluej.org/images/decor/bullet.gif" id="Picture10" /&gt; &lt;/p&gt; 
        &lt;/td&gt; 
        &lt;td&gt; 
          &lt;p&gt;Interactive Testing &lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr align="left" valign="top"&gt; 
        &lt;td&gt; 
          &lt;p&gt;&lt;img hspace="0" height="11" border="0" align="top" width="11" vspace="0" alt="RingsDataListIcon.gif" src="http://www.bluej.org/images/decor/bullet.gif" id="Picture12" /&gt; &lt;/p&gt; 
        &lt;/td&gt; 
        &lt;td&gt; 
          &lt;p&gt;Incremental Application Development &lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; 
  &lt;p&gt;Download &lt;a target="_blank" href="http://www.bluej.org/tutorial/tutorial-201.pdf"&gt;The BlueJ Tutorial&lt;/a&gt;&lt;/p&gt; &lt;!-- BEGIN VCH3 PHOTO COMPONENT  --&gt; 
  &lt;table cellspacing="0" cellpadding="2" border="0"&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;td align="center"&gt; &lt;img height="88" border="0" width="100" src="http://java.sun.com/developer/technicalArticles/young_dev_learning_path/images/nb_bluej.png" /&gt;&lt;b&gt;NetBeans IDE BlueJ Edition&lt;/b&gt; [&lt;a target="_blank" title="Download NetBeans BlueJ Edition" href="http://edu.netbeans.org/bluej/"&gt;Download&lt;/a&gt;]
&lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; &lt;span class="sp10"&gt; &lt;/span&gt;&lt;br /&gt; &lt;!-- END VCH3 PHOTO COMPONENT --&gt; 
  &lt;p&gt;BlueJ is an environment specifically aimed at beginning programmers.
It offers educational tools, such as visualization and interaction
facilities that greatly aid the learning of object-oriented concepts.
While BlueJ covers the introductory phase of learning to program, and
NetBeans offers powerful tools for professional developers, the
inevitable step from one into the other has been a difficult barrier
for students - until now.&lt;/p&gt; 
  &lt;p&gt;This tool offers a seamless migration path for students that
supports the switch from educational tools into a full-featured,
professional IDE. The BlueJ plug-in adds two significant features to
the NetBeans IDE:&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;It allows NetBeans to open, work with, and create BlueJ projects in
the BlueJ-native format (without converting them to-and-from the
NetBeans IDE standard projects), so that you can do some of your work
in the NetBeans IDE,and some back in BlueJ, wherever you feel
comfortable working.&lt;/li&gt; 
    &lt;li&gt;It adds a BlueJ View tab to the NetBeans Project Window, which gives a familiar view of your BlueJ projects.&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;Download &lt;a target="_blank" href="http://www.bluej.org/netbeans/tutorial/"&gt;The Netbeans BlueJ Plug-in Tutorial&lt;/a&gt;&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/tools/bluej/index.html"&gt;An extended tutorial&lt;/a&gt; by Dana Nourie.&lt;/li&gt; 
    &lt;li&gt;&lt;a target="_blank" href="/SDNChannel/entry/jumpstart_your_programming_career"&gt;A video&lt;/a&gt; on NetBeans/BlueJ from the Sun Developer Network.&lt;/li&gt; 
    &lt;li&gt;A set of &lt;a target="_blank" href="http://www.bluej.org/netbeans/labs/transition.html"&gt;Lab Notes&lt;/a&gt; to help in the transition from BlueJ, and show a few of the facilities that the NetBeans IDE offers to programmers.&lt;/li&gt; 
    &lt;li&gt;If you really want to see how far you can take the Zuul-for-NetBeans project, check out Brian Leonard's excellent &lt;a target="_blank" href="http://www.netbeans.org/kb/55/zuul-server.html"&gt;Zuul everywhere&lt;/a&gt; tutorial.&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;div&gt;&lt;b&gt;Tutorials for Learning the Java Programming Language&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;Once you are using BlueJ or the NetBeans BlueJ Edition, you'll also
need to learn the basics of the Java programming language. Your best
resource for this is &lt;b&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/index.html"&gt;The Java Tutorial&lt;/a&gt;&lt;/b&gt;.
Don't let these online tutorials overwhelm you. Take it little by
little as you work through projects in the tool you are using. The Java
Tutorial teaches the syntax of the Java programming language as well as
how to use the thousands of &lt;a href="http://java.sun.com/docs/books/tutorial/java/javaOO/index.html"&gt;classes&lt;/a&gt; available to you.&lt;/p&gt; 
  &lt;p&gt;Bookmark the &lt;a href="http://java.sun.com/new2java/"&gt;New to Java Programming Center&lt;/a&gt;.
Articles and tutorials posted in the center are aimed at learning
developers, and are updated often. The level of programming covered
varies from beginning to intermediate. The &lt;a href="http://java.sun.com/new2java/learning/index.jsp"&gt;Learning Tab&lt;/a&gt;
in the center also has a list of articles and tutorials to get you
started that should be helpful in the beginning of your learning path. &lt;a title="Young Developers" href="http://java.sun.com/new2java/learning/young_developers.jsp"&gt;Young Developers&lt;/a&gt; is designed specifically for people 13 years old and up.&lt;br /&gt;&lt;/p&gt; 
  &lt;p&gt;Additionally, you can subscribe to &lt;a target="_blank" href="/JavaFundamentals/"&gt;Java Technology Fundamentals&lt;/a&gt;
through convenient RSS feeds. Articles aimed at beginners to
intermediate programmers go out in the feed several times a month. Some
of these are articles that were published on &lt;a href="http://java.sun.com/"&gt;java.sun.com&lt;/a&gt;, some are lessons from the Java Tutorial, and some are specifically written for &lt;a target="_blank" href="/JavaFundamentals/"&gt;Java Technology Fundamentals&lt;/a&gt; and the &lt;a href="http://java.sun.com/new2java/"&gt;New to Java Programming Center&lt;/a&gt;. All are designed to help you learn the Java platform.&lt;/p&gt; 
  &lt;p&gt;If you have a Facebook account, be sure to Become a Fan of the &lt;a target="_blank" title="Getting Started with Java Programming" href="http://www.new.facebook.com/pages/Get-Started-with-Java-Programming/20602215818?ref=share"&gt;Getting Started with Java Programming&lt;/a&gt; page and visit it regularly, as new content is added automatically through RSS feeds.&lt;/p&gt; 
  &lt;p&gt;When your programming skills are more intermediate, then also consider subscribing to &lt;a target="_blank" href="/CoreJavaTechTips/"&gt;Core Tech Tips&lt;/a&gt;. Like &lt;a target="_blank" href="/JavaFundamentals/"&gt;Java Technology Fundamentals&lt;/a&gt;, &lt;a target="_blank" href="/CoreJavaTechTips/"&gt;Core Tech Tips&lt;/a&gt; go out several times a month, but these programming tips are aimed at intermediate to advanced Java developers.&lt;/p&gt; 
  &lt;div&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/div&gt; 
  &lt;div class="contentdivider"&gt; 
    &lt;table cellspacing="0" cellpadding="0" border="0" width="100%" class="grey4"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt;&lt;img height="4" border="0" width="1" src="http://java.sun.com/im/a.gif" /&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;p&gt;Choose your learning tool, use the resources, start programming, and have fun!&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/CkCpqMRDeeo" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/young_developer_learning_path</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/creating_a_custom_java_desktop</id>
        <title type="html">Creating a Custom Java Desktop Database Application</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/rJefpSqjAhY/creating_a_custom_java_desktop" />
        <published>2008-07-28T09:23:32-07:00</published>
        <updated>2008-07-28T09:23:32-07:00</updated> 
        <category term="/Desktop" label="Desktop" />
        <category term="database" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java-se" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="mysql" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">This tutorial guides you through the creation of a complete desktop database
      application that enables its user to browse and edit customer records and purchase
    history.</summary>
        <content type="html">&lt;p&gt; &lt;/p&gt; 
  &lt;p&gt;This tutorial guides you through the creation of a complete desktop database
      application that enables its user to browse and edit customer records and purchase
    history. The resulting application includes the following main features:&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;A main view that enables users to browse customer records and
      customer purchases.&lt;/li&gt; 
    &lt;li&gt;A search field for the customer records.&lt;/li&gt; 
    &lt;li&gt;Separate dialog boxes for entering new records or modifying
      existing records. &lt;/li&gt; 
    &lt;li&gt;Code to interact with multiple related database tables.&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;&lt;b&gt;Contents&lt;/b&gt;&lt;/p&gt; &lt;img height="114" width="114" title="Content on this page applies to the NetBeans IDE 6.0 and 6.1" alt="Content on this page applies to NetBeans IDE 6.0 and 6.1" class="stamp" src="http://www.netbeans.org/images/articles/61/netbeans-stamp.gif" /&gt; 
  &lt;ul class="toc"&gt; 
    &lt;li&gt;&lt;a href="http://www.netbeans.org/kb/61/java/gui-db-custom.html#intro"&gt;Introduction&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.netbeans.org/kb/61/java/gui-db-custom.html#db-setup"&gt;Setting Up the Database&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.netbeans.org/kb/61/java/gui-db-custom.html#skeleton"&gt;Creating the Application Skeleton&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.netbeans.org/kb/61/java/gui-db-custom.html#custom-master-detail"&gt;Customizing the Master/Detail View&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.netbeans.org/kb/61/java/gui-db-custom.html#dialogs"&gt;Adding Dialog Boxes&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.netbeans.org/kb/61/java/gui-db-custom.html#save-cancel"&gt;Activating the Save and Cancel Buttons in the Dialog Boxes&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.netbeans.org/kb/61/java/gui-db-custom.html#enhancements"&gt;Currency Rendering, Date Verifying, and Search&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.netbeans.org/kb/61/java/gui-db-custom.html#seealso"&gt;See Also&lt;/a&gt;&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;&lt;b&gt;To follow this tutorial, you need the following software and resources.&lt;/b&gt;&lt;/p&gt; 
  &lt;table&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;th scope="col" class="tblheader"&gt;Software or Resource&lt;/th&gt; 
        &lt;th scope="col" class="tblheader"&gt;Version Required&lt;/th&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td class="tbltd1"&gt;NetBeans IDE&lt;/td&gt; 
        &lt;td class="tbltd1"&gt;&lt;a href="http://download.netbeans.org/netbeans/6.1/final/"&gt;Version 6.1&lt;/a&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td class="tbltd1"&gt;Java Development Kit (JDK)&lt;/td&gt; 
        &lt;td class="tbltd1"&gt;&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;Version 6&lt;/a&gt; or&lt;br /&gt;
          version 5&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td class="tbltd1"&gt;&lt;a href="http://usersguide.netbeans.org/files/documents/40/2013/MyBusinessRecords.sql"&gt;SQL script to create the database tables&lt;/a&gt;&lt;/td&gt; 
        &lt;td class="tbltd1"&gt;&lt;br /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td class="tbltd1"&gt;&lt;a href="http://usersguide.netbeans.org/files/documents/40/2015/custom-crud-utility-classes.zip"&gt;zip file of utility classes&lt;/a&gt;&lt;/td&gt; 
        &lt;td class="tbltd1"&gt;&lt;br /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; 
  &lt;p&gt;&lt;b class="notes"&gt;Note: &lt;/b&gt;
    You can download the &lt;a href="http://usersguide.netbeans.org/files/documents/40/2016/CustomerRecords.zip"&gt;final working project&lt;/a&gt;
   created in this tutorial at any time and open it in the IDE to view the classes.
 If you want to run the downloaded project, be sure to clean and build it before running.&lt;/p&gt; &lt;a name="intro"&gt;&lt;/a&gt; 
  &lt;h2&gt;Introduction&lt;/h2&gt; 
  &lt;p&gt;This application takes advantage of the following technologies:&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;The Java Persistence API (JPA), which helps you interact with a
      database using Java code.&lt;/li&gt; 
    &lt;li&gt;Beans Binding, which enables you to keep Swing component properties
      synchronized.&lt;/li&gt; 
    &lt;li&gt;The Swing Application Framework, which simplifies basic application
        functions such as persisting session information, handling actions, and
      managing resources.&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;The tutorial makes use of IDE wizards and other code generation features
      to provide much of the boilerplate code. It also shows you how to
    customize the generated code and hand code other parts of the application.&lt;/p&gt; 
  &lt;p&gt;This tutorial takes approximately 2 hours to complete. For a shorter tutorial
    that shows the creation of a less customized user interface, see
&lt;a href="http://www.netbeans.org/kb/60/java/gui-db.html"&gt;Building a Java Desktop Database Application&lt;/a&gt;.&lt;/p&gt; 
  &lt;p&gt;Below is a screenshot of the working application that you will have
    when you complete the tutorial.&lt;/p&gt; &lt;img height="525" width="531" class="margin-around" alt="A screenshot of an application with a
          main frame that has a master/detail view of customer and order records.
          There is a search field that has the letters jul entered, and the two
          displayed customer records both have the jul string. In addition,
          an Order Editor dialog is displayed and contains an open combo box
          showing items to select from." src="http://www.netbeans.org/images/articles/61/java/gui-db-custom/finishedapp.png" /&gt; &lt;!--TODO note on other tutorials, including mention of the fact that this
    tutorial doesn't really discuss the mechanics of beans binding--&gt; &lt;a name="db-setup"&gt;&lt;/a&gt; 
  &lt;h2&gt;Setting Up the Database&lt;/h2&gt; 
  &lt;p&gt;Before creating any application code, we will set up the database.
      We will then
      be able to take advantage of wizards that generate much of the application
    code based on the structure of the database.&lt;/p&gt; 
  &lt;p&gt;The instructions in this tutorial are based using a MySQL database that you
    create with &lt;a href="http://usersguide.netbeans.org/files/documents/40/2013/MyBusinessRecords.sql"&gt;this SQL script&lt;/a&gt;. &lt;/p&gt; 
  &lt;p&gt;&lt;b class="notes"&gt;Note: &lt;/b&gt;You can use other database management software, but
      doing so might require making some adjustments to the SQL script. In addition,
    you will need to create the database from outside of the IDE.&lt;/p&gt; 
  &lt;p&gt;To set up the IDE to work with MySQL databases, see the
    &lt;a href="http://www.netbeans.org/kb/61/ide/mysql.html"&gt;Connecting to a MySQL Database&lt;/a&gt; page.&lt;/p&gt; 
  &lt;p&gt;&lt;b&gt;To create the database:&lt;/b&gt;&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;In the Services window, right-click the MySQL Server node and choose Start.&lt;/li&gt; 
    &lt;li&gt;Right-click the MySQL Server node and choose Create Database.
        
      
      
      &lt;p&gt;If the Create
        Database item isn't enabled, choose Connect. You might then need to
      enter a password. The Create Database item should then be enabled.
      &lt;/p&gt; 
    &lt;/li&gt; 
    &lt;li&gt;For Database Name, type &lt;code&gt;MyBusinessRecords&lt;/code&gt; and click OK.&lt;/li&gt; 
    &lt;li&gt;In the New Database Connection dialog, type &lt;code&gt;nbuser&lt;/code&gt; as the password and
      click OK.&lt;/li&gt; 
    &lt;li&gt;If the Advanced tab of the dialog box opens, click OK to close the dialog box.&lt;/li&gt; 
    &lt;li&gt;Scroll down to the node for connection that you have just created. The node
        should have the &lt;img alt="connection node" src="http://www.netbeans.org/images/articles/derby/55/connection-node-icon.png" /&gt; icon.&lt;/li&gt; 
    &lt;li&gt;Right-click the connection node and choose Execute Command.&lt;/li&gt; 
    &lt;li&gt;Copy the contents of the
      &lt;a href="http://usersguide.netbeans.org/files/documents/40/2013/MyBusinessRecords.sql"&gt;MyBusinessRecords SQL script&lt;/a&gt;
      and paste them into the SQL Command 1 tab of the Source Editor.
      &lt;/li&gt; 
    &lt;li&gt;Click the Run SQL button (&lt;img alt="Run SQL button" src="http://www.netbeans.org/images/articles/ide-gui-db-prev/execute-sql.png" /&gt;)in
        the toolbar of the Source Editor to run the script.
      
      
      
      &lt;p&gt;Output of the script should appear in the Output window.&lt;/p&gt; 
    &lt;/li&gt; 
    &lt;li&gt;Right-click the connection node again and choose refresh.&lt;/li&gt; 
    &lt;li&gt;Expand the node, and expand its Tables subnode.
      
      
      
      &lt;p&gt;You should see four database tables listed.&lt;/p&gt; 
    &lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;The database structure was designed with normalization and referential
    integrity in mind. Here are some notes on the structure:&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;The data is split among several tables to reduce duplication and the
        possibility for inconsistencies. Some tables are connected to each other
      through foreign keys.&lt;/li&gt; 
    &lt;li&gt;All of the tables use MySQL's AUTO_INCREMENT attribute so that there is a unique identifier
        for each row in those tables. This identifier is created by the database management
        software, so your application and/or your application's user do not have to create this
        identifier. (For AUTO_INCREMENT to work properly within the
        application, you need to add the
        &lt;code&gt;@GeneratedValue(strategy=GenerationType.IDENTITY&lt;/code&gt;
        annotation for that column in the table's entity class. Otherwise, the application
      does not try to submit a value for that column when you create a new record.) &lt;/li&gt; 
    &lt;li&gt;The foreign key in the ORDERS table is there to link each order record
        with a customer. In the application's user interface, ORDER records are only displayed
      for the selected CUSTOMER.&lt;/li&gt; 
    &lt;li&gt;The ON CASCADE DELETE attribute for the foreign key to the CUSTOMERS class ensures that a
      customer's orders are also deleted when a customer is deleted.&lt;/li&gt; 
    &lt;li&gt;The foreign key in the CUSTOMERS table points to a COUNTRIES table. We
        will use this relationship in the application to enable the user to select
      a customer's country from a combo box.&lt;/li&gt; 
    &lt;li&gt;The ORDERS table has a foreign key to the PRODUCTS table. When
        adding a new order record, the user will be able to choose a product
      from a combo box.&lt;/li&gt; 
    &lt;li&gt;The COUNTRIES and PRODUCTS tables are pre-populated with data so that you
        can choose from those tables when the user of the application is adding customer
      and order records.&lt;/li&gt; 
    &lt;li&gt;Though this tutorial does not cover it, you might find it useful to create
        separate applications to populate the COUNTRIES and PRODUCTS tables. Such applications
        could be created with the Java Desktop Application project template and would not
      require additional hand-coding.&lt;/li&gt; 
  &lt;/ul&gt; &lt;a name="skeleton"&gt;&lt;/a&gt; 
  &lt;h2&gt;Creating the Application Skeleton&lt;/h2&gt; 
  &lt;p&gt;We will use the IDE's Java Desktop Application project template to create
      much of the base code for the application. This template generates code for
    the following features:&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;Connection to the database.&lt;/li&gt; 
    &lt;li&gt;A main application frame that contains tables for customer details and
      customer orders.&lt;/li&gt; 
    &lt;li&gt;A main application class that handles basic application life-cycle functions, including
      persisting of window state between sessions and resource injection.&lt;/li&gt; 
    &lt;li&gt;Actions (and corresponding buttons) for standard database
      application commands.&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;&lt;a href="http://www.netbeans.org/kb/61/java/gui-db-custom.html"&gt;Read the rest of this tutorial&lt;/a&gt;.&lt;/p&gt; 
  &lt;p&gt;For general tips and tricks on using the GUI Builder in NetBeans IDE, see
    the &lt;a href="http://wiki.netbeans.org/wiki/view/NetBeansUserFAQ#section-NetBeansUserFAQ-GUIEditorMatisse"&gt;GUI Editor FAQ&lt;/a&gt;
    and &lt;a href="http://weblogs.java.net/blog/pkeegan/"&gt;Patrick Keegan's web log&lt;/a&gt;.


  

  &lt;/p&gt; 
  &lt;p&gt;*******************&lt;/p&gt; 
  &lt;p&gt;&lt;a title="Get Started with Java Programming" href="http://www.facebook.com/profile.php?id=1366910038#/pages/Get-Started-with-Java-Programming/20602215818?ref=share"&gt;Get Started with Java Programming!&lt;/a&gt; &lt;/p&gt; Now Facebook users have a page to lead them to content that can help
them learn Java programming. Log in to your Facebook account and Become
a Fan of&amp;nbsp; &lt;a title="Get Started with Java Programming" href="http://www.facebook.com/profile.php?id=1366910038#/pages/Get-Started-with-Java-Programming/20602215818?ref=share"&gt;Get Started with Java Programming!&lt;/a&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/rJefpSqjAhY" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/creating_a_custom_java_desktop</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/lesson_interfaces</id>
        <title type="html">Lesson: Interfaces</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/plDwkWQwiyE/lesson_interfaces" />
        <published>2008-07-21T09:59:54-07:00</published>
        <updated>2008-07-21T10:01:40-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="interfaces" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn how and when to use Interfaces.</summary>
        <content type="html">&lt;blockquote&gt;
The &lt;i&gt;core collection interfaces&lt;/i&gt; encapsulate different
types of collections, which are shown in the figure below. These
interfaces allow collections to be manipulated independently of the
details of their representation. Core collection interfaces are
the foundation of the Java Collections Framework.

As you can see in
&lt;span id="figure:colls-coreInterfaces.gif"&gt;the following figure&lt;/span&gt;, the core collection interfaces form a hierarchy.

&lt;center&gt; 
      &lt;p&gt;&lt;img height="129" align="bottom" width="438" alt="Two interface trees, one starting with Collection and including Set, SortedSet, List, and Queue, and the other starting with Map and including SortedMap." src="http://java.sun.com/docs/books/tutorial/figures/collections/colls-coreInterfaces.gif" /&gt;&lt;a href="/roller-ui/authoring/entryAdd.rol?weblog=JavaFundamentals"&gt;blogs.sun.com: New Entry&lt;/a&gt;&lt;/p&gt; 
      &lt;p class="FigureCaption"&gt;The core collection interfaces.&lt;/p&gt;&lt;/center&gt;A &lt;code&gt;Set&lt;/code&gt; is a special kind of
&lt;code&gt;Collection&lt;/code&gt;, a &lt;code&gt;SortedSet&lt;/code&gt; is a special kind of
&lt;code&gt;Set&lt;/code&gt;, and so forth. Note also that the hierarchy consists
of two distinct trees — a &lt;code&gt;Map&lt;/code&gt; is not a true
&lt;code&gt;Collection&lt;/code&gt;.


    
    
    &lt;p&gt;

Note that all the core collection interfaces are generic. For example,
this is the declaration of the &lt;code&gt;Collection&lt;/code&gt; interface.

&lt;/p&gt; 
    &lt;blockquote&gt; 
      &lt;pre&gt;public interface Collection&amp;lt;E&amp;gt;...
&lt;/pre&gt; 
    &lt;/blockquote&gt; 
    &lt;p&gt;

The &lt;code&gt;&amp;lt;E&amp;gt;&lt;/code&gt; syntax tells you that the interface is generic. When you declare a &lt;code&gt;Collection&lt;/code&gt; instance you can &lt;i&gt;and
should&lt;/i&gt; specify the type of object contained in the collection.
Specifying the type allows the compiler to verify (at compile-time) that
the type of object you put into the collection is correct, thus reducing
errors at runtime. For information on generic types, see the
&lt;a href="http://java.sun.com/docs/books/tutorial/java/generics/index.html" target="_top" class="TutorialLink"&gt;Generics&lt;/a&gt; lesson.

&lt;/p&gt; 
    &lt;p&gt;

When you understand how to use these interfaces, you will know most of what
there is to know about the Java Collections Framework. This chapter
discusses general guidelines for effective use of the interfaces,
including when to use which interface. You'll also learn programming
idioms for each interface to help you get the most out of it.

&lt;/p&gt; 
    &lt;p&gt;

To keep the number of core collection interfaces manageable, the
Java platform doesn't provide separate interfaces for each variant
of each collection type. (Such variants might include immutable,
fixed-size, and append-only.) Instead, the modification operations
in each interface are designated &lt;i&gt;optional&lt;/i&gt; — a given implementation
may elect not to support all operations. If an unsupported operation is
invoked, a collection throws an
&lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/UnsupportedOperationException.html" target="_blank" class="APILink"&gt;&lt;code&gt;UnsupportedOperationException&lt;/code&gt;&lt;/a&gt;.

Implementations are responsible for documenting which of the optional
operations they support. All of the Java platform's general-purpose
implementations support all of the optional operations.

&lt;/p&gt; 
    &lt;p&gt;

The following list describes the core collection interfaces:
&lt;/p&gt; 
    &lt;ul&gt; 
      &lt;li&gt;&lt;code&gt;Collection&lt;/code&gt; — the root of the collection hierarchy.
A collection represents a group of objects known as its
&lt;i&gt;elements&lt;/i&gt;. The &lt;code&gt;Collection&lt;/code&gt; interface is the least
common denominator that all collections implement and is used to pass
collections around and to manipulate them when maximum generality is
desired. Some types of collections allow duplicate elements, and others
do not. Some are ordered and others are unordered. The Java platform doesn't
provide any direct implementations of this interface but provides
implementations of more specific subinterfaces, such as &lt;code&gt;Set&lt;/code&gt;
and &lt;code&gt;List&lt;/code&gt;. Also see
&lt;a href="http://java.sun.com/docs/books/tutorial/collections/interfaces/collection.html" target="_top" class="TutorialLink"&gt;The Collection Interface&lt;/a&gt; section.


        
        
        &lt;p&gt; &lt;/p&gt; 
      &lt;/li&gt; 
      &lt;li&gt;&lt;code&gt;Set&lt;/code&gt; — a collection that cannot contain duplicate elements. This interface models the mathematical set abstraction and is used to
represent sets, such as the cards comprising a poker hand, the courses
making up a student's schedule, or the processes running on a machine.
See also
&lt;a href="http://java.sun.com/docs/books/tutorial/collections/interfaces/set.html" target="_top" class="TutorialLink"&gt;The Set Interface&lt;/a&gt; section.


        
        
        &lt;p&gt; &lt;/p&gt; 
      &lt;/li&gt; 
      &lt;li&gt;&lt;code&gt;List&lt;/code&gt; — an ordered collection (sometimes called a
&lt;i&gt;sequence&lt;/i&gt;). &lt;code&gt;List&lt;/code&gt;s can contain duplicate elements. The user of a &lt;code&gt;List&lt;/code&gt; generally has precise control over where in the
list each element is inserted and can access elements by
their integer index (position). If you've used &lt;code&gt;Vector&lt;/code&gt;,
you're familiar with the general flavor of &lt;code&gt;List&lt;/code&gt;. Also see

&lt;a href="http://java.sun.com/docs/books/tutorial/collections/interfaces/list.html" target="_top" class="TutorialLink"&gt;The List Interface&lt;/a&gt; section.


        
        
        &lt;p&gt; &lt;/p&gt; 
      &lt;/li&gt; 
      &lt;li&gt;&lt;code&gt;Queue&lt;/code&gt; — a collection used to hold multiple elements
prior to processing. Besides basic &lt;code&gt;Collection&lt;/code&gt; operations,
a &lt;code&gt;Queue&lt;/code&gt; provides additional insertion, extraction, and inspection
operations. 
        
        
        &lt;p&gt;
Queues typically, but do not necessarily, order elements in a FIFO
(first-in, first-out) manner. Among the exceptions are priority queues,
which order elements according to a supplied comparator or the elements'
natural ordering. Whatever the ordering used, the head of the queue is
the element that would be removed by a call to &lt;code&gt;remove&lt;/code&gt; or
&lt;code&gt;poll&lt;/code&gt;. In a FIFO queue, all new elements are inserted at the
tail of the queue. Other kinds of queues may use different placement
rules. Every &lt;code&gt;Queue&lt;/code&gt; implementation must specify its ordering
properties. Also see
&lt;a href="http://java.sun.com/docs/books/tutorial/collections/interfaces/queue.html" target="_top" class="TutorialLink"&gt;The Queue Interface&lt;/a&gt; section.

&lt;/p&gt; 
        &lt;p&gt; &lt;/p&gt; 
      &lt;/li&gt; 
      &lt;li&gt;&lt;code&gt;Map&lt;/code&gt; — an object that maps keys to values. A
&lt;code&gt;Map&lt;/code&gt; cannot contain duplicate keys; each key can map to at
most one value. If you've used &lt;code&gt;Hashtable&lt;/code&gt;, you're already
familiar with the basics of &lt;code&gt;Map&lt;/code&gt;. Also see
&lt;a href="http://java.sun.com/docs/books/tutorial/collections/interfaces/map.html" target="_top" class="TutorialLink"&gt;The Map Interface&lt;/a&gt; section.
&lt;/li&gt; 
    &lt;/ul&gt;

The last two core collection interfaces are merely sorted versions of
&lt;code&gt;Set&lt;/code&gt; and &lt;code&gt;Map&lt;/code&gt;:

    
    
    &lt;ul&gt; 
      &lt;li&gt;&lt;code&gt;SortedSet&lt;/code&gt; — a &lt;code&gt;Set&lt;/code&gt; that maintains its elements in
ascending order. Several additional operations are provided to take
advantage of the ordering. Sorted sets are used for naturally ordered
sets, such as word lists and membership rolls. Also see
&lt;a href="http://java.sun.com/docs/books/tutorial/collections/interfaces/sorted-set.html" target="_top" class="TutorialLink"&gt;The SortedSet Interface&lt;/a&gt; section.

        
        
        &lt;p&gt; &lt;/p&gt; 
      &lt;/li&gt; 
      &lt;li&gt;&lt;code&gt;SortedMap&lt;/code&gt; — a &lt;code&gt;Map&lt;/code&gt; that maintains its
mappings in ascending key order. This is the &lt;code&gt;Map&lt;/code&gt; analog
of &lt;code&gt;SortedSet&lt;/code&gt;. Sorted maps are used for naturally ordered
collections of key/value pairs, such as dictionaries and telephone
directories. Also see
&lt;a href="http://java.sun.com/docs/books/tutorial/collections/interfaces/sorted-map.html" target="_top" class="TutorialLink"&gt;The SortedMap Interface&lt;/a&gt; section.
&lt;/li&gt; 
    &lt;/ul&gt;

To understand how the sorted interfaces maintain the order of
their elements, see the
&lt;a href="http://java.sun.com/docs/books/tutorial/collections/interfaces/order.html" target="_top" class="TutorialLink"&gt;Object Ordering&lt;/a&gt; section.




        
  
  
  &lt;/blockquote&gt; 
  &lt;div class="NavBit"&gt;
    &lt;p&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/collections/intro/index.html"&gt;« Previous&lt;/a&gt;
        •
        &lt;a href="http://java.sun.com/docs/books/tutorial/collections/TOC.html"&gt;Trail&lt;/a&gt;
        •
        &lt;a href="http://java.sun.com/docs/books/tutorial/collections/interfaces/collection.html"&gt;Next »&lt;/a&gt;&lt;/p&gt;
    &lt;p&gt;*******************&lt;/p&gt;
    &lt;p&gt;&lt;a href="http://www.facebook.com/profile.php?id=1366910038#/pages/Get-Started-with-Java-Programming/20602215818?ref=share" title="Get Started with Java Programming"&gt;Get Started with Java Programming!&lt;/a&gt; &lt;/p&gt;
    &lt;p&gt;Now Facebook users have a page to lead them to content that can help
them learn Java programming. Log in to your Facebook account and Become
a Fan of&amp;nbsp; &lt;a href="http://www.facebook.com/profile.php?id=1366910038#/pages/Get-Started-with-Java-Programming/20602215818?ref=share" title="Get Started with Java Programming"&gt;Get Started with Java Programming!&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;
    &lt;p&gt; &lt;br /&gt;&lt;/p&gt;
  &lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/plDwkWQwiyE" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/lesson_interfaces</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/how_to_use_actions</id>
        <title type="html">How to Use Actions</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/owx2ej-axjc/how_to_use_actions" />
        <published>2008-07-09T09:38:10-07:00</published>
        <updated>2008-07-09T09:38:10-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="actions" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="applications" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="gui" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="swing" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn how an 

&lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/Action.html" target="_blank" class="APILink"&gt;&lt;code&gt;Action&lt;/code&gt;&lt;/a&gt;
can be used to separate functionality and state from a component.</summary>
        <content type="html">&lt;blockquote&gt; 
    &lt;p&gt;An 

&lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/Action.html" target="_blank" class="APILink"&gt;&lt;code&gt;Action&lt;/code&gt;&lt;/a&gt;
can be used to separate functionality and state from a component. For 
example, if you have two or more components that perform the same function,
consider using an &lt;code&gt;Action&lt;/code&gt; object to implement the function. 
An &lt;code&gt;Action&lt;/code&gt; object is an

&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html" target="_top" class="TutorialLink"&gt;action listener&lt;/a&gt;
that provides not only action-event handling, but also centralized handling 
of the state of action-event-firing components such as 

&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/toolbar.html" target="_top" class="TutorialLink"&gt;tool bar buttons&lt;/a&gt;, 
&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html" target="_top" class="TutorialLink"&gt;menu items&lt;/a&gt;, 
&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/button.html" target="_top" class="TutorialLink"&gt;common buttons&lt;/a&gt;, and
&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html" target="_top" class="TutorialLink"&gt;text fields&lt;/a&gt;. The state that an action can handle includes text, icon, mnemonic, enabled, 
and selected status. &lt;/p&gt; 
    &lt;p&gt;You typically attach an action to a component using the 
&lt;code&gt;setAction&lt;/code&gt; method. Here's what happens when &lt;code&gt;setAction&lt;/code&gt; 
is invoked on a component: &lt;/p&gt; 
    &lt;ul&gt; 
      &lt;li&gt; The component's state is updated to match the state of the
     &lt;code&gt;Action&lt;/code&gt;.  
     For example, if the &lt;code&gt;Action&lt;/code&gt;'s text and icon values
     were set,
     the component's text and icon are set to those values.
&lt;/li&gt; 
      &lt;li&gt; The &lt;code&gt;Action&lt;/code&gt; object is registered as an action listener
     on the component.
&lt;/li&gt; 
      &lt;li&gt; If the state of the &lt;code&gt;Action&lt;/code&gt; changes, 
     the component's state is updated to match the &lt;code&gt;Action&lt;/code&gt;.
     For example, if you change the enabled status of the action,
     all components it's attached to change their enabled states
     to match the action.
&lt;/li&gt; 
    &lt;/ul&gt; 
    &lt;p&gt;Here's an example of creating a tool-bar button and menu item
that perform the same function:&lt;/p&gt; 
    &lt;blockquote&gt; 
      &lt;pre&gt;Action leftAction = new LeftAction(); &lt;i&gt;//LeftAction code is shown later&lt;/i&gt;
...
button = new JButton(leftAction)
...
menuItem = new JMenuItem(leftAction);
&lt;/pre&gt; 
    &lt;/blockquote&gt; 
    &lt;p&gt;To create an &lt;code&gt;Action&lt;/code&gt; object,
you generally create a subclass of
&lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractAction.html" target="_blank" class="APILink"&gt;&lt;code&gt;AbstractAction&lt;/code&gt;&lt;/a&gt; and then instantiate it.
In your subclass, 
you must implement the &lt;code&gt;actionPerformed&lt;/code&gt; method 
to react appropriately 
when the action event occurs.
Here's an example of creating and instantiating
an &lt;code&gt;AbstractAction&lt;/code&gt; subclass:

&lt;/p&gt; 
    &lt;blockquote&gt; 
      &lt;pre&gt;leftAction = new LeftAction("Go left", anIcon,
             "This is the left button.",
             new Integer(KeyEvent.VK_L));
...
class LeftAction extends AbstractAction {
    public LeftAction(String text, ImageIcon icon,
                      String desc, Integer mnemonic) {
        super(text, icon);
        putValue(SHORT_DESCRIPTION, desc);
        putValue(MNEMONIC_KEY, mnemonic);
    }
    public void actionPerformed(ActionEvent e) {
        displayResult("Action for first button/menu item", e);
    }
}
&lt;/pre&gt; 
    &lt;/blockquote&gt; 
    &lt;p&gt;
When the action created by the preceding code is attached to a
button and a menu item, the button and menu item display the 
text and icon associated with the action.  The &lt;code&gt;L&lt;/code&gt;
character is used for mnemonics on the button and menu item, and
their tool-tip text is set to the &lt;code&gt;SHORT_DESCRIPTION&lt;/code&gt;
string followed by a representation of the mnemonic key.
&lt;/p&gt; 
    &lt;p&gt;
For example, we have provided a simple example,
&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/examples/misc/ActionDemoProject/src/misc/ActionDemo.java" target="_blank" class="SourceLink"&gt;&lt;code&gt;ActionDemo.java&lt;/code&gt;&lt;/a&gt;, which defines three actions. Each action is attached to a button
and a menu item.
Thanks to the mnemonic values set for each button's action, the key
sequence &lt;code&gt;Alt-L&lt;/code&gt; activates the left button, &lt;code&gt;Alt-M&lt;/code&gt;
the middle button, and &lt;code&gt;Alt-R&lt;/code&gt; the right button.  The tool tip
for the left button displays &lt;i&gt;This is the left button. Alt-L.&lt;/i&gt;
All of this configuration occurs automatically, without the program making
explicit calls to set the mnemonic or tool-tip text.  As we'll show
later, the program &lt;i&gt;does&lt;/i&gt; make calls to set the button text, 
but only to avoid using the values already set by the actions.

&lt;/p&gt; 
    &lt;p&gt; &lt;/p&gt;&lt;center&gt;&lt;img height="207" align="bottom" width="458" alt="A snapshot of ActionDemo, which uses actions to coordinate menus and buttons." src="http://java.sun.com/docs/books/tutorial/figures/uiswing/misc/ActionDemo.png" /&gt;&lt;/center&gt; 
    &lt;blockquote&gt;&lt;hr /&gt;&lt;b&gt;Try this:&lt;/b&gt; 
      &lt;ol&gt; 
        &lt;li&gt; 
          &lt;p&gt;Click the Launch button to run ActionDemo using

&lt;a href="http://java.sun.com/products/javawebstart/index.jsp" target="_top" class="TutorialLink"&gt;Java™ Web Start&lt;/a&gt;
(&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;download 
JDK 6&lt;/a&gt;). Or, to compile and run the example yourself, consult 
the &lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/examples/misc/index.html#ActionDemo"&gt;example 
index&lt;/a&gt;. &lt;/p&gt; &lt;center&gt; &lt;a href="http://java.sun.com/docs/books/tutorialJWS/uiswing/misc/ex6/ActionDemo.jnlp"&gt;&lt;img height="23" align="bottom" width="88" alt="Launches the ActionDemo example" src="http://java.sun.com/docs/books/tutorial/images/jws-launch-button.png" /&gt;&lt;/a&gt; &lt;/center&gt; 
        &lt;/li&gt; 
        &lt;li&gt; 
          &lt;p&gt;Choose the top item from the left menu (&lt;b&gt;Menu &amp;gt; Go left&lt;/b&gt;).
&lt;br /&gt;
The text area displays some text identifying both the event source and 
the action listener that received the event. &lt;/p&gt; 
        &lt;/li&gt; 
        &lt;li&gt; 
          &lt;p&gt;Click the leftmost button in the tool bar.
&lt;br /&gt;
The text area again displays information about the event. Note that although 
the source of the events is different, both events were detected by the same 
action listener: the &lt;code&gt;Action&lt;/code&gt; object attached to the 
components. &lt;/p&gt; 
        &lt;/li&gt; 
        &lt;li&gt; 
          &lt;p&gt;Choose the top item from the &lt;b&gt;Action State&lt;/b&gt; menu.
&lt;br /&gt;
This disables the &amp;quot;Go left&amp;quot; &lt;code&gt;Action&lt;/code&gt; object, which in turn 
disables its associated menu item and button. &lt;/p&gt; 
        &lt;/li&gt; 
      &lt;/ol&gt; &lt;hr /&gt; 
    &lt;/blockquote&gt;

Here is what the user sees
when the &amp;quot;Go left&amp;quot; action is disabled:

    
    
    &lt;table border="0"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;center&gt;&lt;img height="207" align="bottom" width="458" alt="A snapshot of ActionDemo when " src="http://java.sun.com/docs/books/tutorial/figures/uiswing/misc/ActionDemo-a.png" /&gt;&lt;/center&gt;&lt;/td&gt; 
          &lt;td&gt; &lt;center&gt;&lt;img height="207" align="bottom" width="458" alt="A snapshot of ActionDemo when " src="http://java.sun.com/docs/books/tutorial/figures/uiswing/misc/ActionDemo-b.png" /&gt;&lt;/center&gt;&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
    &lt;p&gt;

Here's the code that disables the &amp;quot;Go left&amp;quot; action:
&lt;/p&gt; 
    &lt;blockquote&gt; 
      &lt;pre&gt;boolean selected = ...//&lt;i&gt;true if the action should be enabled;&lt;/i&gt;
                      //&lt;i&gt;false, otherwise&lt;/i&gt;
leftAction.setEnabled(selected);
&lt;/pre&gt; 
    &lt;/blockquote&gt;

After you create components using an &lt;code&gt;Action&lt;/code&gt;,
you might well need to customize them.
For example, you might want to customize the
appearance of one of the components
by adding or deleting the icon or text.
For example, 

&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/examples/misc/ActionDemoProject/src/misc/ActionDemo.java" target="_blank" class="SourceLink"&gt;&lt;code&gt;ActionDemo.java&lt;/code&gt;&lt;/a&gt;
has no icons in its menus, and no text in its buttons.
Here's the code that accomplishes this:


    
    
    &lt;blockquote&gt; 
      &lt;pre&gt;menuItem = new JMenuItem();
menuItem.setAction(leftAction);
menuItem.setIcon(null); //arbitrarily chose not to use icon in menu
...
button = new JButton();
button.setAction(leftAction);
button.setText(""); //an icon-only button
&lt;/pre&gt; 
    &lt;/blockquote&gt; 
    &lt;p&gt;We chose to create an icon-only button and
a text-only menu item from the same action by setting
the icon property to &lt;code&gt;null&lt;/code&gt; and the text
to an empty string.
However, if a property of the &lt;code&gt;Action&lt;/code&gt; changes, the
widget may try to reset the icon and text from the
&lt;code&gt;Action&lt;/code&gt; again.

&lt;/p&gt; 
  &lt;/blockquote&gt; 
  &lt;h3&gt; &lt;a name="api"&gt;The Action API&lt;/a&gt; &lt;/h3&gt; 
  &lt;blockquote&gt;
The following tables list the commonly used
&lt;code&gt;Action&lt;/code&gt; constructors and methods.
The API for using &lt;code&gt;Action&lt;/code&gt; objects
falls into three categories:


    
    
    &lt;ul&gt; 
      &lt;li&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/action.html#actioncomponents"&gt;Components that Support set/getAction&lt;/a&gt; &lt;/li&gt; 
      &lt;li&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/action.html#actionapi"&gt;Creating and Using an AbstractAction&lt;/a&gt; &lt;/li&gt; 
      &lt;li&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/action.html#properties"&gt;Action Properties&lt;/a&gt; &lt;/li&gt; 
    &lt;/ul&gt; 
    &lt;p&gt; &lt;/p&gt; 
    &lt;table border="1"&gt; &lt;caption&gt;&lt;a name="actioncomponents"&gt;Components that Support set/getAction&lt;/a&gt;&lt;/caption&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;th align="left"&gt;Class&lt;/th&gt; 
          &lt;th align="left"&gt;Purpose&lt;/th&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractButton.html#setAction%28javax.swing.Action%29" target="_blank" class="APILink"&gt;AbstractButton&lt;/a&gt;&lt;br /&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/JComboBox.html#setAction%28javax.swing.Action%29" target="_blank" class="APILink"&gt;JComboBox&lt;/a&gt;&lt;br /&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/JTextField.html#setAction%28javax.swing.Action%29" target="_blank" class="APILink"&gt;JTextField&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;
These components and their subclasses may have an action directly assigned
to them via &lt;code&gt;setAction&lt;/code&gt;.
For further information about components that are often
associated with actions, see the sections on
&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/toolbar.html" target="_top" class="TutorialLink"&gt;tool bar buttons&lt;/a&gt;,
&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html" target="_top" class="TutorialLink"&gt;menu items&lt;/a&gt;,     
&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/button.html" target="_top" class="TutorialLink"&gt;common buttons&lt;/a&gt;,    and
&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html" target="_top" class="TutorialLink"&gt;text fields&lt;/a&gt;.
For details on which properties
each component takes from the &lt;code&gt;Action&lt;/code&gt;,
see the API documentation for the relevant class's

&lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/JMenuItem.html#configurePropertiesFromAction%28javax.swing.Action%29" target="_blank" class="APILink"&gt;&lt;code&gt;configurePropertiesFromAction&lt;/code&gt;&lt;/a&gt;
method. Also refer to the 

&lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/Action.html#buttonActions" target="_blank" class="APILink"&gt;&lt;code&gt;buttonActions&lt;/code&gt;&lt;/a&gt;
table.
&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
    &lt;p&gt; &lt;/p&gt; 
    &lt;table border="1"&gt; &lt;caption&gt;&lt;a name="actionapi"&gt;Creating and Using an AbstractAction&lt;/a&gt;&lt;/caption&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;th align="left"&gt;Constructor or Method&lt;/th&gt; 
          &lt;th align="left"&gt;Purpose&lt;/th&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractAction.html#AbstractAction%28%29" target="_blank" class="APILink"&gt;AbstractAction()&lt;/a&gt; &lt;br /&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractAction.html#AbstractAction%28java.lang.String%29" target="_blank" class="APILink"&gt;AbstractAction(String)&lt;/a&gt; &lt;br /&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractAction.html#AbstractAction%28java.lang.String,%20javax.swing.Icon%29" target="_blank" class="APILink"&gt;AbstractAction(String, Icon)&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;Create an &lt;code&gt;Action&lt;/code&gt; object.
    Through arguments,
    you can specify the text and icon
    to be used in the components that the action is attached to.&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractAction.html#setEnabled%28boolean%29" target="_blank" class="APILink"&gt;void setEnabled(boolean)&lt;/a&gt; &lt;br /&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractAction.html#isEnabled%28%29" target="_blank" class="APILink"&gt;boolean isEnabled()&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;Set or get whether the components the action controls are enabled.
    Invoking &lt;code&gt;setEnabled(false)&lt;/code&gt;
    disables all the components that the action controls.
    Similarly, invoking &lt;code&gt;setEnabled(true)&lt;/code&gt;
    enables the action's components.&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractAction.html#putValue%28java.lang.String,%20java.lang.Object%29" target="_blank" class="APILink"&gt;void putValue(String, Object)&lt;/a&gt;&lt;br /&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractAction.html#getValue%28java.lang.String%29" target="_blank" class="APILink"&gt;Object getValue(String)&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;Set or get an object associated with a specified key.
    Used for setting and getting properties associated
    with an action.
&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
    &lt;p&gt; &lt;/p&gt; 
    &lt;p align="center"&gt;&lt;a name="properties"&gt;Action Properties&lt;/a&gt; &lt;/p&gt; 
    &lt;p&gt;This table defines the properties that can be set on an
action.  The second column lists which components automatically
use the properties (and what method is specifically called).
For example,
setting the &lt;code&gt;ACCELERATOR_KEY&lt;/code&gt; on an action that
is then attached to a menu item, means that
&lt;code&gt;JMenuItem.setAccelerator(KeyStroke)&lt;/code&gt;
is called automatically.
&lt;/p&gt; 
    &lt;p&gt; &lt;/p&gt; 
    &lt;table border="1"&gt; 
      &lt;tbody&gt; 
        &lt;tr&gt; 
          &lt;th align="left"&gt;Property&lt;/th&gt; 
          &lt;th align="left"&gt;Auto-Applied to: &lt;br /&gt;Class &lt;br /&gt;&lt;i&gt;(Method Called)&lt;/i&gt;&lt;/th&gt; 
          &lt;th align="left"&gt;Purpose&lt;/th&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/Action.html#ACCELERATOR_KEY" target="_blank" class="APILink"&gt;ACCELERATOR_KEY&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;&lt;code&gt;JMenuItem&lt;/code&gt; &lt;br /&gt;(&lt;i&gt;setAccelerator&lt;/i&gt;)
&lt;/td&gt; 
          &lt;td&gt;The &lt;code&gt;KeyStroke&lt;/code&gt; to be used as the accelerator for
    the action.
    For a discussion of accelerators versus mnemonics, see
&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html#mnemonic" target="_top" class="TutorialLink"&gt;Enabling Keyboard Operation.&lt;/a&gt;    Introduced in 1.3.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/Action.html#ACTION_COMMAND_KEY" target="_blank" class="APILink"&gt;ACTION_COMMAND_KEY&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;&lt;code&gt;AbstractButton&lt;/code&gt;, &lt;code&gt;JCheckBox&lt;/code&gt;,
    &lt;code&gt;JRadioButton&lt;/code&gt; &lt;br /&gt;(&lt;i&gt;setActionCommand&lt;/i&gt;)
&lt;/td&gt; 
          &lt;td&gt;The command string associated with the
    &lt;code&gt;ActionEvent&lt;/code&gt;.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/Action.html#LONG_DESCRIPTION" target="_blank" class="APILink"&gt;LONG_DESCRIPTION&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;None
&lt;/td&gt; 
          &lt;td&gt;The longer description for the action.
    Can be used for context-sensitive help.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/Action.html#MNEMONIC_KEY" target="_blank" class="APILink"&gt;MNEMONIC_KEY&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;&lt;code&gt;AbstractButton&lt;/code&gt;, &lt;code&gt;JMenuItem&lt;/code&gt;,
    &lt;code&gt;JCheckBox&lt;/code&gt;, &lt;code&gt;JRadioButton&lt;/code&gt; &lt;br /&gt;(&lt;i&gt;setMnemonic&lt;/i&gt;)
&lt;/td&gt; 
          &lt;td&gt;The mnemonic for the action.
    For a discussion of accelerators versus mnemonics, see
&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html#mnemonic" target="_top" class="TutorialLink"&gt;Enabling Keyboard Operation.&lt;/a&gt;    Introduced in 1.3. 
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/Action.html#NAME" target="_blank" class="APILink"&gt;NAME&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;&lt;code&gt;AbstractButton&lt;/code&gt;, &lt;code&gt;JMenuItem&lt;/code&gt;,
    &lt;code&gt;JCheckBox&lt;/code&gt;, &lt;code&gt;JRadioButton&lt;/code&gt; &lt;br /&gt;(&lt;i&gt;setText&lt;/i&gt;)
&lt;/td&gt; 
          &lt;td&gt;The name of the action.
    You can set this property when creating the action using
    the &lt;code&gt;AbstractAction(String)&lt;/code&gt; or 
    &lt;code&gt;AbstractAction(String, Icon)&lt;/code&gt; constructors.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/Action.html#SHORT_DESCRIPTION" target="_blank" class="APILink"&gt;SHORT_DESCRIPTION&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;&lt;code&gt;AbstractButton&lt;/code&gt;,
    &lt;code&gt;JCheckBox&lt;/code&gt;, &lt;code&gt;JRadioButton&lt;/code&gt; &lt;br /&gt;(&lt;i&gt;setToolTipText&lt;/i&gt;)
&lt;/td&gt; 
          &lt;td&gt;The short description of the action.
&lt;/td&gt; 
        &lt;/tr&gt; 
        &lt;tr&gt; 
          &lt;td&gt; &lt;a href="http://java.sun.com/javase/6/docs/api/javax/swing/Action.html#SMALL_ICON" target="_blank" class="APILink"&gt;SMALL_ICON&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;&lt;code&gt;AbstractButton&lt;/code&gt;, &lt;code&gt;JMenuItem&lt;/code&gt; &lt;br /&gt;(&lt;i&gt;setIcon&lt;/i&gt;)
&lt;/td&gt; 
          &lt;td&gt;The icon for the action used in the tool bar or on
    a button.
    You can set this property when creating the action using
    the &lt;code&gt;AbstractAction(name, icon)&lt;/code&gt; constructor.
&lt;/td&gt; 
        &lt;/tr&gt; 
      &lt;/tbody&gt; 
    &lt;/table&gt; 
  &lt;/blockquote&gt; 
  &lt;h3&gt; &lt;a name="eg"&gt;Examples that Use Actions&lt;/a&gt; &lt;/h3&gt; 
The following examples
use &lt;code&gt;Action&lt;/code&gt; objects.
  
  
  &lt;table&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;th align="left"&gt; Example&lt;/th&gt; 
        &lt;th align="left"&gt; Where Described&lt;/th&gt; 
        &lt;th align="left"&gt; Notes&lt;/th&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/examples/misc/index.html#ActionDemo"&gt;&lt;code&gt;ActionDemo&lt;/code&gt;&lt;/a&gt;&lt;/td&gt; 
        &lt;td&gt; This section&lt;/td&gt; 
        &lt;td&gt; Uses actions to bind buttons and menu items to the same function.&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html#TextComponentDemo"&gt; &lt;code&gt;TextComponentDemo&lt;/code&gt;&lt;/a&gt;&lt;/td&gt; 
        &lt;td&gt; &lt;a class="TutorialLink" target="_top" href="http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html"&gt;Text Component Features&lt;/a&gt;&lt;/td&gt; 
        &lt;td&gt; Uses text actions to create menu items
     for text editing commands, such as cut, copy, and paste,
     and to bind key strokes to caret movement.
     Also implements custom &lt;code&gt;AbstractAction&lt;/code&gt; subclasses
     to implement undo and redo.
     The text action discussion begins in
     &lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#editorkits"&gt;Concepts:
     About Editor Kits&lt;/a&gt;.&lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt; 
  &lt;table&gt; 
    &lt;tbody&gt; 
      &lt;tr&gt; 
        &lt;th align="left"&gt;&lt;br /&gt;&lt;/th&gt; 
        &lt;th align="left"&gt;&lt;br /&gt;&lt;/th&gt; 
        &lt;th align="left"&gt;&lt;br /&gt;&lt;/th&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;br /&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;br /&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;br /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;br /&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;br /&gt;&lt;/td&gt; 
        &lt;td&gt; 
          &lt;p&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/action.html" title="Java Tutorial"&gt;From the Java Tutorial &lt;/a&gt;&lt;/p&gt; 
        &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/tbody&gt; 
  &lt;/table&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/owx2ej-axjc" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/how_to_use_actions</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/java_univserity_and_sun_training</id>
        <title type="html">Java University and Sun Training Library</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/DjfgDBg7mv0/java_univserity_and_sun_training" />
        <published>2008-07-01T13:10:40-07:00</published>
        <updated>2008-07-02T09:28:08-07:00</updated> 
        <category term="/Community" label="Community" />
        <category term="courses" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="training" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">These convenient online sessions provide you training on the latest
advancements in Sun and related technologies to help you advance your
business.</summary>
        <content type="html">&lt;p&gt;&lt;a href="http://www.sun.com/training/catalog/java/javau_javaone.html?cid=925084"&gt;Java University Online &lt;/a&gt;&lt;br /&gt;&lt;/p&gt; 
  &lt;p&gt;We understand you're busy and may not have been able to attend Java
University at JavaOne. So, Sun is bringing the same Java University
technical sessions led by the same Leading Sun Technical Experts
directly to you.
These convenient online sessions provide you training on the latest
advancements in Sun and related technologies to help you advance your
business.&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://www.sun.com/training/catalog/java/javau_javaone.html?cid=925084"&gt;Sign up today! &lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://www.sun.com/training/savings/cd_java_ipod.html"&gt;Get your Free iPod Touch&lt;/a&gt;&lt;/p&gt; 
  &lt;h5&gt;Java Technology CD-ROM Training&lt;/h5&gt; 
  &lt;ul&gt; 
    &lt;li&gt;Learning the Java Programming Language CD Library (CDLJ-100)&lt;/li&gt; 
    &lt;li&gt;Enterprise Java Application Developer CD Library (CDLJ-200)&lt;/li&gt; 
    &lt;li&gt;Java Complete Learning CD Library (CDLJ-300)&lt;/li&gt; 
  &lt;/ul&gt;

» &lt;a href="http://www.sun.com/training/savings/cd_java_ipod.html"&gt; Purchase Now&lt;/a&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/DjfgDBg7mv0" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/java_univserity_and_sun_training</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/using_beans_binding_to_search</id>
        <title type="html">Using Beans Binding to Search in a Table</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/R46egCrGFpk/using_beans_binding_to_search" />
        <published>2008-06-25T10:36:53-07:00</published>
        <updated>2008-06-25T10:36:53-07:00</updated> 
        <category term="/NetBeans IDE" label="NetBeans IDE" />
        <category term="beans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="binding" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="database" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn how to search records in a desktop database application in this tutorial.</summary>
        <content type="html">&lt;p&gt;by Patrick Keegan&lt;/p&gt; 
  &lt;p&gt;Now and again someone will ask me how you can search records in a
desktop database app. Here's a reasonably simple way to do so, using
mechanisms that exist in Swing and the Beans Binding library. We will
create a binding between the rowSorter property of the master table in
the example in my previous entries and a text field that I've just
added for the search string. For this binding we will need a binding
converter so that the table knows how to respond to the search string.&lt;/p&gt; 
  &lt;p&gt;To follow along, you can either continue with the project created in
previous entries or begin with a new NetBeans project (Java Desktop
Application project template) that connects to a database.
&lt;/p&gt; 
  &lt;p&gt;Let's get started. First of all, we'll add a label and a text field for the search field as shown below.&lt;/p&gt; &lt;img height="236" width="367" alt="masterdetail5-searchfield.png" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail5-searchfield.png" /&gt; 
  &lt;p&gt;Now we will add a converter class to the project.&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Create a new Java class in your project. Call it &lt;code&gt;RowSorterToStringConverter&lt;/code&gt;.&lt;/li&gt; 
    &lt;li&gt;Replace the generated code in the new class with the following code:

      
      &lt;pre&gt;package clientpurchaseapp;

import javax.swing.JTable;
import javax.swing.RowFilter;
import javax.swing.table.TableRowSorter;
import org.jdesktop.beansbinding.Converter;

/**
 * Binding converter between String and regex RowFilter (encapsulated by RowSorterToStringConverter).
 *  */
public class RowSorterToStringConverter extends Converter {

    private JTable table;

    public JTable getTable() {
        return table;
    }

    public void setTable(JTable table) {
        this.table = table;
    }

    @Override
    public Object convertForward(Object value) {
        return value.toString();
    }

    @Override
    public Object convertReverse(Object mask) {
        TableRowSorter sorter = new TableRowSorter(table.getModel());

        // The following statement makes the filter case-sensitive. If you want 
        //filter to work in a case-insensitive way, uncomment the line below, comment 
        //the 7 code lines below
        //sorter.setRowFilter(RowFilter.regexFilter(".*" + mask + ".*"));

        //The following 7 lines create a case-insensitive filter. If you want 
        //the filter to be case-sensitive, comment them out and uncomment the 
        //line above
        String m = mask.toString();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i &amp;lt; m.length(); i++) {
            char c = m.charAt(i);
            sb.append('[').append(Character.toLowerCase(c)).append(Character.toUpperCase(c)).append(']');
        }
        sorter.setRowFilter(RowFilter.regexFilter(".*" + sb + ".*"));
        return sorter;
    }
}
&lt;/pre&gt; 
    &lt;/li&gt; 
    &lt;li&gt;Adjust the package statement, if necessary.&lt;/li&gt; 
    &lt;li&gt;Save the file and compile it. Compiling the file enables you to
treat it as a bean that you can add to the form by dragging and
dropping from within the IDE's GUI builder.&lt;/li&gt; 
    &lt;li&gt;Drag the class from the Projects window and drop it in white area surrounding the form, as shown in the screenshot below.
&lt;img height="121" width="245" alt="masterdetail5-dragconverter.png" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail5-dragconverter.png" /&gt; 
      &lt;p&gt;A node called &lt;code&gt;rowSorterToStringConverter1&lt;/code&gt; should appear in the Inspector window.&lt;/p&gt; &lt;img height="178" width="286" alt="masterdetail5-inspector.png" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail5-inspector.png" /&gt; 
    &lt;/li&gt; 
    &lt;li&gt;Select the &lt;code&gt;rowSorterToStringConverter1&lt;/code&gt; node and set its &lt;code&gt;table&lt;/code&gt; property to &lt;code&gt;masterTable&lt;/code&gt;.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;We'll use this converter when we create the binding.&lt;/p&gt; 
  &lt;p&gt;To create the binding:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;In the main form, right-click the text field and choose Bind | text.&lt;/li&gt; 
    &lt;li&gt;In the Bind dialog, select &lt;code&gt;masterTable&lt;/code&gt; as the binding source and &lt;code&gt;rowSorter&lt;/code&gt; as the expression.
&lt;img height="534" width="493" alt="masterdetail5-binding-basic.png" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail5-binding-basic.png" /&gt;&lt;/li&gt; 
    &lt;li&gt;Click the Advanced tab of the dialog box.&lt;/li&gt; 
    &lt;li&gt;From the Converter combo box, select &lt;code&gt;rowSorterToStringConverter1&lt;/code&gt;.
&lt;img height="534" width="493" alt="masterdetail5-binding-advanced.png" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail5-binding-advanced.png" /&gt;&lt;/li&gt; 
    &lt;li&gt;Click OK to close the dialog and generate the binding code.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;Now when you run the application, you should be able to type in the
Search Filter field and see that the list of rows is reduced to only
rows that contain text matching what you have typed.&lt;/p&gt; &lt;img height="420" width="578" alt="masterdetail5-filter-working.png" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail5-filter-working.png" /&gt; 
  &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; If you have been following this whole series of posts,
you will need to make a few changes to get the New Record and Edit
Record buttons to work correctly. The Edit Record button doesn't work
correctly because the number of the record to display is determined
according to the records displayed but applied to the whole list of
records in the database. In other words, if you select the first record
in a filtered list, the first record of the whole database appears for
editing in the dialog.&lt;/p&gt; &lt;img height="442" width="510" alt="masterdetail5-synchproblem.png" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail5-synchproblem.png" /&gt; 
  &lt;p&gt;The New Record button fails with an exception because the code to
select the new row is determined according to number of records in the
database table, not according to the number of records currently
displayed in the table.&lt;/p&gt; 
  &lt;p&gt;To fix the first problem, replace the line:&lt;/p&gt; 
  &lt;pre&gt;ec.setCurrentRecord(list.get(masterTable.getSelectedRow()));
&lt;/pre&gt; 
  &lt;p&gt;with:&lt;/p&gt; 
  &lt;pre&gt;ec.setCurrentRecord(list.get(masterTable.convertRowIndexToModel(masterTable.getSelectedRow())));&lt;/pre&gt; 
  &lt;p&gt;To fix the second problem, replace the line:&lt;/p&gt; 
  &lt;pre&gt;int row = list.size() - 1;&lt;/pre&gt; 
  &lt;p&gt;with:&lt;/p&gt; 
  &lt;pre&gt;int row = masterTable.getRowCount() - 1;&lt;/pre&gt; 
  &lt;p&gt;&lt;a href="http://weblogs.java.net/blog/pkeegan/"&gt;Read the other blogs in this series&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/R46egCrGFpk" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/using_beans_binding_to_search</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/passing_dialog_input_to_the</id>
        <title type="html">Passing Dialog Input to the Main View and Database</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/1wYOBd6Cjoo/passing_dialog_input_to_the" />
        <published>2008-06-17T09:57:13-07:00</published>
        <updated>2008-06-17T09:57:13-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="database" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="databases" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="desktop" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn to code the connection
between a dialog and a main form in addition to adding an Edit Client
button and its corresponding Action code to the main form.</summary>
        <content type="html">&lt;p&gt;&amp;nbsp;by Patrick Keegan&lt;br /&gt;&lt;/p&gt; 
  &lt;p&gt;&amp;nbsp;This is the fourth in a series of posts on creating a Java database
application. In my last few posts, I started with skeleton code
generated by the IDE and provided my own customizations, including
adding a dialog to use for data entry and binding those fields with a
table on the main form. In this post, I finish coding the connection
between the dialog and the main form. I'll also add an Edit Client
button and its corresponding Action code to the main form.&lt;/p&gt; 
  &lt;p&gt;First let's hook up the buttons in the EditClient dialog with
appropriate event-handling code. We already have save() and refresh()
actions that are provided with the skeleton application. We will code
the dialog so that the buttons reuse these actions. We can accomplish
this by setting up a boolean property in the dialog that returns true
when the Save Record button is pushed and returns false when Cancel is
selected. Based on the value that is returned when the dialog is
closed, the the &lt;code&gt;save()&lt;/code&gt; or the &lt;code&gt;refresh()&lt;/code&gt; action will be run from the main view class.&lt;/p&gt; 
  &lt;p&gt;To set up the property, do the following:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Open up the EditClient file and select the Source view.&lt;/li&gt; 
    &lt;li&gt;Place the cursor somewhere below the block of generated code that contains the &lt;code&gt;initComponents()&lt;/code&gt; method.&lt;/li&gt; 
    &lt;li&gt;Press Alt-Insert and choose Add Property.&lt;/li&gt; 
    &lt;li&gt;In the Add Property dialog, type &lt;code&gt;clientConfirmed&lt;/code&gt; as the property name.&lt;/li&gt; 
    &lt;li&gt;Set the type to boolean.&lt;/li&gt; 
    &lt;li&gt;Make sure the Generate Getters and Setters checkbox is selected.&lt;/li&gt; 
    &lt;li&gt;Click OK to close the dialog box and generate the code.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;We'll set this property's value in event handling code for the buttons. Let's create the event listeners and handlers now:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Switch to the Design view for the EditClient class.&lt;/li&gt; 
    &lt;li&gt;Select the Save button in the EditClient form.&lt;/li&gt; 
    &lt;li&gt;In the Properties window, click the Events button.&lt;/li&gt; 
    &lt;li&gt;Click the ellipsis (...) button next to the actionPerformed property.&lt;/li&gt; 
    &lt;li&gt;In the Handlers for actionPerformed dialog box, add a handler called &lt;code&gt;saveNewClient&lt;/code&gt;.&lt;/li&gt; 
    &lt;li&gt;Within the &lt;code&gt;saveNewClient&lt;/code&gt; method in the Source Editor (where the cursor jumps after you create the new handler), type the following code:

      
      
      &lt;pre&gt;setClientConfirmed(true);
setVisible(false);
&lt;/pre&gt; 
    &lt;/li&gt; 
    &lt;li&gt;Repeat steps 2-5 for the Cancel button and call its handler &lt;code&gt;cancelNewClient&lt;/code&gt;.&lt;/li&gt; 
    &lt;li&gt;In the &lt;code&gt;cancelNewRecord&lt;/code&gt; method, type the following:

      
      
      &lt;pre&gt;setClientConfirmed(false);
setVisible(false);
&lt;/pre&gt; 
    &lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;Navigate to the &lt;code&gt;newRecord()&lt;/code&gt; method and add the following code to the bottom of the method:&lt;/p&gt; 
  &lt;pre&gt;        if (ec.isClientConfirmed()) {
            save().run();
        } else {
            refresh().run();
        }
&lt;/pre&gt; 
  &lt;p&gt;In the RefreshTask inner class, &lt;code&gt;Thread.sleep&lt;/code&gt; is called
four times to slow down the rollback code to better demonstrate how
Swing Application Framework tasks work. We don't need this code for
this application, so delete those four statements. Similarly, we don't
need a try/catch block here, so delete the &lt;code&gt;try&lt;/code&gt; and &lt;code&gt;catch&lt;/code&gt; statements as well (but leave the rest of the body of the &lt;code&gt;try&lt;/code&gt; block).&lt;/p&gt; 
  &lt;p&gt;Since the &lt;code&gt;save()&lt;/code&gt; and &lt;code&gt;refresh()&lt;/code&gt; actions act
on any changes made during the application's session, we will want to
make the dialog modal and make the tables in the main form uneditable.
We also need to make the dialog modal so that when the user presses
either the Save or Cancel button, the &lt;code&gt;setVisible()&lt;/code&gt; method doesn't return until the event handler (which includes the &lt;code&gt;setClientConfirmed&lt;/code&gt; method) has run.&lt;/p&gt; 
  &lt;p&gt;To make the dialog modal:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Open the Design view of the EditClient class.&lt;/li&gt; 
    &lt;li&gt;Select the dialog.&lt;/li&gt; 
    &lt;li&gt;In the Properties window, click Properties and select the checkbox for the &lt;b&gt;modal&lt;/b&gt; property.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;To make the main form's Clients table uneditable:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Open the main view class in the Source Editor and select the Design view.&lt;/li&gt; 
    &lt;li&gt;Right-click the top table and choose Table Contents.&lt;/li&gt; 
    &lt;li&gt;In the Customizer dialog, select the Columns tab.&lt;/li&gt; 
    &lt;li&gt;For each column, clear the Editable checkbox.&lt;/li&gt; 
    &lt;li&gt;Click Close.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;You can now run the application and click New Client to add a new
record. When you press Save in the New Client dialog, the record is
saved. When you press Cancel, the new record you have changed is rolled
back.&lt;/p&gt; 
  &lt;p&gt;This is all well and good, but by disabling the editability of the
table on the main form, we can no longer edit existing records. To
solve this, we'll add an Edit button to the main client form so that we
can edit existing records. For event-handling, we'll take advantage of
the Swing Application Framework's Action facility.&lt;/p&gt; 
  &lt;p&gt;To add the button and its corresponding event-handling code, do the following:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Drag the New Client Button a bit to the left.&lt;/li&gt; 
    &lt;li&gt;Drag a button from the palette into the opening just created.&lt;/li&gt; 
    &lt;li&gt;Right-click the button and choose Set Action.&lt;/li&gt; 
    &lt;li&gt;In the Action field, select Create New Action.&lt;/li&gt; 
    &lt;li&gt;For Action Method, type &lt;code&gt;editClient&lt;/code&gt;.&lt;/li&gt; 
    &lt;li&gt;For Text, type &lt;code&gt;Edit Client&lt;/code&gt;. &lt;/li&gt; 
    &lt;li&gt;Click the Advanced Tab and select &lt;code&gt;recordSelected&lt;/code&gt; for the Enabled Property. 

      
      
      &lt;p&gt;This generates an annotation attribute to ensure that the button and
any other trigger for the action (e.g. a menu item) are only enabled
when a record is selected.&lt;/p&gt; 
    &lt;/li&gt; 
    &lt;li&gt;Click OK to close the dialog box.

      
      
      &lt;p&gt;The Source view of the file should appear with the cursor in the following new method:&lt;/p&gt; 
      &lt;pre&gt;    @Action(enabledProperty = "recordSelected")
    public void editClient() {
    }
&lt;/pre&gt; 
    &lt;/li&gt; 
    &lt;li&gt;Within the method, paste the following code:

      
      
      &lt;pre&gt;        setSaveNeeded(true);
        JFrame mainFrame = ClientAndPurchaseApp.getApplication().getMainFrame();
        EditClient ec = new EditClient(mainFrame, false);
        ec.setCurrentRecord(list.get(masterTable.getSelectedRow()));
        ec.setVisible(true);
        if (ec.isClientConfirmed()) {
            save().run();
        } else {
            refresh().run();
        }
&lt;/pre&gt; 
    &lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;Most of that code is copied straight from the newRecord action. The key difference is the line
&lt;code&gt;ec.setCurrentRecord(list.get(masterTable.getSelectedRow()));&lt;/code&gt;, which populates 
the current record in the dialog with the currently selected record.&lt;/p&gt; 
  &lt;p&gt;The Client part of the application is almost completely set. You
should be able to freely add, edit, and delete records from your
CLIENTS table using the specialized GUI we have created.&lt;/p&gt; 
  &lt;p&gt;One last detail: the main form still has the title of Database
Application Example, and it's not obvious where to change. Hint: it's
not within the GUI Builder.&lt;/p&gt; 
  &lt;p&gt;To change the title of the main frame of the application:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;In the Projects window, select the project's node and choose Properties.&lt;/li&gt; 
    &lt;li&gt;In the Project Properties dialog box, select the Application node.&lt;/li&gt; 
    &lt;li&gt;Edit the Title property and any other properties that are important to you.&lt;/li&gt; 
  &lt;/ol&gt; &lt;img height="420" width="637" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail4-projpropertiesapp.png" alt="masterdetail4-projpropertiesapp.png" /&gt; 
  &lt;p&gt;Now when you run the application, most of the key elements are in
place. In the screenshot below, you can see the Edit Client dialog as
it appears after having selected a record and pressed the Edit button.&lt;/p&gt; &lt;img height="373" width="692" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail4-nearfinishedapp.png" alt="masterdetail4-nearfinishedapp.png" /&gt; 
  &lt;p&gt;I could continue with customization of the bottom part of the main
form and other fine tuning of the application, but I'll save most of
those details for the tutorial and individual blog posts with more
atomic examples. As always, keep your questions coming and I'll try to
deal with as many of them as I can.&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://weblogs.java.net/blog/pkeegan/"&gt;Read more of Patrick's articles&lt;/a&gt;. &lt;br /&gt;&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/1wYOBd6Cjoo" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/passing_dialog_input_to_the</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/binding_jcombobox_s_elements_and</id>
        <title type="html">Binding JComboBox's Elements and Selected Item</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/tBCt_I7b8LM/binding_jcombobox_s_elements_and" />
        <published>2008-06-09T11:07:19-07:00</published>
        <updated>2008-06-09T11:07:19-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="beans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="binding" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="jcombobox" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">In this installment, I concentrate on combo boxes, namely
how to populate combo boxes from a table and then how to bind the user
selection to a record.</summary>
        <content type="html">&lt;p&gt;by Patrick Keegan&lt;/p&gt; 
  &lt;p&gt;This is part 3 in a series of posts that I'm doing to show how to
use beans binding and JPA to create a Java desktop database
application. In this installment, I concentrate on combo boxes, namely
how to populate combo boxes from a table and then how to bind the user
selection to a record. If you want to code along with me, be sure to
read my previous two posts.&lt;/p&gt; 
  &lt;p&gt;When we created the skeleton for this application, we (or, rather,
the New Java Desktop Application wizard) did not take into account the
foreign key from the Clients table to the Countries table. The only
relationship between tables that was acknowledged was the one pertinent
to the master/detail relationship between the Clients and the Orders
tables. So now we will need to take some extra steps to establish the
Clients/Countries relationship in the entity classes:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Create an entity class for the Countries table by right-clicking
the package that contains your classes and choosing New | Entity
Classes from Database.&lt;/li&gt; 
    &lt;li&gt;In the generated Countries class add the following line below the
@ID annotation, just as we did for the Clients and Orders classes. 
      
      &lt;pre&gt;    @GeneratedValue(strategy=GenerationType.IDENTITY)
&lt;/pre&gt; 
    &lt;/li&gt; 
    &lt;li&gt;Press Ctrl-Shift-I to add the necessary import statements.&lt;/li&gt; 
    &lt;li&gt;Modify the Clients entity class so that countryId property is of
type Countries instead of Integer and that it is joined with the
Countries db table. The following changes are necessary:

      
      &lt;ul&gt; 
        &lt;li&gt;Replace this field declaration and annotations

          
          &lt;pre&gt;    @Column(name = "COUNTRY_ID")
    private Integer countryId;
&lt;/pre&gt; 
          &lt;p&gt;with this code:&lt;/p&gt; 
          &lt;pre&gt;    @JoinColumn(name = "COUNTRY_ID", referencedColumnName = "COUNTRY_ID")
    @ManyToOne
    private Countries countryId;
&lt;/pre&gt; 
        &lt;/li&gt; 
        &lt;li&gt;Change the type of the &lt;code&gt;getCountryId()&lt;/code&gt; method from Integer to Countries.  
&lt;/li&gt; 
        &lt;li&gt;In the  &lt;code&gt;getCountryId()&lt;/code&gt; method, change the types of &lt;code&gt;countryId&lt;/code&gt; and &lt;code&gt;countryId&lt;/code&gt; from Integer to Countries.
&lt;/li&gt; 
        &lt;li&gt;Press Ctrl-Shift-I to add the imports for the pasted code.&lt;/li&gt; 
      &lt;/ul&gt; 
    &lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;We also need to update the column binding for the country field so that it refers to the &lt;code&gt;country&lt;/code&gt;
property of the Countries object instead of an Integer. (Code to use a
country ID Integer was generated by the project since the skeleton was
generated without having an entity class for the COUNTRIES table. If we
don't make a change here, a ClassCastException will be thrown when you
run the application.) Here are the steps:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;In the main form, right-click the top table and choose Table of Contents and then click the Columns tab.&lt;/li&gt; 
    &lt;li&gt;In the customizer, select the Country Id row.&lt;/li&gt; 
    &lt;li&gt;Change the Expression to &lt;code&gt;${countryId.country}&lt;/code&gt;. After you do so, the type should also change to String.
&lt;img height="565" width="550" alt="masterdetail3-changeTableContents.png" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail3-changeTableContents.png" /&gt;&lt;/li&gt; 
    &lt;li&gt;Change the Title from Country Id to Country (this affects the column heading in the running application).  
&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;Now it's time to do the binding for the Country combo box in the dialog.&lt;/p&gt; 
  &lt;p&gt;&lt;a href="http://weblogs.java.net/blog/pkeegan/archive/2008/05/binding_jcombob_1.html"&gt;Read the rest of this tutorial&lt;/a&gt;. &lt;br /&gt;&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/tBCt_I7b8LM" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/binding_jcombobox_s_elements_and</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/new_and_free_courses_and</id>
        <title type="html">New and Free Courses, and Updated Tutorials Page</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/OgQMBBwyyJs/new_and_free_courses_and" />
        <published>2008-06-04T12:14:11-07:00</published>
        <updated>2008-06-04T12:14:11-07:00</updated> 
        <category term="/Announcement" label="Announcement" />
        <category term="courses" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="learning" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="online" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="students" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="training" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="tutorials" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Check out the free courses Sun offers to students, the new fee based courses, and the updated and reorganized Online Tutorials page.</summary>
        <content type="html">&lt;p&gt; &lt;a name="tra"&gt;&lt;img hspace="8" align="left" src="http://www.sun.com/images/l2/l2_sp_training.gif" /&gt;&lt;b&gt;Sun&lt;/b&gt;&lt;/a&gt;&lt;b&gt; Offers Free Training to All Student&lt;/b&gt;s&lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;&lt;a href="http://www.sunstudentcourses.com/"&gt;Sun Student Courses&lt;/a&gt;: Get real-world training and earn a
certificate:

      
      
      
      
      
      &lt;ul&gt; 
        &lt;li&gt;NetBeans GUI Builder,
JRuby, JavaFX, and Java ME&lt;/li&gt; 
        &lt;li&gt;Introduction to
Solaris and OpenSolaris.org&lt;/li&gt; 
        &lt;li&gt;Introduction to Sun SPOTs&lt;/li&gt; 
      &lt;/ul&gt; 
    &lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://developers.sun.com/students/training.jsp#signup"&gt;Sun Academic Initiative (SAI)&lt;/a&gt;:
This tool gives students access to all types of courses, including web
scripting, open source, mobile Java development, beginner Java
training, operating systems, and much more... &lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;&lt;b&gt;New Training Courses&lt;/b&gt; (fee based)&lt;b&gt;:&lt;/b&gt;&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;ul&gt; 
    &lt;li&gt;&lt;a href="http://www.sun.com/training/catalog/courses/DTW-2100.xml"&gt;DTW-2100 - Ajax Primer: JavaScript &amp;amp; DOM the Ajax Building Blocks&lt;/a&gt; &lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.sun.com/training/catalog/courses/DTW-2126.xml"&gt;DTW-2126 - Core Ajax: Enterprise Web Development with Ajax&lt;/a&gt; &lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.sun.com/training/catalog/courses/DTW-2200.xml"&gt;DTW-2200 - GandG Primer: Rapid Web Development with Groovy and Grails&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.sun.com/training/catalog/courses/DTW-3400.xml"&gt;DTW-3400 - Core Swing: Developing Java GUIs using Swing&lt;/a&gt;&lt;/li&gt; 
  &lt;/ul&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Reference: 

  
  
  
  
  
  &lt;ul&gt; 
    &lt;li&gt;&lt;a href="http://www.sun.com/training/catalog/java/developer.xml"&gt;www.sun.com/training/catalog/java/developer.xml&lt;/a&gt; &lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.sun.com/training/catalog/java/delivery.xml"&gt;www.sun.com/training/catalog/java/delivery.xml&lt;/a&gt;&lt;/li&gt; 
    &lt;p&gt; &lt;/p&gt; 
  &lt;/ul&gt; 
  &lt;p&gt;&lt;a title="Online Tutorials" href="http://java.sun.com/developer/onlineTraining/"&gt;&lt;img hspace="8" align="left" src="http://www.sun.com/images/l2/l2_duke_learningcurve.gif" /&gt;&lt;b&gt;Updated Online 
Tutorials Page&lt;/b&gt;&lt;/a&gt; (free)&lt;br /&gt;See the updated listing of online tutorials and training to learn about 
various Java technologies and tools. &lt;a title="Online Tutorials" href="http://java.sun.com/developer/onlineTraining/"&gt;&lt;b&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;&lt;a title="Online Tutorials" href="http://java.sun.com/developer/onlineTraining/"&gt;&lt;b&gt;See Online Tutorials&lt;/b&gt;&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;&lt;a title="Online Tutorials" href="http://java.sun.com/developer/onlineTraining/"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;p&gt; &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/OgQMBBwyyJs" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/new_and_free_courses_and</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/beans_binding_between_separate_forms</id>
        <title type="html">Beans Binding Between Separate Forms</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/zqbEsEeH0aU/beans_binding_between_separate_forms" />
        <published>2008-06-02T18:06:18-07:00</published>
        <updated>2008-06-02T18:10:18-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="beans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="binding" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="desktop" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="forms" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="swing" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn to create a simple client purchase desktop application.</summary>
        <content type="html">&lt;p&gt;by Patrick Keegan&lt;/p&gt; 
  &lt;p&gt;Continuing from my &lt;a href="http://blogs.sun.com/JavaFundamentals/entry/input_on_a_new_desktop"&gt;last post&lt;/a&gt;, I'll show the next steps in the
creation of this simple (but not too simple) client purchase
application. This time, our main focus is in creating a separate dialog
which we will use for data entry. We'll need to do a few tricks so that
input from the dialog is propagated to the main form and then the
database.&lt;/p&gt; 
  &lt;p&gt;But first we'll need to clear up a few loose ends. As I alluded to
last time, I use AUTO_INCREMENT attributes for the ID columns of the
CLIENTS, COUNTRIES, and ORDERS tables. This means that whenever a new
row is added to those tables, that row's AUTO_INCREMENT field is given
a unique value (the value of the last new record + 1). For me using
AUTO_INCREMENT is a handy way to ensure having unique records.&lt;/p&gt; 
  &lt;p&gt;When you generate the skeleton of the application in the New Java
Desktop Application wizard, the IDE generates two entity classes
(Clients.java and Orders.java) that represent database tables with the
same names. However, these entity classes are missing code to deal with
the AUTO_INCREMENT fields. Without that code, you will get errors when
trying to enter new records. To fix that:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Open the Clients.java class.&lt;/li&gt; 
    &lt;li&gt;Navigate to the line after the one containing &lt;code&gt;@Id&lt;/code&gt;.&lt;/li&gt; 
    &lt;li&gt;Enter the line &lt;code&gt;@GeneratedValue(strategy=GenerationType.IDENTITY)&lt;/code&gt;.&lt;/li&gt; 
    &lt;li&gt;Press Ctrl-Shift-I to generate the necessary import statements for this annotation.&lt;/li&gt; 
    &lt;li&gt;Repeat the process for Orders.java.&lt;/li&gt; 
  &lt;/ol&gt; &lt;img height="306" width="558" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail2-identityannotation.png" alt="masterdetail2-identityannotation.png" /&gt; 
  &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; You can also use code completion here. It takes three
selections to get the entire line, but the import statements are
generated for free.&lt;/p&gt; 
  &lt;p&gt;Once you have added these annotations, you can run the application
and start adding data. Click the top New button to add a client. With a
client selected, click the bottom New button to add an order for that
client. Click Save to push your changes to the database. Click Refresh
to back out any unsaved changes.&lt;/p&gt; &lt;img height="430" width="578" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail2-skeletonapp.png" alt="masterdetail2-skeletonapp.png" /&gt; 
  &lt;p&gt;I like tables for browsing data, but I think they leave something to
be desired for data entry. So for this application, we'll add dialogs
for data entry.&lt;/p&gt; 
  &lt;p&gt;To create and populate the JDialog, follow these steps:&lt;/p&gt; 
  &lt;ol&gt; 
    &lt;li&gt;Right-click the package that contains your classes and choose New |
Other. Select Swing GUI Forms | JDialog Form template and name it &lt;code&gt;EditClient&lt;/code&gt;.&lt;/li&gt; 
    &lt;li&gt;From the Palette window drag, drop, and arrange components for the customer's personal details. 

      
      
      &lt;p&gt;You should have JLabels for each of the following fields: first
name, last name, address, city, state, zip code, country, and phone
number. You should have JTextFields for each of those fields, except
for country, for which we will use a JComboBox.&lt;/p&gt; 
    &lt;/li&gt; 
    &lt;li&gt;Edit the display text for JLabels.&lt;/li&gt; 
    &lt;li&gt;Add two buttons and name them Save and Cancel.&lt;/li&gt; 
    &lt;li&gt;(Optional) Rename all of the components you have added to more memorable names, such as &lt;code&gt;firstNameLabel&lt;/code&gt;. You can do this inline in the Inspector window.&lt;/li&gt; 
  &lt;/ol&gt; 
  &lt;p&gt;The resulting layout should look something like what you see below.&lt;/p&gt; &lt;img height="311" width="410" src="http://weblogs.java.net/blog/pkeegan/archive/masterdetail2-clientdialoglayout.png" alt="masterdetail2-clientdialoglayout.png" /&gt; 
  &lt;p&gt; &lt;/p&gt; 
  &lt;p&gt;Read the rest of this &lt;a href="http://weblogs.java.net/blog/pkeegan/archive/2008/05/beans_binding_b_1.html" title="Beans Binding Between Separate Forms"&gt;tutorial&lt;/a&gt;. &lt;br /&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/zqbEsEeH0aU" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/beans_binding_between_separate_forms</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/input_on_a_new_desktop</id>
        <title type="html">Input on a New Desktop Java Database Tutorial</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/jQJQy3rUHgk/input_on_a_new_desktop" />
        <published>2008-05-27T09:23:42-07:00</published>
        <updated>2008-05-27T09:23:42-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="database" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="databases" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn to create a Swing desktop application with database connectivity and multiple tables.</summary>
        <content type="html">&lt;p&gt;by Patrick Keegan&lt;/p&gt;&lt;p&gt;Recently I've found time again to work on actual tutorials. I don't
have anything written yet, but I have something resembling a plan,
which you can find here:
http://wiki.netbeans.org/PlanGuiBuilderDocImprovements.&lt;/p&gt;
&lt;p&gt;Over the next few weeks, I'll be blogging about creating a Swing
desktop application with database connectivity. These postings will
essentially serve as a rough sneak preview of a full-fledged tutorial
on the subject that I'll later post to netbeans.org. The tutorial will
go beyond simple database connectivity and show things such as
one-to-many and many-to-one relationships as well as how to bind
database tables to a variety of GUI components. We'll use a MySQL
database that has tables for client info, order info, and countries.
There will be a one-to-many relationship between the client and order
tables. There will be a many-to-one relationship between client and
countries tables. Along the way, I'll be looking at any feedback that
comes through and do my best to respond to it, whether in quick
responses, in separate articles, or by modifying the final tutorial.
Chances are that I'll also tweak the structure along the way as I find
better ways of doing things.&lt;/p&gt;
&lt;p&gt;To start off, I'll provide an SQL script that provides a beginning database structure:&lt;/p&gt;&lt;pre&gt;CREATE TABLE CLIENTS (&lt;br /&gt;	ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,&lt;br /&gt;	FIRST_NAME VARCHAR(20),&lt;br /&gt;	SURNAME VARCHAR(30),&lt;br /&gt;        ADDRESS VARCHAR(30),&lt;br /&gt;	CITY VARCHAR(30),&lt;br /&gt;	STATE_ VARCHAR(30),&lt;br /&gt;	ZIP INTEGER,&lt;br /&gt;	COUNTRY_ID INTEGER,&lt;br /&gt;	PHONE INTEGER&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;    CREATE TABLE EMAIL_ADDRESSES (&lt;br /&gt;    CLIENT_ID INTEGER NOT NULL,&lt;br /&gt;    ADDRESS VARCHAR(50) NOT NULL PRIMARY KEY,&lt;br /&gt;    FORMAT INTEGER,&lt;br /&gt;    FOREIGN KEY (CLIENT_ID) REFERENCES CLIENTS(ID)&lt;br /&gt;    );&lt;br /&gt;    &lt;br /&gt;CREATE TABLE ORDERS (&lt;br /&gt;    ID INTEGER NOT NULL AUTO_INCREMENT,&lt;br /&gt;    CLIENT_ID INTEGER NOT NULL,&lt;br /&gt;    PRODUCT VARCHAR(50) NOT NULL,&lt;br /&gt;    AMOUNT INTEGER NOT NULL,&lt;br /&gt;    PRIMARY KEY(ID),&lt;br /&gt;    FOREIGN KEY (CLIENT_ID) REFERENCES CLIENTS(ID)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;CREATE TABLE PRODUCTS (&lt;br /&gt;    MODEL VARCHAR(50) NOT NULL PRIMARY KEY,&lt;br /&gt;    PRICE DECIMAL NOT NULL&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;CREATE TABLE COUNTRIES (&lt;br /&gt;    COUNTRY_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,&lt;br /&gt;    COUNTRY VARCHAR(30) &lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;ALTER TABLE CLIENTS    &lt;br /&gt;ADD CONSTRAINT COUNTRIES_FK Foreign Key (COUNTRY_ID)&lt;br /&gt;   REFERENCES COUNTRIES (COUNTRY_ID);&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblogs.java.net/blog/pkeegan/archive/2008/05/input_on_a_new.html"&gt;Read the rest of this tutorial&lt;/a&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/jQJQy3rUHgk" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/input_on_a_new_desktop</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/trail_the_reflection_api</id>
        <title type="html">Trail: The Reflection API</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/lAsUIyLhE5I/trail_the_reflection_api" />
        <published>2008-05-20T12:16:19-07:00</published>
        <updated>2008-05-20T12:16:19-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="reflection" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn what reflection is, when and how to use it, and the disadvantages of using reflection.</summary>
        <content type="html">&lt;blockquote&gt;
&lt;h3&gt;Uses of Reflection&lt;/h3&gt;

&lt;p&gt; Reflection is commonly used by programs which require the ability to
examine or modify the runtime behavior of applications running in the Java
virtual machine.  This is a relatively advanced feature and should be used only
by developers who have a strong grasp of the fundamentals of the language.
With that caveat in mind, reflection is a powerful technique and can enable
applications to perform operations which would otherwise be impossible.

&lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Extensibility Features&lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt; An application may make use of external, user-defined classes by creating
instances of extensibility objects using their fully-qualified names.

&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Class Browsers and Visual Development Environments&lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt; A class browser needs to be able to enumerate the members of classes.
Visual development environments can benefit from making use of type information
available in reflection to aid the developer in writing correct code.

&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Debuggers and Test Tools&lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt; Debuggers need to be able to examine private members on classes.  Test
harnesses can make use of reflection to systematically call a discoverable set
APIs defined on a class, to insure a high level of code coverage in a test
suite.
&lt;/dd&gt;&lt;/dl&gt;

&lt;h3&gt;Drawbacks of Reflection&lt;/h3&gt;

Reflection is powerful, but should not be used indiscriminately.  If it is
possible to perform an operation without using reflection, then it is
preferable to avoid using it.  The following concerns should be kept in mind
when accessing code via reflection.

&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Performance Overhead&lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt; Because reflection involves types that are dynamically resolved, certain
Java virtual machine optimizations can not be performed.  Consequently,
reflective operations have slower performance than their non-reflective
counterparts, and should be avoided in sections of code which are called
frequently in performance-sensitive applications.

&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Security Restrictions&lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt; Reflection requires a runtime permission which may not be present when
running under a security manager.  This is in an important consideration for
code which has to run in a restricted security context, such as in an Applet.

&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Exposure of Internals&lt;/b&gt;
&lt;/dt&gt;&lt;dd&gt; Since reflection allows code to perform operations that would be illegal
in non-reflective code, such as accessing &lt;code&gt;private&lt;/code&gt; fields and
methods, the use of reflection can result in unexpected side-effects, which may
render code dysfunctional and may destroy portability. Reflective code breaks
abstractions and therefore may change behavior with upgrades of the platform.
&lt;/dd&gt;&lt;/dl&gt;

&lt;h3&gt;Trail Lessons&lt;/h3&gt;

This trail covers common uses of reflection for accessing and manipulating
classes, fields, methods, and constructors.  Each lesson contains code
examples, tips, and troubleshooting information.

&lt;dl&gt;&lt;dt&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/reflect/class/index.html"&gt;
     &lt;img height="20" border="0" align="left" width="20" src="http://java.sun.com/docs/books/tutorial/images/reflectionsm.GIF" /&gt;
     &lt;b&gt;Classes&lt;/b&gt;&lt;/a&gt;
&lt;/dt&gt;&lt;dd&gt; This lesson shows the various ways to obtain a
&lt;a class="APILink" target="_blank" href="http://java.sun.com/javase/6/docs/api/java/lang/Class.html"&gt;&lt;code&gt;Class&lt;/code&gt;&lt;/a&gt;
    object and use it to examine properties of a class, including its
    declaration and contents.

&lt;/dd&gt;&lt;dt&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/reflect/member/index.html"&gt;
     &lt;img height="20" border="0" align="left" width="20" src="http://java.sun.com/docs/books/tutorial/images/reflectionsm.GIF" /&gt;
     &lt;b&gt;Members&lt;/b&gt;&lt;/a&gt;
&lt;/dt&gt;&lt;dd&gt; This lesson describes how to use the Reflection APIs to find the  fields,
     methods, and constructors of a class.  Examples are provided for setting
     and getting field values, invoking methods, and creating new instances of
     objects using specific constructors.

&lt;/dd&gt;&lt;dt&gt; &lt;a href="http://java.sun.com/docs/books/tutorial/reflect/special/index.html"&gt;
     &lt;img height="20" border="0" align="left" width="20" src="http://java.sun.com/docs/books/tutorial/images/reflectionsm.GIF" /&gt;
     &lt;b&gt;Arrays and Enumerated Types&lt;/b&gt;&lt;/a&gt;
&lt;/dt&gt;&lt;dd&gt; This lesson introduces two special types of classes:  arrays, which are
     generated at runtime, and &lt;code&gt;enum&lt;/code&gt; types, which define unique
     named object instances.  Sample code shows how to retrieve the component
     type for an array and how to set and get fields with array or
     &lt;code&gt;enum&lt;/code&gt;  types.
&lt;/dd&gt;&lt;/dl&gt;

&lt;blockquote&gt;&lt;hr /&gt;&lt;b&gt;Note:&lt;/b&gt;&amp;nbsp;The examples in this trail are designed for experimenting with the Reflection
APIs. The handling of exceptions therefore is not the same as would be used in
production code.  In particular, in production code it is not recommended to
dump stack traces that are visible to the user.
&lt;hr /&gt;&lt;/blockquote&gt;
        &lt;/blockquote&gt;
    &lt;div class="NavBit"&gt;
        &lt;a href="http://java.sun.com/docs/books/tutorial/reflect/index.html"&gt;Read the rest of this trail&lt;/a&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/reflect/class/index.html"&gt;&lt;/a&gt;

    &lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/lAsUIyLhE5I" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/trail_the_reflection_api</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/the_2008_javaone_conference_for</id>
        <title type="html">The 2008 JavaOne Conference: For New Developers</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/K3NJ6wkbNmA/the_2008_javaone_conference_for" />
        <published>2008-04-24T11:25:30-07:00</published>
        <updated>2008-04-24T11:25:30-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="conference" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="javaone" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Read how new developers and students can benefit from the 2008 JavaOne Conference this year, including free entry for some.</summary>
        <content type="html">&lt;p&gt;by Dana Nourie&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://java.sun.com/javaone/sf/"&gt;2008 JavaOne Conference&lt;/a&gt;, with events from May 5 to 9 in San Francisco, California, is a great place for new developers to learn about many &lt;a href="http://java.sun.com"&gt;Java technologies&lt;/a&gt; and see how these technologies fit together. In addition, you can learn about other technologies and scripting languages, such as &lt;a href="http://developers.sun.com/web/scripting/index.jsp"&gt;Ruby and Groovy&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The conference kicks off on Monday, May 5, with &lt;a href="http://java.sun.com/javaone/sf/javauniversity.jsp"&gt;Java University&lt;/a&gt;, which consists of classes you can take to learn how to program for the Java platform and how to incorporate other technologies and use tools, such as the &lt;a target="_blank" href="http://www.netbeans.org"&gt;NetBeans IDE&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The rest of the week is filled with technical sessions that last about one hour each and that cover many different topics. In addition, the JavaOne conference also has Birds-of-a-Feather (BOF) sessions where you can hear what fellow developers think, what they're doing professionally, and where they want to see technologies go. It's a week jam-packed with technical how-to and information that can be hard to find elsewhere.&lt;/p&gt;

&lt;p&gt;This year, Sun will allow some student developers to attend the &lt;a href="http://developers.sun.com/events/studentprogram/index.jsp"&gt;JavaOne conference for free!&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Recommended sessions for students include the following:

&lt;table width="96%" cellspacing="0" cellpadding="5" border="1" bgcolor="#ffffff" align="center"&gt;
&lt;tbody&gt;&lt;tr bgcolor="#5382a1"&gt;
&lt;th align="left" colspan="1" class="middle_10"&gt;&lt;font color="white"&gt;Session&amp;nbsp;ID&lt;/font&gt;&lt;/th&gt;
&lt;th align="left" colspan="1" class="middle_10"&gt;&lt;font color="white"&gt;Session Title&lt;/font&gt;&lt;/th&gt;
&lt;th align="left" colspan="1" class="middle_10"&gt;&lt;font color="white"&gt;Speaker Name and Company&lt;/font&gt;&lt;/th&gt;
&lt;/tr&gt;

&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-5925&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;A City-Driving Robotic Car Named Tommy Jr.&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Paul Perrone, Perrone Robotics&lt;/td&gt;

&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-5841&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Project Aura: Recommendation for the Rest of Us&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Stephen Green and Paul Lamere, Sun Microsystems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="white"&gt;

&lt;td valign="top" class="middle_10"&gt;TS-6656&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Extreme GUI Makeover: Swing Meets FX&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Christopher Campbell and Shannon Hickey, Sun Microsystems&lt;/td&gt;

&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-6611&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Filthy-Rich Clients: Filthier, Richer, Clientier&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Romain Guy, Google; Chet Haase, Adobe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-5286&lt;/td&gt;

&lt;td valign="top" class="middle_10"&gt;Introduction to Web Beans&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Gavin King, JBoss&lt;/td&gt;

&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-6169&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Spring Framework 2.5: New and Notable&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Rod Johnson, SpringSource&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-6528&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Listen and Speak: Teach Your Old Device New Tricks&lt;/td&gt;

&lt;td valign="top" class="middle_10"&gt;Charles Hemphill, Conversay; Steve Rondel, Conversay&lt;/td&gt;

&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-6623&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;More &amp;quot;Effective Java&amp;quot;&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Joshua Bloch, Google&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-5579&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Closures Cookbook&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Neal Gafter, Google&lt;/td&gt;

&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-5165&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Programming With Functional Objects in Scala&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Martin Odersky, EPFL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-5152&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Overview of the JavaFX Script Programming Language&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Christopher Oliver, Sun Microsystems&lt;/td&gt;
&lt;/tr&gt;

&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-6050&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Comparing JRuby and Groovy&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Neal Ford, ThoughtWorks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-4842&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Designing an MMORPG With Project Darkstar&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Jeffrey Kesselman, Sun Microsystems&lt;/td&gt;
&lt;/tr&gt;

&lt;tr class="white"&gt;

&lt;td valign="top" class="middle_10"&gt;TS-6807&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;What's New in Ajax&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Dion Almaer, Ajaxian; Ben Galbraith, MediaBank&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-6537&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Applications for the Masses by the Masses: Why Engineers Are an Endangered Species&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Girish Balachandran and Todd Fast, Sun Microsystems&lt;/td&gt;
&lt;/tr&gt;

&lt;tr class="white"&gt;
&lt;td valign="top" class="middle_10"&gt;TS-5249&lt;/td&gt;

&lt;td valign="top" class="middle_10"&gt;The NetBeans Ruby IDE: You Thought Rails Development Was Fun Before&lt;/td&gt;
&lt;td valign="top" class="middle_10"&gt;Brian Leonard and Tor Norbye, Sun Microsystems&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;

&lt;p&gt;Additionally, you can attend fun sessions on how Java technologies are being used in the world of science: Mapping Mars (TS-6608); Universal Translator -- Breaking the Communication Barrier With JSAPI (TS-5908); Pushing Java OpenGL (JOGL) to the Limit With Stellarium (TS-4964); and Mars Rover Operations Imaging and Mapping With Java Technology (BOF-5044).&lt;/p&gt;

&lt;p&gt;If you're interested in gaming, check out Video Game Development on the Java Platform: Past, Present, and Future of Java Technology Games (BOF-5832); Creating Games on the Java Platform with the jMonkeyEngine (TS-5711); Using Comet to Create a Two-Player Web Game (BOF-6584); and Project Wonderland: A Toolkit for Building 3-D Virtual Worlds (TS-6125).&lt;/p&gt;

&lt;p&gt;Check the &lt;a href="http://java.sun.com/javaone/sf/"&gt;2008 JavaOne Conference&lt;/a&gt; home page for more information, including a complete &lt;a href="https://www28.cplan.com/cc191/sessions_catalog.jsp"&gt;content catalog&lt;/a&gt; searchable by keyword, speaker name, track, and other parameters.&lt;/p&gt;&lt;p&gt;If you can't make it to the conference this year, you can read about the sessions as &lt;a title="2008 JavaOne Conference Blog" href="http://blogs.sun.com/javaone2008/"&gt;Sun writers blog&lt;/a&gt; from the trenches, sharing technical information and their impressions of the conference.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Hope to see you there! &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/K3NJ6wkbNmA" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/the_2008_javaone_conference_for</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/young_developers_section_in_the</id>
        <title type="html">Young Developers Section in the New to Java Programming Center</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/64tlAOCoeIk/young_developers_section_in_the" />
        <published>2008-04-15T14:56:31-07:00</published>
        <updated>2008-04-15T14:56:31-07:00</updated> 
        <category term="/Sun" label="Sun" />
        <category term="children" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="learning" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="programming" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">The &lt;a href="http://java.sun.com/new2java/" title="New to Jaa Programming Center"&gt;New to Java Programming Center&lt;/a&gt; is delighted to present a new section just for &lt;a href="http://java.sun.com/new2java/learning/young_developers.jsp" title="Young Developers"&gt;young developers&lt;/a&gt;.</summary>
        <content type="html">&lt;p&gt;Programming isn't just for adults any longer. Young people are learning
programming languages from the earliest ages and up. The &lt;a href="http://java.sun.com/new2java/" title="New to Jaa Programming Center"&gt;New to Java Programming Center&lt;/a&gt; is delighted to present a new section just for &lt;a href="http://java.sun.com/new2java/learning/young_developers.jsp" title="Young Developers"&gt;young developers&lt;/a&gt;, that lists tools and
web sites that focus on teaching young developers how to program using the Java
programming language, as well as languages developed for ease of use.&lt;/p&gt;&lt;p&gt;See &lt;a href="http://java.sun.com/new2java/learning/young_developers.jsp" title="Young Developers"&gt;Young Developers&lt;/a&gt; in the &lt;a href="http://java.sun.com/new2java/" title="New to Jaa Programming Center"&gt;New to Java Programming Center.&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/64tlAOCoeIk" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/young_developers_section_in_the</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/building_an_ajax_chat_room</id>
        <title type="html">Building an Ajax Chat Room with the Ajax Transaction Dynamic Faces Component</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/IDevrFCiofs/building_an_ajax_chat_room" />
        <published>2008-04-09T12:07:55-07:00</published>
        <updated>2008-04-09T12:07:55-07:00</updated> 
        <category term="/Ajax" label="Ajax" />
        <category term="dynamic_faces" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="ide" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="jsf" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">In this &lt;a href="http://www.netbeans.org/kb/60/web/ajaxchatroom.html" title="Build an Ajax Chat Room in NetBeans"&gt;tutorial&lt;/a&gt;,
you build an Ajax chat room web application with components that are
themselves Ajax-unaware, also known as POJC (Plain Old JavaServer Faces
Components).</summary>
        <content type="html">&lt;p&gt;In this &lt;a href="http://www.netbeans.org/kb/60/web/ajaxchatroom.html" title="Build an Ajax Chat Room in NetBeans"&gt;tutorial&lt;/a&gt;, you build an Ajax chat room web application with components that are themselves Ajax-unaware, also known as POJC (Plain Old JavaServer Faces Components). You achieve this using Dynamic Faces technology, an extension to JavaServer Faces technology that lets you easily implement Ajax functionality. In particular, you use the Ajax Transaction component included with the Dynamic Faces component library (0.2), which lets you visually configure Ajax functionality at design time. The chat room application comprises one rendered page, shown below, and is entirely Ajax-based. No conventional page submissions occur. Specifically, an Ajax request is sent when the user sends a comment by typing text in the text field and clicking the Send button or pressing the Enter key. The page also uses Ajax requests to poll the server continually in order to update the transcript of comments.&lt;br /&gt;&lt;br /&gt;Contents&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Tutorial Requirements&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Creating the Project&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Configuring the Deployment Descriptor&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Adding the Dynamic Faces Component Library to the Project&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Adding Code to the Application Bean&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Adding Code to Store the Username&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Adding the transcript Property to Page1.java&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Creating the User Interface&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Configuring Ajax Transactions for Sending Comments and Polling&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Setting JavaScript Properties of the Body and Form Components&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Adding JavaScript&lt;br /&gt;- &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Deploying the Project&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;b&gt;This tutorial works with the following technologies and resources&lt;/b&gt;&lt;/p&gt;

&lt;table cellpadding="1" border="1"&gt;
  &lt;tbody&gt;
  &lt;tr&gt;
    &lt;td valign="top"&gt;JavaServer Faces Components/&lt;br /&gt;
      Java EE Platform&lt;/td&gt;
    &lt;td valign="top"&gt;&lt;!-- &lt;img src="../../../images/articles/60/web/spacer.png" alt="works with" height="15" hspace="3" width="14"&gt;1.2 with Java EE 5*&lt;br&gt; --&gt;
      &lt;img width="14" hspace="3" height="15" alt="works with" src="http://www.netbeans.org/images/articles/60/web/check.png" /&gt;1.1 with J2EE 1.4
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
    &lt;td valign="top"&gt;&lt;a href="http://www.netbeans.org/kb/community/releases/55/vwp-install.html#samples"&gt;Travel Database&lt;/a&gt;&lt;/td&gt;
    &lt;td valign="top" colspan="4"&gt;&lt;img width="14" hspace="3" height="15" alt="works with" src="http://www.netbeans.org/images/articles/60/web/spacer.png" /&gt;Not Required&lt;/td&gt;
  &lt;/tr&gt;

&lt;/tbody&gt;&lt;/table&gt;


&lt;!-- END RESOURCE MATRIX --&gt;&lt;!-- END INTRO -----------------------------------------------------------------------------------------* --&gt;&lt;!-- ======================================================================================== --&gt;&lt;!-- ======================================================================================== --&gt;





















&lt;br /&gt;


&lt;h2&gt;&lt;a name="01"&gt;&lt;/a&gt;Tutorial Requirements&lt;/h2&gt;
&lt;!-- Intro paragraph for this topic --------------------------------------------------------------------* --&gt;


&lt;p&gt;Before you begin, you need to install the following software on your computer:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;NetBeans IDE 6.0 with Web and Java EE functionality (included in the Web and Java EE download and the All download). (&lt;a href="http://download.netbeans.org/netbeans/6.0/beta2/"&gt;download&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;Visual
Web Samples Plugin. This plugin includes the Dynamic Faces Component
Library (0.2). Follow the instructions in the section entitled
&amp;quot;Installing the Plugin&amp;quot; in &lt;a href="http://www.netbeans.org/kb/60/web/ajaximportcomponents.html"&gt;Installing the Visual Web Samples Plugin&lt;/a&gt;.
Be sure to select the entries for both the Visual Web JSF Post Release
Samples and the Visual Web JSF Backwards Compatibility Kit.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;
&lt;!-- ======================================================================================== --&gt;&lt;!-- BEGIN FIGURE COMPONENT --&gt;

        
                    
                        &lt;img width="599" height="505" border="1" title="Ajax Chat Room Web Application" alt="Ajax Chat Room Web Application" src="http://www.netbeans.org/images/articles/60/web/chatroom/ajaxchatroom.gif" /&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.netbeans.org/kb/60/web/ajaxchatroom.html" title="Build an Ajax Chat Room in NetBeans"&gt;Follow the tutorial&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;**********************************&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3&gt;&lt;b&gt;Sun Student Courses&lt;/b&gt;&lt;/h3&gt;&lt;p&gt;&lt;br /&gt;&lt;a href="http://www.sunstudentcourses.com" title="Real World Technologies"&gt;Real World Technologies: NetBeans GUI Builder, JRuby, JavaFX, and JavaME&lt;/a&gt; is an introduction level course that leads you to the basics of JavaFX, NetBeans GUI, JRuby, and JavaME programming. When you finish this course you will earn a certificate.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/IDevrFCiofs" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/building_an_ajax_chat_room</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/trail_the_extension_mechanism</id>
        <title type="html">Trail: The Extension Mechanism</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/3rBqAZoDFmI/trail_the_extension_mechanism" />
        <published>2008-03-26T10:01:43-07:00</published>
        <updated>2008-03-26T10:01:43-07:00</updated> 
        <category term="/Java SE" label="Java SE" />
        <category term="extension" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java_se" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="mechanism" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">Learn about the extension mechanism, which enables the runtime environment to find and load extension classes without the extension classes having to be named on the class path.</summary>
        <content type="html">The extension mechanism was introduced as a new feature in the 
Java&lt;font size="-2"&gt;&lt;sup&gt;TM&lt;/sup&gt;&lt;/font&gt; 1.2 platform. 
The extension mechanism provides a standard, scalable way to make 
custom APIs available to all applications running on the Java platform. 

As of the 
Java 1.3 platform release, &lt;em&gt;Java
extensions&lt;/em&gt; are also referred to as &lt;em&gt;optional packages&lt;/em&gt;.  This
trail may use both terms interchangeably.


&lt;p&gt;

&lt;em&gt;Extensions&lt;/em&gt; are groups of packages and classes that augment the Java 
platform through the extension mechanism. The extension mechanism 
enables the runtime environment to find and load extension classes without 
the extension classes having to be named on the class path. 
In that respect, extension classes are similar to the Java platform's 
core classes.  That's also where extensions get their name -- they, 
in effect, extend the platform's core API.
&lt;p&gt;

Since this mechanism extends the platform's core API, its use
should be judiciously applied. Most commonly it is used for well standarized
interfaces such as those defined by the
Java Community Process&lt;font size="-2"&gt;&lt;sup&gt;SM&lt;/sup&gt;&lt;/font&gt;,
although it may also be
appropriate for site wide interfaces.
&lt;p&gt;

&lt;p&gt;&lt;center&gt;&lt;IMG SRC="http://java.sun.com/docs/books/tutorial/figures/ext/exta.gif" WIDTH="461" HEIGHT="293" ALIGN="BOTTOM" ALT="This figure shows the relationships between Application, Java Platform, and Extensions."&gt;&lt;/center&gt;&lt;/p&gt;
&lt;p&gt;
 As the diagram indicates, extensions act as 
"add-on" modules to the Java platform. Their classes and public APIs are 
automatically available to any applications running on the platform. 
&lt;p&gt;

The extension mechanism also provides a means for extension classes to be 
downloaded from remote locations for use by applets.
&lt;p&gt;

Extensions are bundled as Java Archive (JAR) files, and this trail 
assumes that you are familiar with the JAR file format.  If you're not 
up to speed on JAR files, you might want to review some JAR-file documentation 
before proceeding with the lessons in this trail:
&lt;ul&gt;
&lt;li&gt;The
&lt;a class="TutorialLink" target="_top" href="http://java.sun.com/docs/books/tutorial/deployment/jar/index.html"&gt;Packaging Programs in JAR Files&lt;/a&gt; lesson in this tutorial.
&lt;li&gt;The 
&lt;a class="OutsideLink" target="_blank" href="http://java.sun.com/javase/6/docs/technotes/guides/jar/jarGuide.html"&gt;JAR Guide&lt;/a&gt;  in the JDK&lt;font size="-2"&gt;&lt;sup&gt;TM&lt;/sup&gt;&lt;/font&gt; documentation.&lt;/ul&gt; 

&lt;p&gt;
This trail has two lessons:
&lt;P&gt;
&lt;h3&gt;
&lt;a class="TutorialLink" target="_top" href="http://java.sun.com/docs/books/tutorial/ext/basics/index.html"&gt;Creating and Using Extensions&lt;/a&gt;&lt;/h3&gt;
&lt;blockquote&gt;
This section
shows you what you need to do to add an extension to your Java platform 
and how applets can benefit from the extension mechanism by 
downloading remote extension classes.
&lt;/blockquote&gt;
&lt;P&gt;
&lt;h3&gt;
&lt;a class="TutorialLink" target="_top" href="http://java.sun.com/docs/books/tutorial/ext/security/index.html"&gt;Making Extensions Secure&lt;/a&gt;&lt;/h3&gt;
&lt;blockquote&gt;
This section describes
security privileges and 
permissions that are granted to extensions on your platform. You'll 
see how to use the Java platform's security architecture if you're writing 
extensions classes of your own.
&lt;/blockquote&gt;


&lt;h3&gt;Additional Documentation&lt;/h3&gt;
You can find further information about extensions in the 

&lt;a class="OutsideLink" target="_blank" href="http://java.sun.com/javase/6/docs/technotes/guides/extensions/"&gt;The Java Extensions Mechanism&lt;/a&gt;  section of the JDK documentation.

        &lt;/blockquote&gt;
&lt;p&gt;
***********&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.netbeans.org/competition/blog-contest.html"&gt;Download NetBeans IDE 6.1 Beta  – Win Big!&lt;/a&gt;&lt;br&gt;
Download Sun NetBeans IDE 6.1 Beta to preview for yourself. Post a blog describing your experience using NetBeans and you could win $500.&lt;/P&gt;
&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/3rBqAZoDFmI" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/trail_the_extension_mechanism</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/creating_a_simple_web_application</id>
        <title type="html">Creating a Simple Web Application Using a MySQL Database</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/1NwXynzQuXM/creating_a_simple_web_application" />
        <published>2008-03-10T10:35:53-07:00</published>
        <updated>2008-03-10T10:35:53-07:00</updated> 
        <category term="/Web Application" label="Web Application" />
        <category term="applications" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="databases" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="mysql" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="web" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">This document describes how to create a simple web application that connects
            to a MySQL database server.</summary>
        <content type="html">&lt;p&gt;This document describes how to create a simple web application that connects
            to a MySQL database server. It also covers some basic ideas and technologies
            in web development, such as &lt;a href="http://java.sun.com/products/jsp"&gt;JavaServer
            Pages&lt;/a&gt;&amp;trade; (JSP), &lt;a href="http://java.sun.com/products/jsp/jstl/"&gt;JavaServer
            Pages Standard Tag Library&lt;/a&gt;&amp;trade; (JSTL), the Java Database Connectivity&amp;trade;
            (JDBC) API, and two-tier, client-server architecture. This tutorial is designed for
            beginners who have a basic understanding of web development and are looking to
            apply their knowledge using a MySQL database.&lt;/p&gt;

        &lt;p&gt;&lt;a href="http://www.mysql.com"&gt;MySQL&lt;/a&gt; is a popular Open Source database
            management system commonly used in web applications due to its speed,
            flexibility and reliability. MySQL employs SQL, or &lt;em&gt;Structured Query
            Language&lt;/em&gt;, for accessing and processing data contained in databases.&lt;/p&gt;

        &lt;p&gt;This tutorial continues from the &lt;a href="../ide/mysql.html"&gt;Connecting
            to a MySQL Database&lt;/a&gt; tutorial and assumes that you already have a
            connection to a MySQL database created and registered in NetBeans IDE.
            The table data that is included in
            &lt;a href="http://www.netbeans.org/files/documents/4/1358/ifpwafcad.sql"&gt;ifpwafcad.sql&lt;/a&gt;.
            is also required for this tutorial. This SQL file creates two tables,
            &lt;tt&gt;Subject&lt;/tt&gt; and &lt;tt&gt;Counselor&lt;/tt&gt;, then populates them with
            sample data. Save this file to a local directory, then open it in
            NetBeans IDE and run it on the MySQL database. The database used in
            this tutorial is named &lt;tt&gt;MyNewDatabase&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;
Read &lt;a href="http://www.netbeans.org/kb/60/web/mysql-webapp.html"&gt;Creating a Simple Web Application Using a MySQL Database&lt;/a&gt;.
&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/1NwXynzQuXM" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/creating_a_simple_web_application</feedburner:origLink></entry>
    <entry>
        <id>http://blogs.sun.com/JavaFundamentals/entry/easy_web_site_creation_in</id>
        <title type="html">Easy Web Site Creation in the NetBeans IDE</title>
        <author><name>dananourie</name></author>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/javatechfundamentals/~3/QFpnUVx-DtI/easy_web_site_creation_in" />
        <published>2008-02-19T19:29:08-08:00</published>
        <updated>2008-02-19T19:29:08-08:00</updated> 
        <category term="/Web Application" label="Web Application" />
        <category term="java" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="netbeans" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="programming" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="web" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="webmasters" scheme="http://rollerweblogger.org/ns/tags/" />
        <category term="websites" scheme="http://rollerweblogger.org/ns/tags/" />
        <summary type="html">This article shows how incredibly easy it is to create a web site in the NetBeans IDE through drag-and-drop without writing code, 
and how you can gradually learn Java programming by adding to your 
JavaServer Pages (JSP), and creating other 
features or programs that may be added to your site.</summary>
        <content type="html">by Dana Nourie

&lt;p&gt;Last year I attended a &lt;a href="http://developers.sun.com/events/techdays/" title="Tech Days"&gt;Tech Days&lt;/a&gt; 
event and learned about the ease of use of &lt;a href="https://ajax.dev.java.net/" target="_blank"&gt;jMaki widgets &lt;/a&gt; for web site building, 
and then  I gave a chat in &lt;a href="http://www.secondlife.com" target="_blank"&gt;Second Life&lt;/a&gt; on the topic of web programming using the 

&lt;a href="http://www.netbeans.org" target="_blank"&gt;NetBeans IDE&lt;/a&gt;, including what I had learned at Tech Days.  This article is based on 
those talks, showing how incredibly easy it is to create a web site in NetBeans through drag-and-drop without writing code, 
and how you can gradually learn Java programming by adding to your 
&lt;a href="http://java.sun.com/products/jsp/" title="JavaServer Pages (JSP)"&gt;JavaServer Pages (JSP)&lt;/a&gt;, and creating other 
features or programs that may be added to your site.&lt;/p&gt;
&lt;p&gt;This article is aimed at new developers and programmers, and developers new to the NetBeans IDE. To follow the examples, 
you must have the following software installed on your computer:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; The &lt;a href="http://java.sun.com/javase/downloads/?intcmp=1281"&gt;Java Standard Edition Platform (Java SE)&lt;/a&gt; (Note, you can download the JDK with the NetBeans IDE).&lt;/li&gt;
&lt;li&gt; The &lt;a href="http://download.netbeans.org/netbeans/6.0/final/" target="_blank"&gt;NetBeans IDE 6.0&lt;/a&gt; or greater.&lt;/li&gt;

&lt;/ul&gt;
&lt;div&gt;&lt;b&gt;NetBeans IDE Benefits for Web Site Developers&lt;/b&gt;&lt;/div&gt;
&lt;div class="contentdivider"&gt;
&lt;table class="grey4" border="0" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="http://java.sun.com/im/a.gif" alt=" " border="0" height="4" width="1"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;As many of you know, web applications often require many different programming languages, and a way of combining various technologies. 
For instance, you may use HTML and CSS for your page formatting, JavaScript for some rollover buttons, and a Java servlet or JSP to process a form. 
The latter is a good way to learn the syntax of the Java programming language and is a great entry point if you are new to the Java platform.&lt;/p&gt;
&lt;p&gt;One of the wonderful things about the NetBeans IDE is that you don't have to know all the languages or how to combine the technologies. 
NetBeans handles the languages, and combines technologies seamlessly for you. In addition, the NetBeans IDE has some wonderful drag-and-drop 
widgets from various built-in palettes. For instance, you can drag and drop HTML components to create a form, Swing components to create great 
looking buttons or menus, or drop in interactive Ajax components using &lt;a href="https://ajax.dev.java.net/" target="_blank" title="jMaki"&gt;jMaki widgets&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The web site you see below in Figure 1 is not beautiful, nor is it a design I recommend. However, all of its components were simply dragged onto a page, 
and are fully functional, requiring no code to be written from scratch. You can  do a lot of web site creation in the NetBeans IDE with very little programming.&lt;/p&gt;
&lt;!-- BEGIN IMAGE WITH CAPTION --&gt;

&lt;table border="0" cellpadding="2" cellspacing="0" width="350"&gt;
&lt;tr&gt;
&lt;td class="grey3" align="center"&gt;
&lt;img src="http://java.sun.com/developer/onlineTraining/tools/netbeans/images/site1Thumb.jpg" alt="" height="164" width="350"&gt;
&lt;div class="pad3"&gt;
&lt;span class="dkcaption1"&gt;&lt;b&gt;Figure 1:&lt;/b&gt;&lt;i&gt; Sample Web Site&lt;/i&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;span class="sp10"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;!-- END IMAGE WITH CAPTION --&gt;
&lt;p&gt;Notice the clock that keeps time (on the right), a form (on the left) that gathers data from users with the all important CAPTCHA (the image above the submit button) 
to prevent spam, a tab layout in the center that makes for nice organization, and a fisheye effect on the photos at the top. No programming was needed for any of these. 
All of these features were added through drag and drop, which is far less time consuming than coding those components yourself. &lt;/p&gt;

&lt;p&gt;There are also many services available that you can simply drop onto a page, then add URLs, or whatever you need to include to pull in that service, 
such as with a mashup. For instance, adding RSS feeds to your page is very easy.&lt;/p&gt;
&lt;p&gt;NetBeans also handles writing to and pulling data from a database, as described in the 
&lt;a href="http://www.netbeans.org/kb/60/web/databoundcomponents.html" target="_blank"&gt;Using Databound Components to Access a Database&lt;/a&gt; tutorial. &lt;/p&gt;

&lt;div class="contentdivider"&gt;
&lt;table class="grey4" border="0" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="http://java.sun.com/im/a.gif" alt=" " border="0" height="4" width="1"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;
To create the web site shown above, read the &lt;a href="http://java.sun.com/developer/onlineTraining/tools/netbeans/"&gt;rest of this article&lt;/a&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/javatechfundamentals/~4/QFpnUVx-DtI" height="1" width="1"/&gt;</content>
    <feedburner:origLink>http://blogs.sun.com/JavaFundamentals/entry/easy_web_site_creation_in</feedburner:origLink></entry>
</feed>
