TvQuran
Showing posts with label Netbeans IDE. Show all posts
Showing posts with label Netbeans IDE. Show all posts

Sunday, December 13, 2009

J2ME By Example, How to enter Mobile World

We will start in this series simple easy tutorials to start from zero in J2ME track, so stay with us.


1)J2ME Architecture
There are 5 layers in J2ME Architecture.Those are:
  • MIDP (TopMost Layer): Which contains Java APIs for user network connections, persistence storage, and the user interface. It also has access to CLDC libraries and MIDP libraries.
  • J2ME API’s(Profiles): Which consists of the minimum set of application programming interfaces for the small computing device
  • Configurations: Which handles interactions between the profile and the JVM.
  • JVM
  • Operating System(Bottom Layer).

2)Simple Example Program
This section shows a simple application. The MIDlet will display the message “ Hi This is My First Program” on the screen. The application consists of the MIDlet subclass called welcome.





To create midlet .
Right-click on project name --> new --> MIDlet

The code .

The run of the project


3) Limitations with J2ME
Some of the limitations of J2ME compared with Core JAVA
  • Some J2SE applications require classes that are not available in J2ME.
  • Java applications won’t run in the J2ME environment without requiring modification to the code.
  • Devices that use the CDC configuration use the full Java Virtual Machine implementation, while devices that use the CLDC configuration use the Kjava Virtual Machine implementation.
  • MIDlets are controlled by application management software (AMS). So we cant invoke a MIDLET like a J2SE Application.

4)Conclusion
Here with we have an introduction to Java 2 Micro Edition. This example is very simple example. It can be executed using editors like NetBeans IDE or J2ME Wireless Toolkit(KToolBar). Using API's like JSR 135 etc.. try to create more programs and try them in these tools. I will get back to you with more articles on J2ME.

Project Source Code : Click Here
read more...

Saturday, December 12, 2009

Java Editing in NetBeans IDE 6.8, Video Tutorial

One of the most powerful feature in NetBeans IDE is it's Editor. The language-aware NetBeans editor detects errors while you type and assists you with documentation pop-ups and smart code completion-all with the speed and simplicity of your favorite text editor.








read more...

Friday, December 11, 2009

NetBeans IDE 6.8 Overview, The only IDE you need!

NetBeans IDE 6.8 offers best-in-class support for the entire Java EE 6 specification and the GlassFish Enterprise Server v3 platform. Simplify Java application development with Java EE 6 language features: less XML configuration and more POJO-like development; easily target and deploy to GlassFish v3.


















read more...

Thursday, December 10, 2009

How to Make Awesome Program Interface in less than 10 Minutes by Integrating SwingX in NetBeans IDE

Did you dreamed about making free highly designed desktop programs in Java ?!
Do you see that the MS Product have a point for it's IDE and it's ease of use to build GUI in short time ?!
Do you want to make awesome program GUI in less than 10 Minutes ?!!

Yeah, you can do more than that.We will know how to Integrate SwingX(Coolest UI API, I used) in NetBeans IDE(The only IDE you need), So let's dance.

Contents :
  1. What is SwingX?
  2. Downloading SwingX Library.
  3. Adding SwingX Library to NetBeans IDE.
  4. Adding SwingX Library to your Project.
  5. Integrating SwingX with NetBeans IDE (To use drag and drop).
    SwingX ?!

    Contains extensions to the Swing GUI toolkit, including new and enhanced components that provide functionality commonly required by rich client applications. Highlights include:
    • Sorting, filtering, highlighting for tables, trees, and lists
    • Find/search
    • Auto-completion
    • Login/authentication framework
    • TreeTable component
    • Collapsible panel component
    • Date picker component
    • Tip-of-the-Day component
    Many of these features will eventually be incorporated into the Swing toolkit, although API compatibility will not be guaranteed. The SwingX project focuses exclusively on the raw components themselves.



    Demos:

    • JXTaskPane
    • JXTipOfTheDay
    • JXBusyLabel



    Downloading SwingX Lib:

    You can download it from SwingLabs Downloads Page.















    Adding SwingX Library to NetBeans IDE:

    From Tools > Libraries, Choose New Library.

















    Write the Lib Name and press OK.











    Click Add Jar/Folder.















    Go To the Downloading Dir and After extracting the Lib and choose the SwingX Jar and SwingX-BeanInfo Jar and press Add JAR/Folder.
















    If you want you may add the Source Code and the Java Doc.
    I will add the JavaDoc to benefit from the Awesome Code Completion NetBeans IDE Feature, So if you will, add the JavaDoc press JavaDoc tab and click Add ZIP/Folder.














    Choose the doc dir and press Add ZIP/Folder.
















    Click Ok to Finish Creating the SwingX Library.





























    Adding SwingX Library to your Project :

    Now we will add the SwingX Library to our project and you must make this step every time you create a project that will uses SwingX.

    Right Click on Libraries and choose Add Liberary.










    Select SwingX from Add Library window and click Add Library.























    Congrats you added the lib and now can use it's components.


    Integrating SwingX with NetBeans IDE (To use drag and drop)

    From Tools > Palette > Swing/AWT Components, press on New Category.

















    Write the Category Name and press OK.









    Select the category we created and then click Add from Library.

















    Choose SwingX lib and click Next.



























    Select All by pressing “Ctrl + A” and Press Next (You may choose some beans only, It' s up to you).



























    Choose SwingX Category and press Finish.



























    Congratulations, We made it. Thanks everybody for your time and hope that was useful, If you have any question please contact us or hit the comment button and we all here for you. 
    read more...

    Wednesday, December 9, 2009

    How to use Hibernate and MySQL Server in NetBeans IDE,The easy way.

    Want to Create a Hibernate Application using NetBeans IDE and MySQL in just 7 minutes ?!
    Well, We will learn how to add MySQL library and Hibernate library to NetBeans IDE, and how to make small application to connect Hibernate to MySQL, So stay with us.








    Contents:

    1.  Add MySQL library to NetBeans IDE.
    2.  Add Hibernate library to NetBeans IDE.
    3.  Use MySQL Server to make small table.
    4.  Make the first Hibernate application and connect it to MySQL Server.
    5.  Download Source Code.


    1- Add MySQL library to NetBeans IDE.
    • Right-click on project name choose properties
    • Click on library




    • Add library





    • Choose MySQL
    • Add the library




    2- Add Hibernate library to NetBeans IDE.





    3- Use MySQL Server to make small table




    • Install these two file the very important step
    1- setting the password ( if you have loder version and removed it you will see current root password , if not you will not see it )(hint : we use password -- 12345)






    2- Ensure that mysql server installed correctly (otherwise you must reinstall mysql)




    4-
    Make the first Hibernate application and connect it to MySQL Server.


    1. Make java application
    2. Add mysql liberary and hibernate library
    3. Build our database

    Table name student (use default schema test)



    Name
    Age
    Ahmed
    21
    Islam
    21
    Ali
    20



    4- build hibernate configuration file ( this file define you database engine ,your password , and driver that’s essentially to connect to mysql or other database engines) . configuration file is an xml file .it is name ( hibernate.cfg.xml ) . place in default package .

    right-click on default -package choose other











    Then click finish


    • Now we will explain hibernate configuration file
    5 – build java bean class . this class have fields that we name it in our database
    Every table in our database have one bean implements database fields place it in default package .








    6- now build xml file have name like the java bean class name (in our project Main ) this file named with hibernate mapping file . we use this file to assign each attribute in our bean class to each field in our database.(hint :each table in our database has java bean class and mapping file to connect each).









    - Now to begin our first project we must do the main class we will name it (insert )




    When you run the project





    Download Source Code:
    Thanks for your time and consideration and hope you enjoyed this tutorial.

    read more...

    Sunday, December 6, 2009

    How to customize NetBeans IDE, Configure Used-Memory and Look And Feel and more in just 2 Minutes

    NetBeans Performance sucks and want to give it more resources (Memory...) to perform better?!
    Want to Change the Netbeans IDE Look and Feel in just 2 minutes?!
    Did you ever un-installed the JDK Accidentally and want to reinstall only the JDK without reinstalling NetBeans IDE?!

    Well, We will do all of that and more by editing the start-up parameters with two easy methods, hope to enjoy them.


    First Method, Editing the netbeans.conf file:

    • Finding the Configuration File : At every PC with NetBeans Installed, there are two versions of the netbeans.conf file, a global and a local one.
              We can use :
      • The Global : If we want to change the settings for all users using a shared NetBeans installation,  You find it in the NetBeans installation directory:
      • The Local : If we want to make individual changes that will apply only to a specific user, You find  it in the user's userdir . 
      • 1st PS : If you cant find the userdir, you will find more about it here.
      • 2nd PS:The local file does not exist by default! If you don't see a ${userdir}/etc directory you have to create the file yourself. The easiest way to do that is to copy the global netbeans.conf file from the NetBeans installation folder to the local ${userdir}/etc folder, and then make the desired changes. 
    • Edit the netbeans.conf file : We will use the following elements at the netbeans.conf file
      • netbeans_default_options : We may use this for changing the memory configuration, changing Look and Feel, etc.
        • For Example:
        • to change the Look and Feel edit the next parameter
          • --laf LookAndFeelClassName
          • (e.g.)  --laf javax.swing.plaf.metal.MetalLookAndFeel
        • to change the font size edit the next parameter
          • --fontsize size
          • (e.g.)  --fontsize 14
        • to change the initial heap size edit the next parameter
          • -J-Xms sizeInMegaBytes
          • (e.g.)  -J-Xms128m
        • to change the maximum heap size edit the next parameter
          • -J-Xmx sizeInMegaBytes
          • (e.g.)  -J-Xmx384m
      • netbeans_jdkhome : We may use this for changing the location of the JDK which will be used to run NetBeans.
        • For Example:
        • # Default location of JDK, can be overridden by using --jdkhome dir
        • netbeans_jdkhome="C:\Program Files\Java\jdk1.6.0_13"
      • Note that :
        1. The “#” character means that the following line is a comment.
        2. IF the global and the local configurations made a conflict the :
          • The setting in the local file have the priority to be executed over the global one.
          • If you running the  IDE from command line, the command line parameters have the priority to be executed over both the local and the global configurations.

      Second Method, NetBeans Startup Settings Plugin:


      You can use this cool tool created by Claudio Miranda to edit all of this configurations easily.
      • Features :
        • Backup and restore original settings (etc/netbeans.conf).
        • Able to configure and store different JDK and NetBeans user directory.
        • Store settings (jdk and userdir) under JDK Preference API.
        • Support to on-line updates through update center.
        • LGPL license.
        • If specified userdir doesn't exist, a new one will be created.
        • Remember netbeans user and JDK directories, across different NetBeans installations.
      • Requirements :
        • JDK 5 or higher.
        • NetBeans 6.x.
        • A writable $HOME/.java/.userPrefs directory.
      • Setup :
        1. You may do an anonymous checkout, you must have subversion client installed, by invoking :
          svn co --username anonymous --password anon http://svn.javaforge.com/svn/netbeans-modules/trunk/nb-settings nb-settings
        2. Or you may download this nbm file, however this is not recommended.
      • After installing the plugin you can reach to it by going to Tools > Options > Miscellaneous, and here is the screen shot of the plugin.




















      Please feel free to contact us for more information about the post or about installing the NetBeans IDE modules.
      Hope you enjoyed the post of this day and learned a new stuff. Your comment always inspiring us and the main motivator for doing our best, So please leave your comment whatever it was, It always help.

      read more...