Java
  Home arrow Java arrow A Fast Gateway to OOP in Java using NetBea...
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  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
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

A Fast Gateway to OOP in Java using NetBeans IDE
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2006-06-26

    Table of Contents:
  • A Fast Gateway to OOP in Java using NetBeans IDE
  • Adding your own class
  • Customizing your own class
  • Accessing the members in “test”
  • Working with more than one object

  • 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


    A Fast Gateway to OOP in Java using NetBeans IDE


    (Page 1 of 5 )

    This series introduces you to object oriented programming in Java visually using NetBeans IDE. This series will be a bit different from traditional introductions to OOP in Java. In traditional introductions of OOP in Java, we are generally used to working with console applications using the command line.
    A downloadable file for this article is available here.

    Even though doing things the manual way gives us a better understanding, I prefer fast development and fast learning.  This is why I chose NetBeans IDE (which is FREE) to learn and work with OOP in Java very quickly. If you are looking for a manual way of working with Java and learning OOP, this article may not work for you!

    I already introduced NetBeans IDE in my first article “Developing Java Applications using NetBeans.” Even though that article is fairly introductory, the next two articles concentrate on the basics of JFC.  You can find the next two articles here and here.

    If you are new to NetBeans IDE, I strongly suggest you go through the existing articles first, before proceeding with this one. If you are new to developing Microsoft SQL Server based Java applications, I request you go through another article of mine (of course, this is also part of a series) called "Developing SQL Server based Java Applications using NetBeans IDE."

    Creating your first class definition in Java using NetBeans IDE: a testing frame

    I don’t want to bore you with any introductions to OOP. There are plenty of resources on the web to really learn the concepts of OOP.  I would like to focus rather practically.

    So, let’s start without wasting a second. Using NetBeans IDE, create a new project and name it “SampleOOPApplication.” 

    • Within the “Project” view, open “SampleOOPApplication,” right click on “Source Packages,” and go to New -> Java Package (Fig 01).

    • Within the “New Package” dialog, provide the package name “MyPack” (Fig02) and click on “Finish.”

    • Again, right click on “MyPack” -> New -> JFrame Form (Fig03).

    • Within the “New JFrame Form” dialog, give the class name “Test” and click on “Finish.”
    • To make this sample simple, right click on the Frame, and go to Set Layout -> Null Layout (Fig04).

    • Drop a button (btnShow) and a label (lblMsg) from “Palette” and make sure that the screen looks something like this (Fig05).

    • Go to the source view and replace the following:

    public class Test extends javax.swing.JFrame {   

        /** Creates new form Test */
        public Test() {
            initComponents();
        }

    with:

    public class Test extends javax.swing.JFrame {    

        /** Creates new form Test */
        public Test() {
            initComponents();
    this.setSize(300,200);
        }

    More Java Articles
    More By Jagadish Chaterjee


       · hello guys. I am starting OOP with Java along with NetBeans IDE. enjoy the...
     

    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