Home arrow Java arrow A Fast Gateway to OOP in Java using NetBeans IDE
JAVA

A Fast Gateway to OOP in Java using NetBeans IDE


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.

Author Info:
By: Jagadish Chaterjee
Rating: 4 stars4 stars4 stars4 stars4 stars / 6
June 26, 2006
TABLE OF CONTENTS:
  1. · A Fast Gateway to OOP in Java using NetBeans IDE
  2. · Adding your own class
  3. · Customizing your own class
  4. · Accessing the members in “test”
  5. · Working with more than one object

print this article
SEARCH DEVARTICLES

A Fast Gateway to OOP in Java using NetBeans IDE
(Page 1 of 5 )


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);
    }


blog comments powered by Disqus
JAVA ARTICLES

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- 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 ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials