Developer's Daily JBuilder Education
  main | java | perl | unix | DevDirectory
   
Main Page
Java
Education
JBuilder
Articles
   

Use the TAB key in JBuilder to indent a block of code
 

Indenting code in JBuilder -- a simple process

I hate to say it, but for quite a while whenever I had to indent a block of code over two spaces, I would move from one line of code to the next, go to the beginning of the line, enter two spaces, and go on to the next line. Fortunately I don't waste my time like that anymore.


How to do it

Indenting a block of code is very easy, and works just like many other editing environments. It is a simple two step process:

That's all there is to it. One simple keystroke and the whole block of code is indented. Of course you can also press [SHIFT][TAB] when you want to move a block of code back to the left margin.

The images below show this visually. Here is what the code looks like when you first highlight it:

Step 1 -- highlight the code to be moved.
Figure 1: The desired section of code is highlighted.

Notice that the selected portion of the code is two spaces too far to the left.

 

Next, here is what the code looks like after the [TAB] key has been pressed:

Step 2 -- pressing the TAB key indents the code.
Figure 2: The selected is moved two characters to the right after the [TAB] key is pressed.

 

Notice that the code has been shifted over to line up evenly with the other code in the method. Simple to remember and a great time saver!

 

 


Copyright © 1998 DevDaily Interactive, Inc.
All Rights Reserved.