Java
  Home arrow Java arrow Page 3 - Traversing To and Fro with SQL Server Base...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Traversing To and Fro with SQL Server Based Java Applications using NetBeans IDE
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2006-06-28

    Table of Contents:
  • Traversing To and Fro with SQL Server Based Java Applications using NetBeans IDE
  • How to connect to the database during form load
  • The Java code from IDE
  • The source code for buttons
  • How to handle the clear memory resources when the form is closed

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Traversing To and Fro with SQL Server Based Java Applications using NetBeans IDE - The Java code from IDE


    (Page 3 of 5 )

    In this section, I shall give you some overview of the code generated behind the scenes.  I already explained the code generated in the previous article.  All of my introductory articles really explain each and every statement for the code generated behind the scenes.  To make it simple, I shall list the most important code, which is a bit different from other articles.

    As you know, the button declaration will be a bit different from the others, as it has some "event" to be published.  The following is the code for the same:

    btnFirst.setLabel("<<");
            btnFirst.addActionListener(new
    java.awt.event.ActionListener() {
                public void actionPerformed
    (java.awt.event.ActionEvent evt) {
                    btnFirstActionPerformed(evt);
                }
            });
            getContentPane().add(btnFirst);
            btnFirst.setBounds(20, 130, 51, 23);
            btnPrevious.setLabel("<");
            btnPrevious.addActionListener(new
    java.awt.event.ActionListener() {
                public void actionPerformed
    (java.awt.event.ActionEvent evt) {
                    btnPreviousActionPerformed(evt);
                }
            });
            getContentPane().add(btnPrevious);
            btnPrevious.setBounds(90, 130, 50, 23);
            btnNext.setLabel(">");
            btnNext.addActionListener(new
    java.awt.event.ActionListener() {
                public void actionPerformed
    (java.awt.event.ActionEvent evt) {
                    btnNextActionPerformed(evt);
                }
            });
            getContentPane().add(btnNext);
            btnNext.setBounds(150, 130, 43, 23);
            btnLast.setLabel(">>");
            btnLast.addActionListener(new
    java.awt.event.ActionListener() {
                public void actionPerformed
    (java.awt.event.ActionEvent evt) {
                    btnLastActionPerformed(evt);
                }
            });
            getContentPane().add(btnLast);
            btnLast.setBounds(210, 130, 51, 23);

    The above code will simply add "listeners" to all the buttons designed on our form. That code will be present if and only if you double click on every button to write some code (with respect to that button).  You can also observe that every button is instantiated, labeled, registered with its own listener, and added to the content panel based on the bounds defined by the user.

    More Java Articles
    More By Jagadish Chaterjee


       · Hello guys. Another contribution on working with sql server and java. enjoy
     

    JAVA ARTICLES

    - Deploying Multiple Java Applets as One
    - Deploying Java Applets
    - Understanding Deployment Frameworks
    - Database Programming in Java Using JDBC
    - Extension Interfaces and SAX
    - Entities, Handlers and SAX
    - Advanced SAX
    - Conversions and Java Print Streams
    - Formatters and Java Print Streams
    - Java Print Streams
    - Wildcards, Arrays, and Generics in Java
    - Wildcards and Generic Methods in Java
    - Finishing the Project: Java Web Development ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT