safirsyifa サフィルシファ

Faster Programming and Reverse Engineering

Posted by: safirsyifa on: January 5, 2012


Little things mean a lot

Little things mean a lot

Assalamu’alaykum.. :mrgreen:

This morning, Surabaya’s sky looks pretty clear, but maybe will be cloudy sooner or later.. Ok, because of my work recently, I would like to share some tips to code in Netbeans.. Actually, there’s so many tips to code in Netbeans, you can explore more and you may comment this post to share that.. I quote and translate some text from here:

Reduce the use of mouse or touchpad – keep your hand to focus into keyboard with minimum interuption. Keyboard shortcuts are my best friends!

Window

In Netbeans, there are so many window such as Projects, Files, Services, Output, Navigator, Palette, Properties and many more.. If you like, you just hide all of those window and show it when you need it.

You can press ctrl+1 for Projects, ctrl+2 for Files, and check out yourself from ctrl+3 till ctrl+8.

It really useful to me, maybe you will feel so.

Import

To import package or class you need to for object you use on your code,

Place your text pointer on the object code you need an import. Press shift+alt+I. There you are a list of available imports you may choose. Pick one, voila!

Or you may press shift+ctrl+I. Choose what the class needed to be import for what object. You can also remove unused imports. Press OK button, voila!

Constructor, Setter and Getter

To you who mostly code Object-Oriented Programming (OOP), you may generate setter and getter quickly with this tips.

Place the text pointer somewhere you want to insert the Setter and/or the Getter. Press alt+insert. Choose what you need to generate: Getter, Setter, or both. Choose the variable or attribute you want to get a settter and/or a getter done. Press Generate button, voila!

This is example what you will get:

private String string;

public String getString() {
return string;
}

public void setString(String string) {
this.string = string;
}

Code Completion

Netbeans is very easy with its auto-complete code. This will reduce human error to write a method or variable.

Press ctrl+space where ever you need. :mrgreen:

Code Shortcut

This is very easy to use, if you lazy to code a long code like this one:


    public static void main (String[] args){

    }

You can quickly (yes! I said quickly) write ‘psvm‘ and press tab. Or simply code like this:


    System.out.println("");

You can simply write ‘sout‘ and press tab. Or maybe code like this:


try {

} catch (Exception e) {
}

You can write ‘trycatch‘ and press tab. You can see all list of code shortcut of Netbens from Tools > Options > Editor > Code Templates. Faster programming, huh?

Find Usages

If you have a lot of class and code, and you need to find where a method have been called by another class, you may Find Usages.

Simply place your text pointer on the name of a method and press alt+f7, choose the options and the scope, click Find button, voila!

UML from your code

I’m using Netbeans 6.9.1 and I need a class diagram from the code I’ve been built. It called reverse engineering. Actually, my Netbeans version doesn’t support this module of UML (Unified Modeling Language), see this article. But I may use the module from older version of Netbeans, such as this article. It was just simply copy the ‘uml’ folder from netbeans-6.9rc2-201005312001-ml-uml.zip I’ve been downloaded from here. and you can follow the tutorial oracle here or Netbeans 5.5 tutorial here, pick one. You can produce class diagram, sequence diagram, and others diagram.

Ok, then.. Happy programming :mrgreen:

So Take a Chance and Don't Ever Look Back

So Take a Chance and Don't Ever Look Back

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Assalamu’alaykum..

Today..

Tiny Me..



Please, let me show my identity, as a writer of this blog. My name is Nur Safira Assyifa’. Except family, they call me Nur, Syifa’ or Safir. I nicknamed my self, safirsyifa. I born and grow in Surabaya.
See more here..

Quote..

2012 . 03 . 01
سْمِ اللّهِ الرَّحْمَنِ الرَّحِيْمِ

Menyebut nama Allah subhanahu wa ta'ala di kala lapang akan menambah kebahagiaan hidup kita lebih bermakna, dan di kala sempit akan mengurai derita menuju cahaya.
-- Demikian isyarat Allah subhanahu wa ta'ala dalam Al-Qur'an Surah Al-Ahzab 33:41-44

You may not be able to fall asleep, but you can be sure to dream.
-- me

It is not enough to be busy. So are the ants. The question is: What are we busy doing?
-- @IslamicThinking

Sehebat apapun ancaman manusia, tak akan jatuh sehelai rambut pun tanpa seizin Allah subhanahu wa ta'ala
-- @IslamSpeaks

A mouth may tell a lie. If heart can speak honestly.
-- @safirsyifa

Writing is a struggle against silence.
-- Carlos Fuentes

Blog Hits..

  • 37,442 people

History..



License..

Creative Commons License
safirsyifa サフィルシファ - wordpress blog by safirsyifa is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

You're required to link to this blog whenever you republish my content.