SlideShare una empresa de Scribd logo
1 de 6
Descargar para leer sin conexión
Subscribe Now for FREE! refcardz.com
                                                                                                                                                                       tech facts at your fingertips

                                        CONTENTS INCLUDE:
                                        n	
                                              About NetBeans IDE
                                              Getting NetBeans IDE

                                                                                             NetBeans IDE 6.1 Java Editor
                                        n	


                                        n	
                                              Development with NetBeans IDE
                                        	n	
                                              Keyboard Shortcuts and
                                              Code Templates
                                        n	
                                              Quick Options Windows Overview                                                         By Geertjan Wielenga and Patrick Keegan
                                        n	
                                              Hot Tips and more...



                                                ABOUT NETBEANS IDE

                                               The NetBeans IDE has seen adoption snowballing over the past                          authors intended when creating it. It lists all the keyboard shortcuts
                                               years. The icing on the cake has been the introduction of a com-                      in carefully thought out categories and it provides a thorough
                                               pletely new, rewritten, slick Java editor. You’ll find this reference                 exposition of optimal handling of Java code in the editor,
                                               card helpful if you want to get as much out of the Java editor as its                 covering viewing, navigation, source handling, and refactoring.



                                                GETTING NETBEANS IDE

                                                Go to http://download.netbeans.org/netbeans/6.1/final/

                                                NetBeans Packs*             Web & Java EE              Mobility    Java SE             Ruby            C/C++           Early Access for PHP      All

                                                Base IDE                          •                        •         •                   •                •                     •                 •
 www.dzone.com




                                                Java SE                           •                        •         •                                                                            •

                                                Web & Java EE                     •                        —                                                                                      •

                                                Mobility                                                                                                                                         —

                                                UML                                                                                                                                              —

                                                SOA                                                                                                                                               •

                                                Ruby                                                                                     •                                                        •

                                                C/C++                                                                                                     •                                       •

                                                Early Access for PHP                                                                                                            •

                                                Bundled Servers

                                                GlassFish V2 UR2                  •                                                                                                               •

                                                Apache Tomcat 6.0.16              •                                                                                                               •
NetBeans IDE 6.1 Java Editor




                                                NETBEANS IDE JAvA
                                                QUICk STArT TUTOrIAL                                                                                             Get More Refcardz
                                                                                                                                                                             (They’re free!)
                                               This tutorial provides a very simple and quick introduction to                                                      n   Authoritative content
                                               the NetBeans IDE workflow by walking you through the creation
                                                                                                                                                                   n   Designed for developers
                                               of a simple “Hello World” Java console application. Once you
                                                                                                                                                                   n   Written by top experts
                                               are done with this tutorial, you will have a general knowledge of
                                               how to create, build, and run applications in the IDE.
                                                                                                                                                                   n   Latest tools & technologies
                                                                                                                                                                   n   Hot tips & examples
                                               To follow this tutorial, you need the following software and
                                                                                                                                                                   n   Bonus content online
                                               resources:
                                                                                                                                                                   n   New issue every 1-2 weeks
                                                 Software or Resource         Version Required

                                                 NetBeans IDE                 Version 6.1 or version 6.0
                                                                                                                                                   Subscribe Now for FREE!
                                                                                                                                                        Refcardz.com
                                                 Java Developer Kit (JDK)     Version 6 or version 5



                                                                                                                  DZone, Inc.   |   www.dzone.com
2
                                                                                                                               NetBeans IDE 6.1 Java Editor
    tech facts at your fingertips




NetBeans IDE Java Quick Start Tutorial, continued                                 Navigating through Source Code
                                                                                   Ctrl-O/Alt-Shift-O             Go to type/file
1. Start NetBeans IDE. In the IDE, choose File > New Project
   (Ctrl-Shift-N).                                                                 Ctrl-Shift-T                   Go to JUnit test

                                                                                   Alt-O                          Go to source
2. In the New Project wizard, expand the Java category and
   select Java Application. Then click Next.                                       Ctrl-B                         Go to declaration

                                                                                   Ctrl-G                         Go to line
3. In the Name and Location page of the wizard, type
   quot;HelloWorldAppquot; in Project Name and type                                        Ctrl-Shift-M                   Toggle add/remove bookmark

   quot;helloworldapp.HelloWorldAppquot; in the Create Main Class                          Ctrl-Shift-Period/Comma        Next/previous bookmark
   field. Then Click finish.                                                       Ctrl-Period/Comma              Next/previous usage/compile error

4. Because you have left the Create Main Class checkbox                            Ctrl-Shift-1/2/3               Select in Projects/Files/Favorites
   selected in the New Project wizard, the IDE has created a                       Ctrl-[                         Move caret to matching bracket
   skeleton class for you. You can add the quot;HelloWorld!quot;
                                                                                   Ctrl-K/Ctrl-Shift K            Next/previous word match
   message to the skeleton code by replacing the line:
                                                                                   Alt-Left/Alt-Right/Ctrl-Q      Go backward/forward/to last edit
        // TODO code application logic here

   with the line:                                                                 Compiling, Testing, and Running
        System.out.println(quot;Hello World!quot;);                                       F9                     Compile package/ file

5. From the IDE’s menu bar, choose Run > Run Main                                 F11                    Build main project

   Project (F6). The Output window should show you the                            Shift-F11              Clean & build main project

   quot;HelloWorld!quot; message.                                                         Ctrl-Q                 Set request parameters

Congratulations! Your program works! You now know how to                          Ctrl-Shift-U           Create JUnit test
accomplish some of the most common programming tasks in                           Ctrl-F6/Alt-F6         Run JUnit test on file/project
the IDE.
                                                                                  F6/Shift-F6            Run main project/file


 kEYBOArD SHOrTCUTS & CODE TEMPLATES                                              Debugging
                                                                                   Ctrl-F5               Start debugging main project
Finding, Searching, and Replacing
                                                                                   Ctrl-Shift-F5         Start debugging current file

 Ctrl-F3                   Search word at insert point                             Ctrl-Shift-F6         Start debugging test for file (JUnit)

 F3/Shift-F3               Find next/previous in file                              Shift-F5/F5           Stop/Continue debugging session

 Ctrl-F/H                  Find/Replace in file                                    F4                    Run to cursor location in file

 Alt-F7                    Find usages                                             F7/F8                 Step into/over

                                                                                   Ctrl-F7               Step out
 Ctrl-Shift-P              Find/replace in projects
                                                                                   Ctrl-Alt-Up           Go to called method
 Alt-Shift-U               Find usages results
                                                                                   Ctrl-Alt-Down         Go to calling method
 Alt-Shift-H               Turn off search result highlights
                                                                                   Ctrl-F9               Evaluate expression
 Ctrl-R                    Rename
                                                                                   Ctrl-F8               Toggle breakpoint
 Ctrl-U, then U            Convert selection to uppercase
                                                                                   Ctrl-Shift-F8         New breakpoint
 Ctrl-U, then L            Convert selection to lowercase
                                                                                   Ctrl-Shift-F7         New watch
 Ctrl-U, then S            Toggle case of selection

 Alt-Shift-V               Paste formatted
                                                                                  Coding in Java
                                                                                  Alt-Insert                          Generate code

Opening and Toggling Between Views                                                Ctrl-Shift-I                        Fix all class imports

                                                                                  Alt-Shift-I                         Fix selected class’s import
 Ctrl-Tab (Ctrl-`)         Toggle between open documents
                                                                                  Alt-Shift-F                         Format selection
 Shift-Escape              Maximize window (toggle)
                                                                                  Alt-Shift Left/Right/Up/Down        Shift lines left/right/up/down
 Ctrl-F4/Ctrl-W            Close currently selected window
                                                                                  Ctrl-Shift-Up/D                     Copy lines up/down
 Ctrl-Shift-F4             Close all windows
                                                                                  Ctrl/Alt-F12                        Inspect members/hierarchy
 Shift-F10                 Open contextual menu                                   Ctrl-/                              Add/remove comment lines

 Alt-Shift-D               Undock window                                          Ctrl-E                              Delete current line



                                                               DZone, Inc.   |   www.dzone.com
3
                                                                                                                                           NetBeans IDE 6.1 Java Editor
      tech facts at your fingertips




Keyboard Shortcuts & Code Templates, continued                                                  Java Editor Code Templates, continued
                                                                                                 St         String
Refactoring
                                                                                                 ab         abstract
This table provides short descriptions of the refactoring
                                                                                                 bo         boolean
operations that are available in the IDE, mostly from under
                                                                                                 br         break
the Refactoring menu and within the Java editor itself,
                                                                                                 ca         catch (
when you right-click within it.
                                                                                                 cl         class
Refactoring Operation                    Description                                             cn         continue

Rename                                   Enables you to change the name of a class,              df         default:
                                         variable, or method to something more                   dowhile    do {
                                         meaningful. In addition, it updates all source
                                                                                                            } while (condition);
                                         code in your project to reference the element
                                         by its new name.                                        eq         equals

Introduce Variable,                      Enables you to generate a statement based               ex         extends
Constant, Field, or                      on the selected code and replace that block             fa         false
Method                                   of code with a call to the statement.
                                                                                                 fi         final
Change Method                            Enables you to add parameters to a method
Parameters                               and change the access modifier.                         fl         float
                                                                                                 forc       for (Iterator it = collection.iterator();
Encapsulate Fields                       Generates a getter method and and a setter
                                                                                                                it.hasNext( );) {
                                         method for a field and optionally updates all
                                         referencing code to access the field using the                        Object elem = (Object) it.next( );
                                         getter and setter methods.                                         }
                                                                                                 fore       for (Object elem : iterable) {
Pull Up                                  Moves methods and fields to a class that their
                                                                                                            }
                                         current class inherits from.
                                                                                                 fori       for (int i = 0; i < arr.length; i++) {
Push Down                                Moves inner classes, methods, and fields to all
                                                                                                            }
                                         subclasses of their current class.
                                                                                                 fy         finally
Move Class                               Moves a class to another package or into
                                         another class. In addition, all source code in          ie         interface
                                         your project is updated to reference the class          ifelse     if (condition){ }else {
                                         in its new location.                                               }
Copy Class                               Copies a class to the same or a different               im         implements
                                         package.
                                                                                                 iof        instanceof
Move Inner to Outer Level                Moves an inner class one level up in hierarchy.
                                                                                                 ir         import
Convert Anonymous                        Converts an anonymous class to an inner class           le         length
Class to Inner                           that contains a name and constructor. The
                                         anonymous inner class is replaced with a call           newo       Object name = new Object(args);
                                         to the new inner class.                                 pe         protected
Extract Interface                        Creates a new interface from the selected               pr         private
                                         public non-static methods in a class or
                                         interface.                                              psf        private static final
                                                                                                 psfb       private static final boolean
Extract Superclass                       Creates a new abstract class, changes the
                                         current class to extend the new class, and              psfi       private static final int
                                         moves the selected methods and fields to the
                                         new class.                                              psfs       private static final String
                                                                                                 pst        printStackTrace();
Use Supertype Where                      Changes code that references the selected
Possible                                 class (or other type) to instead use a                  psvm       public static void main(String[ ] args){
                                         supertype of that type.                                            }

Safely Delete                            Checks for references to a code element and             pu         public
                                         then automatically deletes that element if no           re         return
                                         other code references it.
                                                                                                 serr       System.err.println (quot;|quot;);
When typing in the Source Editor, you can generate the                                           sout       System.out.println (quot;|quot;);

text in the right-column of the following list by typing                                         st         static

the abbreviation that is listed in the left-column and then                                      sw         switch (

pressing Tab.                                                                                    sy         synchronized
                                                                                                 tds        Thread.dumpStack();
Java Editor Code Templates                                                                       th         throws

En                          Enumeration                                                          trycatch   try {}
                                                                                                             catch (Exception e) {}
Ex                          Exception
                                                                                                 tw         throw
Ob                          Object
                                                                                                 twn        throw new
Psf                         public static final
                                                                                                 wh         while (
Psfb                        public static final boolean
                                                                                                 whileit    while (it.hasNext()) {
Psfi                        public static final int
                                                                                                              Object elem = (Object) it.next();
Psfs                        public static final String                                                      }



                                                                             DZone, Inc.   |   www.dzone.com
4
                                                                                                                                                     NetBeans
                                                                                                             Published on NetBeans Zone (http://netbeans.dzone.com)     IDE 6.1 Java Editor
  tech facts at your fingertips


                                                                                                             10 Handy Editor Shortcuts in NetBeans IDE
                                                                                                             6.0
Mac OS Keyboard Shortcuts                                                                            10 Handy Editor Shortcuts, continued
                                                                                                             By geertjan
                                                                                                10 Handy Editor Shortcuts in NetBeans IDE 6.0                                                 http://netbeans.dzone.com/prin
In most cases, working with the IDE on the Mac is no different                                            Created 2008/01/16 - 10:13pm
                                                                                                        1. Move/copy up/down. Press Ctrl-Shift-Up and the current
from working on other operating systems. Two significant
                                                                                                           selectiontois copiedoncethe knowNetBeans aboveall of these are new that no some were
                                                                                                           The following are some of the many cool
                                                                                                           will be able do without, to you lines right
                                                                                                                                                                 IDE 6.0 keyboard shortcuts
                                                                                                                                                       they're there. Not the current in 6.0,
                                                                                                                                                                                              programmer
differences do exist, however. Firstly, the Options window on                                              there before, but deserveZone (http://netbeans.dzone.com) is moved instead
                                                                                                           Published on NetBeans to be highlighted because often they're overlooked.
                                                                                                           selection. Press Alt instead of Ctrl and it
the Mac is found under NetBeans > Preferences. Secondly,
                                                                                                           ofMove/copy up/down. Press Ctrl-Shift-Upof Up and the lines of code lines right
                                                                                                           1. copied. Press Down instead and the current selection is copied to the
the About box is under NetBeans > About.                                                                   above the current selection. Press Alt Shortcuts is moved instead of copied. IDE
                                                                                                           10 Handy Editor instead of Ctrl and it in NetBeans Press Down
                                                                                                           will be copied below code will be copied below the current selection, as below:
                                                                                                           instead of Up and the lines of the current selection, as below:
Scrolling and Selecting
                                                                                                             6.0
                                                                                                             By geertjan
Keys             Action                                                                                      Created 2008/01/16 - 10:13pm
Cmd-[            Moves the insertion point to the highlighted matching bracket.
                                                                                                             The following are some of the many cool NetBeans IDE 6.0 keyboard shortcuts that no programmer
                 Note that this shortcut only works when the insertion point is                              will be able to do without, once you know they're there. Not all of these are new in 6.0, some were
                 located immediately after the opening bracket.                                              there before, but deserve to be highlighted because often they're overlooked.
Cmd-Shift-[      Selects the block between a pair of brackets. Note that this shortcut                       1. Move/copy up/down. Press Ctrl-Shift-Up and the current selection is copied to the lines right
                 only works when the insertion point is located immediately after                            above the current selection. Press Alt instead of Ctrl and it is moved instead of copied. Press Down
                 either the opening or closing bracket.                                                      instead of Up and the lines of code will be copied below the current selection, as below:
                                                                                                             2. Capture inner/outer syntactic element. Each time you press Alt-Shift-Period, the selection
Ctrl-G           Jumps to any specified line.                                                           2.   Capture successively widersyntactic element. Each time you
                                                                                                             expands to a inner/outer syntactic element. For example, below one statement was selected,
                                                                                                             the key combination Alt-Shift-Period was pressed, and then the complete content of the surrounding
Cmd-A            Selects all text in the file.                                                               press Alt-Shift-Period, the selection expands to a the current statement to
                                                                                                             block statement was shown to be selected. The selection expands from succes-
                                                                                                             surrounding block statements to the surrounding method and, from there, to the surrounding class
                                                                                                             sively wider syntactic element. Forpress Alt-Shift-Comma, instead of
                                                                                                             and further. To successively narrow the selection, example, below one
Code Folding                                                                                                 statement was selected, the key combination Alt-Shift-Period
                                                                                                             Alt-Shift-Period.

Keys                       Action                                                                            was pressed, and then the complete content of the
Cmd-Minus (-)              Collapses the block of code in which the insertion point                          surrounding block statement was shown to be selected.
                           is currently located.                                                             The selection expands from the current statement to
                                                                                                             2. Capture inner/outer syntactic element. Each time you press Alt-Shift-Period, the selection
Cmd-Plus (+)               Expands the block of code which is adjacent to the                                surrounding blockwider syntactic element. Forsurrounding one statement was selected,
                                                                                                             expands to a successively statements to the example, below method
                           insertion point.                                                                  the key combination Alt-Shift-Period was pressed, and then the complete content of the surrounding
                                                                                                             and,statement was shown to be selected. The selection expands from the current statement to
                                                                                                             block from there, to the surrounding class and further.
Cmd-Shift-Minus (-)        Collapses all blocks of code in the current file.
                                                                                                             To successively narrowto the surrounding methodAlt-Shift-Comma,to the surrounding class
                                                                                                             surrounding block statements the selection, pressand, from there,
                                                                                                             and further. To successively narrow the selection, press
                                                                                                                                                                      Alt-Shift-Comma, of
                                                                                                                                                                                      instead
Cmd-Shift-Plus (+)         Expands all blocks of code in the current file.
                                                                                                             instead of Alt-Shift-Period.
                                                                                                             Alt-Shift-Period.

Cutting, Copying, Pasting, and Deleting Text
                                                                                                             3. Generate code skeletons. Whenever you want to generate commonly needed pieces of code, such
Keys                     Action
Cmd-Z                    Undo. Reverses a series of editor actions one at a time
                         (excluding Save).                                                     1 of 4                                                                                                         4/21/08 10:44

Cmd-Y                    Redo. Reverses a series of Undo commands one at a time.
Cmd-X                    Cut. Deletes the current selection and places it on the clipboard.
Cmd-C                    Copy. Copies the current selection to the clipboard.
Cmd-V                    Paste. Pastes the contents of the clipbard at the insert point.
Backspace Delete         Deletes the current selection.                                                3. Generate code skeletons. Whenevergenerate commonly needed pieces of code, such
                                                                                                          3. Generate code skeletons. Whenever you want to you want to generate
                                                                                              10 Handy Editor Shortcuts needed pieces of
                                                                                                        commonly in NetBeans IDE 6.0             code, such as constructors,               http:/
Cmd-E                    Deletes the current line.
Cmd-K                    Copies the word preceding the insertion point and then
                                                                                                1 of 4    getters, and setters, simply click Alt-Insert, and a small popup          4/21/08 10:44

                         pastes it after the insertion point (the insertion point must                    appears with agetters, items fromsimply click Alt-Insert, and a small popup appears
                                                                                                          as constructors, list of and setters, which you can select:
                         be in the whitespace preceeding or following a word).                            items from which you can select:
                         Press K multiple times to cycle through preceding words in
                         succession.
Cmd-Shift-K              Copies the word following the insertion point and pastes it at
                         the insertion point (the insertion point must be located in the       10 Handy Editor Shortcuts in NetBeans IDE 6.0                                                            http://netbeans.dzo
                         whitespace preceeding or following a word.) Press L multiple
                         times to cycle through consecutive following words.
                                                                                                             as constructors, getters, and setters, simply click Alt-Insert, and a small popup appears with a list
                                                                                                             items from which you can select:
To Change Default Settings:
1. Choose Tools > Options from the main menu.
2. For code templates, select Editor and click the Code                                                     4. Inplace rename. If you want to change a variable, method, or other item, of which
                                                                                                        4. Inplace in your code,you want to change will see that all instances of the item turn
                                                                                                            are used rename. If press Ctrl-R, and you a variable, method,
   Templates tab. Here you can also change the expansion
                                                                                                           or other item, of which more than one are used inselected item, all the other ins
                                                                                                            same time, as shown below. Now, when you change the your
   key, from Tab to something else.                                                                         at the same time, until you press Escape, at which point the inplace rename mode come
                                                                                                           code, press Ctrl-R, and you will see that all instances of the
3. For keyboard shortcuts, select Keymap and choose a                                                      item turn blue at the same time, as shown below. Now,
   profile from the Profile drop-down list.                                                                when you change you want to change a variable, method, or other item, of which more than
                                                                                                            4. Inplace rename. If the selected item, all the other instances
                                                                                                           changein your code, press Ctrl-R, andyou will see Escape, at which item turn blue at the
                                                                                                            are used at the same time, until you press that all instances of the
                                                                                                            same time, as shown below. Now, when you change the selected item, all the other instances cha
                                                                                                           pointsame time, until rename Escape, at which point the inplace rename mode comes to an end
                                                                                                            at the the inplace you press mode comes to an end.
10 HANDY EDITOr SHOrTCUTS

The following are some of the many cool NetBeans IDE 6.0
keyboard shortcuts that no programmer will be able to do                                                     5. Add/Remove comment lines. Select one or more lines, press Ctrl-/ and then the se
without, once you know they’re there. Not all of these are                                                   commented out, as shown below. Press the same keys again and the commented lines
new in 6.0, some were there before, but deserve to be                                                        be commented. This was, of course, also possible in previous releases, but previously
                                                                                                             different keyboard shortcuts, one for commenting and one for uncommenting. Now th
highlighted because often they’re overlooked.                                                                been combined into one shortcut, you can quickly toggle between comment and uncom
                                                                                                             5. Add/Remove comment lines. Select more efficient. press Ctrl-/ and then the selected lines
                                                                                                             makes this activity much faster and one or more lines,
                                                                                                             commented out, as shown below. Press the same keys again and the commented lines will no lon
                                                                               DZone, Inc.      |   www.dzone.com This was, of course, also possible in previous releases, but previously there were
                                                                                                        be commented.
                                                                                                             different keyboard shortcuts, one for commenting and one for uncommenting. Now that they hav
5
                                                                                                                                                 NetBeans IDE 6.1 Java Editor
            tech facts at your fingertips
             4. Inplace rename. If you want to change a variable, method, or other item, of which more than one
             are used in your code, press Ctrl-R, and you will see that all instances of the item turn blue at the
             same time, as shown below. Now, when you change the selected item, all the other instances change
             at the same time, until you press Escape, at which point the inplace rename mode comes to an end.
          10 Handy Editor Shortcuts, continued                                     8. Jump to last edit. Often, you find yourself in a situation
                                                                                       where you have edited in one document, while you
          5. Add/Remove comment lines. Select one or more lines,                       currently find yourself in a completely different document.
             press Ctrl-/ and then the selected lines are commented                    How do you get back to the place where you were last
             out, as shown below. Press the same keys again and the                    editing your code? That is likely to be the place where you
             commented lines will no longer be commented. This                         want to get backedit. Often, you find yourself in a situation where you hav
                                                                                        8. Jump to last to, in order to do some more editing.
                                                                                        while you currently find yourself in a completely different document. How
             was, of course, also possible in previous releases, but                   Now, whenever you click Ctrl-Q, the last edited document to be the place
                                                                                        place where you were last editing your code? That is likely
             previously there were two different keyboard shortcuts,                   is found, and the cursormore editing. Now, whenever you click Ctrl-Q, the
                                                                                        to, in order to do some lands on the line where the last
             5. Add/Remove comment lines. Select one or more lines, press Ctrl-/ and edit theand the cursorare
                                                                                       then took place. lines lands on you line wherethe button took place. Alter
                                                                                        found, selected Alternatively, the can click the last edit
             one for commenting and one for uncommenting. Now
             commented out, as shown below. Press the same keys again and the commented lines will in the top the top left of the SourceSource Editor:
                                                                                       shown below, no longer left corner corner of the Editor:
                                                                                        button shown below, in
             that they have been was, of course, also possible inyou can releases, but previously there were two
             be commented. This combined into one shortcut, previous
             quickly toggle between comment and uncomment, one for uncommenting. Now that they have
             different keyboard shortcuts, one for commenting and which
             been combined into one shortcut, you can quickly toggle between comment and uncomment, which
             makes this activity much faster and more efficient.
             makes this activity much faster and more efficient.




                                                                                                   9. Bookmarks. When you you press Ctrl-Shift-M,current line line is quot;bookma
                                                                                                      9. Bookmarks. When press Ctrl-Shift-M, the the current
             6. Inspect members/hierarchy. Both the members of the current class as well as its can later quickly cycle back/forward to it (with Ctrl-Shift-Period a
                                                                                          that you hierarchy can be
                                                                                         is “bookmarked”. What this means is that you can later
          6. Inspect members/hierarchy. Both the members of the of the current file are shown. linethe a small icon in the left sidebar, as shown below, unt
             displayed and then filtered. Press Alt-F12 and the ancestors                 bookmarked On gets
                                                                                         quickly cycle back/forward to it (with Ctrl-Shift-Period and
                                                                                          on the line again, to remove the bookmark:
             current class as well as Ctrl-F12, the current file's members are displayed, as shown here:
             other hand, if you press its hierarchy can be displayed and
                                                                                   Ctrl-Shift-Comma). The bookmarked line gets a small
           then filtered. Press Alt-F12 and the ancestors of the current           icon in the left sidebar, as shown below, until you press
                                                                         10 Handy Editor Shortcuts in NetBeans IDE 6.0
10 Handy Editor are shown. On the IDE 6.0 hand, if you press Ctrl-F12,
           file Shortcuts in NetBeans other                                        Ctrl-Shift-M on the line again, to remove the bookmark:
                                                                                           http://netbeans.dzone.com/print/280
           the current file’s members are displayed, as shown here:
                                                                                           10 Handy Editor Shortcuts in NetBeans IDE 6.0                                           http://netbeans.d
                                                                                         3 of 4

 10 Handy Editor Shortcuts in NetBeans IDE 6.0                                                            http://netbeans.dzone.com/print/280




 2 of 4                                                                                           10. 10.Highlightexitexit points.the cursor on cursor thethe return type and you will ei
                                                                                                          Highlight points. Place the cursor on on return type
                                                                                                      Highlight exit points. Place Place the
                                                                                                      points highlighted: 4/21/08 10:44 AM the return type and you will immediately see all
                                                                                                      10.
                                                                                                      pointsyou will immediately see all exit points highlighted:
                                                                                                      and highlighted:




            7. Switch between documents. When you have multiple documents open at the same time, press
          7. Ctrl and between then a small popup appears. You can scroll through the popup, which displays all
              Switch Tab, and documents. When you have multiple
              documents open at the same time, press Ctrl and Tab,
             the open documents, and then choose the document that you want to open:
              and then a small popup appears. You can scroll through
              the popup, which documents. When you have multiple and
              7. Switch between displays all the open documents, documents open at the same time, press
              Ctrl and Tab, and then a small popup appears. You can scroll through the popup, which displays all
              then choose the document choose thewant to open: you want to open:
              the open documents, and then that you document that
                                                                                                      Source URL: http://netbeans.dzone.com/news/10-handy-editor-shortcuts-netbeans-ide-60
                                                                                                    QUICk OPTIONS WINDOW OvErvIEW

                                                                                                   The Options window lets you customize NetBeans IDE in a
                                                                                                   number of URL: Most people don’t know how much can be
                                                                                                     Source ways. http://netbeans.dzone.com/news/10-handy-editor-shortcuts-n
                                                                                                   customized there. The table below provides an overview.

                                                                                        General
            8. Jump to last edit. Often, you find yourself in a situation where you have edited inSets the IDE-wide browser and the
                                                                                                        one document,                                       Web Browser
                                                                                                                                                          n		


                                                                                                       proxy settings.                                      Proxy Settings
                                                                                                                                                          n		

            while you currently find yourself in a completely different document. How do you get back to the
            place where you were last editing your code? That is likely to be the place where you Sets theto get back options,
                                                                                        Editor         want editor-specific                               n		Code Folding
            to, in order to do some more editing. Now, whenever you click Ctrl-Q, the last edited specifically those relating to code
                                                                                                        document is                                       n		Code Completion
             8. Jump tothe cursorOften, on the line where the last edit where you Alternatively, you can click the
                    and last edit. lands you in a completely different document. How do you in back to theindentation, code templates,
            found,you currently find yourselffind yourself in a situation took place.have editedget onefolding, code completion, camel case
                                                                                                        document,                                         n		Camel Case Behavior
             while                                                                                     behavior,                                          n		Indentation

            buttonwhere you were in the top left corner of the is likely Editor: place where you want tomacros.
             place  shown below, last editing your code? That Source to be the                         and get back                                       n		Code Templates


                           Source URL:
             to, in order to do some more editing. Now, whenever you click Ctrl-Q, the last edited document is
                                                                                                                                                          n		Macros




                FYI        http://netbeans.dzone.com/news/10-handy-
             found, and the cursor lands on the line where the last edit took place. Alternatively, you can click the
                                                                                           Java Code      Sets options specifically for the Java          n		Formatting
             button shown below, in the top left corner of the Source Editor:                             editor, relating to the formatting, hints,         Hints
                           editor-shortcuts-netbeans-ide-60
                                                                                                                                                          n		


                                                                                                                     mark occurrences, and task list.     n		Mark Occurrences


                                                                                                                                                          n		Tasklist




                                                                             DZone, Inc.    |   www.dzone.com
6
                                                                                                                                                                                             NetBeans IDE 6.1 Java Editor
              tech facts at your fingertips




        Quick Options Window Overview, continued
                                                                                                                                    rESOUrCES
         Fonts & Colors         Sets the fonts and colors for syntax,                n		Syntax
                                highlighting, annotations, and diff                  n		Highlighting


                                viewer.                                              n		Annotations                                Resource                                 URL
                                                                                     n		Diff

                                                                                                                                   NetBeans DZone                           http://netbeans.dzone.com/
         Keymap                 Sets the keyboard profile to be used                 n		NetBeans Profile                           Community
                                throughout the IDE. By default, profiles             n		Eclipse Profile


                                are provided for NetBeans, Eclipse,                  n		Emacs Profile
                                                                                                                                   NetBeans Tutorials                       http://www.netbeans.org/kb/index.html
                                and Emacs. A legacy profile is also                  n		NetBeans 5.5 Profile
                                                                                                                                   NetBeans Video Tutorials                 http://www.netbeans.org/kb/60/screencasts.html
                                provided, for NetBeans 5.5 keyboard
                                shortcuts, which were radically                                                                    NetBeans Blogs                           http://planetnetbeans.org/
                                rewritten in NetBeans IDE 6.0.
                                                                                                                                   NetBeans TV                              http://netbeans.tv/
         Miscellaneous          Sets the options for Ant processing,                 n		Ant
                                appearance, diffing, the Matisse GUI                 n		Appearance                                 NetBeans Weekly                          http://www.netbeans.org/community/news/newsletter/
                                Builder, JavaScript, Profiler, ToDo Tasks,           n		Diff                                       Newsletter:                              latest.html
                                and Versioning.                                      n		GUI Builder


                                                                                     n		Profiler


                                                                                     n		ToDo Tasks
                                                                                                                                 Thanks to the following people who kindly gave of their time
                                                                                     n		JavaScript
                                                                                                                                 and expertise in reviewing this refcard: Adam Bien, Tonny Kohar,
                                                                                     n		Versioning

                                                                                                                                 Varun Nischal, Kristian Rink, and Tom Wheeler.




  ABOUT THE AUTHOrS                                                                                     rECOMMENDED BOOkS

                   Geertjan Wielenga is the NetBeans technical                                                                         Rich Client Programming                                           Pro NetBeans IDE 6 Rich
                   writer responsible for documentation related to                                                                     will help you get started                                         Client Platform Edition fo-
                   the NetBeans Java editor. He is a co-author of                                                                      with NetBeans module                                              cuses on the new features
                   the book Rich Client Programming: Plugging                                                                          development, master                                               of NetBeans 6 as well as
                   into the NetBeans Platform. He is known for his                                                                     NetBeans’ key APIs, and                                           what has changed since
                   popular blog at http://blogs.sun.com/geertjan,                                                                      learn proven techniques                                           NetBeans 5.5, empowering
  as well as for his role as a Zone Leader at Javalobby.                                                                               for building reliable                                             you to be a more effective
                                                                                                                                       desktop software.                                                 and productive developer.
                         Patrick Keegan has been writing about the
                         NetBeans IDE for over 9 years. In addition to
                         writing help and tutorials, he is co-author of                                                                                             BUY NOW
                         the NetBeans IDE Field Guide and has contrib-                                                                   books.dzone.com/books/richclientprog
                         uted to other books on NetBeans and Java.                                                                        books.dzone.com/books/pronetbeans



  Want More? Download Now. Subscribe at refcardz.com
  Upcoming Refcardz:                                          Available:
  n   	 Ruby                                                  Published June 2008
  n   		Groovy                                                n   	 jQuerySelectors                                                                                                FrEE
  n   		Core .NET                                             n   	 Design Patterns
  n   		Adobe Flex                                            n   	 Flexible Rails: Flex 3 on Rails 2
  n   		Apache Struts 2
                                                              Published May 2008
      	 C#
                                                                  	 Windows PowerShell
  n
                                                              n




  Available:                                                  n   	 Dependency Injection in EJB 3
  Published July 2008                                         Published April 2008
  n   		RSS and Atom                                          n   	 Spring Configuration
  n   		GlassFish Application Server                          n   	 Getting Started with Eclipse                                                                                                    GWT Style, Configuration
  n   		Silverlight 2                                                                                                              Getting Started with Ajax                                            and JSNI Reference
  n   		IntelliJ IDEA                                                                                                              Published April 2008                                                     Published April 2008



                                                                                                                            DZone, Inc.
                                                                                                                            1251 NW Maynard
                                                                                                                                                                                             ISBN-13: 978-1-934238-13-4
                                                                                                                            Cary, NC 27513
                                                                                                                                                                                             ISBN-10: 1-934238-13-9
                                                                                                                                                                                                                         50795
                                                                                                                            888.678.0399
DZone communities deliver over 3.5 million pages per month to                                                               919.678.0300
more than 1.5 million software developers, architects and designers.
                                                                                                                            Refcardz Feedback Welcome
DZone offers something for every developer, including news,                                                                 refcardz@dzone.com
                                                                                                                                                                                                                                       $7.95




tutorials, blogs, cheatsheets, feature articles, source code and more.                                                      Sponsorship Opportunities                                     9 781934 238134
“DZone is a developer’s dream,” says PC Magazine.                                                                           sales@dzone.com

Copyright © 2008 DZone, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical,
                                                                                                                                                                                                                        Version 1.0
photocopying, or otherwise, without prior written permission of the publisher.

Más contenido relacionado

La actualidad más candente

Introduction to Enterprise JavaBeans
Introduction to Enterprise JavaBeansIntroduction to Enterprise JavaBeans
Introduction to Enterprise JavaBeansPasqualino Imbemba
 
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...Fabien Potencier
 
JavaOne 2012 CON3978 Scripting Languages on the JVM
JavaOne 2012 CON3978 Scripting Languages on the JVMJavaOne 2012 CON3978 Scripting Languages on the JVM
JavaOne 2012 CON3978 Scripting Languages on the JVMPaulThwaite
 
Web Application Architecture
Web Application ArchitectureWeb Application Architecture
Web Application ArchitectureAbhishek Chikane
 
UKLUG - Open The Toolbox - Tools for the Domino Developer
UKLUG - Open The Toolbox - Tools for the Domino DeveloperUKLUG - Open The Toolbox - Tools for the Domino Developer
UKLUG - Open The Toolbox - Tools for the Domino DeveloperKathy Brown
 
Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)François Le Droff
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptBryan Basham
 
Workshop OSGI PPT
Workshop OSGI PPTWorkshop OSGI PPT
Workshop OSGI PPTSummer Lu
 

La actualidad más candente (9)

Introduction to Enterprise JavaBeans
Introduction to Enterprise JavaBeansIntroduction to Enterprise JavaBeans
Introduction to Enterprise JavaBeans
 
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
 
JavaOne 2012 CON3978 Scripting Languages on the JVM
JavaOne 2012 CON3978 Scripting Languages on the JVMJavaOne 2012 CON3978 Scripting Languages on the JVM
JavaOne 2012 CON3978 Scripting Languages on the JVM
 
Web Application Architecture
Web Application ArchitectureWeb Application Architecture
Web Application Architecture
 
BeJUG JavaFx In Practice
BeJUG JavaFx In PracticeBeJUG JavaFx In Practice
BeJUG JavaFx In Practice
 
UKLUG - Open The Toolbox - Tools for the Domino Developer
UKLUG - Open The Toolbox - Tools for the Domino DeveloperUKLUG - Open The Toolbox - Tools for the Domino Developer
UKLUG - Open The Toolbox - Tools for the Domino Developer
 
Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Workshop OSGI PPT
Workshop OSGI PPTWorkshop OSGI PPT
Workshop OSGI PPT
 

Destacado

Php Online Final
Php Online FinalPhp Online Final
Php Online Finalreynolds
 
Jo soc Duchamp!!
Jo soc Duchamp!!Jo soc Duchamp!!
Jo soc Duchamp!!mperez84
 
Los AboríGenes4
Los AboríGenes4Los AboríGenes4
Los AboríGenes4sanrafael
 
Profil Kanreg x BKN Denpasar
Profil Kanreg x BKN DenpasarProfil Kanreg x BKN Denpasar
Profil Kanreg x BKN DenpasarHerdian Rama
 

Destacado (6)

Php Online Final
Php Online FinalPhp Online Final
Php Online Final
 
Jo soc Duchamp!!
Jo soc Duchamp!!Jo soc Duchamp!!
Jo soc Duchamp!!
 
Ppt
PptPpt
Ppt
 
Glever Ami Off
Glever Ami OffGlever Ami Off
Glever Ami Off
 
Los AboríGenes4
Los AboríGenes4Los AboríGenes4
Los AboríGenes4
 
Profil Kanreg x BKN Denpasar
Profil Kanreg x BKN DenpasarProfil Kanreg x BKN Denpasar
Profil Kanreg x BKN Denpasar
 

Similar a NetBeans IDE 6.1 Java Editor Guide

The Beginning - Jan 20 2009
The Beginning - Jan 20 2009The Beginning - Jan 20 2009
The Beginning - Jan 20 2009Abhishek Mishra
 
Conquering Gef Part2: Building graphical web-apps with Eclipse
Conquering Gef Part2: Building graphical web-apps with EclipseConquering Gef Part2: Building graphical web-apps with Eclipse
Conquering Gef Part2: Building graphical web-apps with EclipseVineet Sinha
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SEdogangoko
 
Rails in the Cloud
Rails in the CloudRails in the Cloud
Rails in the Cloudiwarshak
 
Pstrong Cybera 29 Sept 2008
Pstrong Cybera 29 Sept 2008Pstrong Cybera 29 Sept 2008
Pstrong Cybera 29 Sept 2008Cybera Inc.
 
Ajax World Oracle Ria
Ajax World Oracle RiaAjax World Oracle Ria
Ajax World Oracle Riarajivmordani
 
Javascript Dependency Management
Javascript Dependency ManagementJavascript Dependency Management
Javascript Dependency ManagementSean Duncan
 
P2, the new Eclipse provisioning system
P2, the new Eclipse provisioning systemP2, the new Eclipse provisioning system
P2, the new Eclipse provisioning systemBenjamin Cabé
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?jbandi
 
Wicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On TimeWicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On TimeWill Hoover
 
Why Memcached?
Why Memcached?Why Memcached?
Why Memcached?Gear6
 
090309 Rgam Presentatie Evernote And Tarpipe Final
090309   Rgam   Presentatie Evernote And Tarpipe Final090309   Rgam   Presentatie Evernote And Tarpipe Final
090309 Rgam Presentatie Evernote And Tarpipe Finalgebbetje
 
Deployment with Ruby on Rails
Deployment with Ruby on RailsDeployment with Ruby on Rails
Deployment with Ruby on RailsJonathan Weiss
 

Similar a NetBeans IDE 6.1 Java Editor Guide (20)

The Beginning - Jan 20 2009
The Beginning - Jan 20 2009The Beginning - Jan 20 2009
The Beginning - Jan 20 2009
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
 
Conquering Gef Part2: Building graphical web-apps with Eclipse
Conquering Gef Part2: Building graphical web-apps with EclipseConquering Gef Part2: Building graphical web-apps with Eclipse
Conquering Gef Part2: Building graphical web-apps with Eclipse
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SE
 
L R U G - JRuby
L R U G - JRubyL R U G - JRuby
L R U G - JRuby
 
Rails in the Cloud
Rails in the CloudRails in the Cloud
Rails in the Cloud
 
Why Java
Why JavaWhy Java
Why Java
 
Pstrong Cybera 29 Sept 2008
Pstrong Cybera 29 Sept 2008Pstrong Cybera 29 Sept 2008
Pstrong Cybera 29 Sept 2008
 
Ajax World Oracle Ria
Ajax World Oracle RiaAjax World Oracle Ria
Ajax World Oracle Ria
 
Javascript Dependency Management
Javascript Dependency ManagementJavascript Dependency Management
Javascript Dependency Management
 
P2, the new Eclipse provisioning system
P2, the new Eclipse provisioning systemP2, the new Eclipse provisioning system
P2, the new Eclipse provisioning system
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
iPhone & Java Web Services
iPhone & Java Web ServicesiPhone & Java Web Services
iPhone & Java Web Services
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
 
Real World Technologies
Real World TechnologiesReal World Technologies
Real World Technologies
 
Wicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On TimeWicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On Time
 
Single Sourcing
Single SourcingSingle Sourcing
Single Sourcing
 
Why Memcached?
Why Memcached?Why Memcached?
Why Memcached?
 
090309 Rgam Presentatie Evernote And Tarpipe Final
090309   Rgam   Presentatie Evernote And Tarpipe Final090309   Rgam   Presentatie Evernote And Tarpipe Final
090309 Rgam Presentatie Evernote And Tarpipe Final
 
Deployment with Ruby on Rails
Deployment with Ruby on RailsDeployment with Ruby on Rails
Deployment with Ruby on Rails
 

Más de reynolds

Three Thing In The Life
Three Thing In The LifeThree Thing In The Life
Three Thing In The Lifereynolds
 
Snake Catchers In Africa
Snake Catchers In AfricaSnake Catchers In Africa
Snake Catchers In Africareynolds
 
Tsunami Before & After
Tsunami Before & AfterTsunami Before & After
Tsunami Before & Afterreynolds
 
America chooses barack obama
America chooses barack obamaAmerica chooses barack obama
America chooses barack obamareynolds
 
Obama Biden
Obama BidenObama Biden
Obama Bidenreynolds
 
Vote For The Barack Obama
Vote For The Barack ObamaVote For The Barack Obama
Vote For The Barack Obamareynolds
 
Barack Obama
Barack ObamaBarack Obama
Barack Obamareynolds
 
Vote For Change
Vote For ChangeVote For Change
Vote For Changereynolds
 
Barack Obama
Barack ObamaBarack Obama
Barack Obamareynolds
 
ObamaShirts
ObamaShirtsObamaShirts
ObamaShirtsreynolds
 
Obama+Presidential+Seal
Obama+Presidential+SealObama+Presidential+Seal
Obama+Presidential+Sealreynolds
 
Barack Obama Phots Gallery
Barack Obama Phots GalleryBarack Obama Phots Gallery
Barack Obama Phots Galleryreynolds
 
Barack Obama
Barack ObamaBarack Obama
Barack Obamareynolds
 
Canstruction
CanstructionCanstruction
Canstructionreynolds
 
Some Of The Beautiful Temples Of The World
Some Of The Beautiful Temples Of The WorldSome Of The Beautiful Temples Of The World
Some Of The Beautiful Temples Of The Worldreynolds
 
Learn to live
Learn to liveLearn to live
Learn to livereynolds
 
MANAGING RISK IN INTERNATIONAL BUSINESS
MANAGING RISK IN INTERNATIONAL BUSINESSMANAGING RISK IN INTERNATIONAL BUSINESS
MANAGING RISK IN INTERNATIONAL BUSINESSreynolds
 
Artistic Airplanes
Artistic AirplanesArtistic Airplanes
Artistic Airplanesreynolds
 
America The Beautiful
America The BeautifulAmerica The Beautiful
America The Beautifulreynolds
 

Más de reynolds (20)

Three Thing In The Life
Three Thing In The LifeThree Thing In The Life
Three Thing In The Life
 
Snake Catchers In Africa
Snake Catchers In AfricaSnake Catchers In Africa
Snake Catchers In Africa
 
Tsunami Before & After
Tsunami Before & AfterTsunami Before & After
Tsunami Before & After
 
America chooses barack obama
America chooses barack obamaAmerica chooses barack obama
America chooses barack obama
 
Obama Biden
Obama BidenObama Biden
Obama Biden
 
Vote For The Barack Obama
Vote For The Barack ObamaVote For The Barack Obama
Vote For The Barack Obama
 
Barack Obama
Barack ObamaBarack Obama
Barack Obama
 
Vote For Change
Vote For ChangeVote For Change
Vote For Change
 
Barack Obama
Barack ObamaBarack Obama
Barack Obama
 
ObamaShirts
ObamaShirtsObamaShirts
ObamaShirts
 
Obama+Presidential+Seal
Obama+Presidential+SealObama+Presidential+Seal
Obama+Presidential+Seal
 
Barack Obama Phots Gallery
Barack Obama Phots GalleryBarack Obama Phots Gallery
Barack Obama Phots Gallery
 
Barack Obama
Barack ObamaBarack Obama
Barack Obama
 
Canstruction
CanstructionCanstruction
Canstruction
 
Some Of The Beautiful Temples Of The World
Some Of The Beautiful Temples Of The WorldSome Of The Beautiful Temples Of The World
Some Of The Beautiful Temples Of The World
 
Learn to live
Learn to liveLearn to live
Learn to live
 
MANAGING RISK IN INTERNATIONAL BUSINESS
MANAGING RISK IN INTERNATIONAL BUSINESSMANAGING RISK IN INTERNATIONAL BUSINESS
MANAGING RISK IN INTERNATIONAL BUSINESS
 
Artistic Airplanes
Artistic AirplanesArtistic Airplanes
Artistic Airplanes
 
America The Beautiful
America The BeautifulAmerica The Beautiful
America The Beautiful
 
Good Life
Good LifeGood Life
Good Life
 

Último

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

NetBeans IDE 6.1 Java Editor Guide

  • 1. Subscribe Now for FREE! refcardz.com tech facts at your fingertips CONTENTS INCLUDE: n About NetBeans IDE Getting NetBeans IDE NetBeans IDE 6.1 Java Editor n n Development with NetBeans IDE n Keyboard Shortcuts and Code Templates n Quick Options Windows Overview By Geertjan Wielenga and Patrick Keegan n Hot Tips and more... ABOUT NETBEANS IDE The NetBeans IDE has seen adoption snowballing over the past authors intended when creating it. It lists all the keyboard shortcuts years. The icing on the cake has been the introduction of a com- in carefully thought out categories and it provides a thorough pletely new, rewritten, slick Java editor. You’ll find this reference exposition of optimal handling of Java code in the editor, card helpful if you want to get as much out of the Java editor as its covering viewing, navigation, source handling, and refactoring. GETTING NETBEANS IDE Go to http://download.netbeans.org/netbeans/6.1/final/ NetBeans Packs* Web & Java EE Mobility Java SE Ruby C/C++ Early Access for PHP All Base IDE • • • • • • • www.dzone.com Java SE • • • • Web & Java EE • — • Mobility — UML — SOA • Ruby • • C/C++ • • Early Access for PHP • Bundled Servers GlassFish V2 UR2 • • Apache Tomcat 6.0.16 • • NetBeans IDE 6.1 Java Editor NETBEANS IDE JAvA QUICk STArT TUTOrIAL Get More Refcardz (They’re free!) This tutorial provides a very simple and quick introduction to n Authoritative content the NetBeans IDE workflow by walking you through the creation n Designed for developers of a simple “Hello World” Java console application. Once you n Written by top experts are done with this tutorial, you will have a general knowledge of how to create, build, and run applications in the IDE. n Latest tools & technologies n Hot tips & examples To follow this tutorial, you need the following software and n Bonus content online resources: n New issue every 1-2 weeks Software or Resource Version Required NetBeans IDE Version 6.1 or version 6.0 Subscribe Now for FREE! Refcardz.com Java Developer Kit (JDK) Version 6 or version 5 DZone, Inc. | www.dzone.com
  • 2. 2 NetBeans IDE 6.1 Java Editor tech facts at your fingertips NetBeans IDE Java Quick Start Tutorial, continued Navigating through Source Code Ctrl-O/Alt-Shift-O Go to type/file 1. Start NetBeans IDE. In the IDE, choose File > New Project (Ctrl-Shift-N). Ctrl-Shift-T Go to JUnit test Alt-O Go to source 2. In the New Project wizard, expand the Java category and select Java Application. Then click Next. Ctrl-B Go to declaration Ctrl-G Go to line 3. In the Name and Location page of the wizard, type quot;HelloWorldAppquot; in Project Name and type Ctrl-Shift-M Toggle add/remove bookmark quot;helloworldapp.HelloWorldAppquot; in the Create Main Class Ctrl-Shift-Period/Comma Next/previous bookmark field. Then Click finish. Ctrl-Period/Comma Next/previous usage/compile error 4. Because you have left the Create Main Class checkbox Ctrl-Shift-1/2/3 Select in Projects/Files/Favorites selected in the New Project wizard, the IDE has created a Ctrl-[ Move caret to matching bracket skeleton class for you. You can add the quot;HelloWorld!quot; Ctrl-K/Ctrl-Shift K Next/previous word match message to the skeleton code by replacing the line: Alt-Left/Alt-Right/Ctrl-Q Go backward/forward/to last edit // TODO code application logic here with the line: Compiling, Testing, and Running System.out.println(quot;Hello World!quot;); F9 Compile package/ file 5. From the IDE’s menu bar, choose Run > Run Main F11 Build main project Project (F6). The Output window should show you the Shift-F11 Clean & build main project quot;HelloWorld!quot; message. Ctrl-Q Set request parameters Congratulations! Your program works! You now know how to Ctrl-Shift-U Create JUnit test accomplish some of the most common programming tasks in Ctrl-F6/Alt-F6 Run JUnit test on file/project the IDE. F6/Shift-F6 Run main project/file kEYBOArD SHOrTCUTS & CODE TEMPLATES Debugging Ctrl-F5 Start debugging main project Finding, Searching, and Replacing Ctrl-Shift-F5 Start debugging current file Ctrl-F3 Search word at insert point Ctrl-Shift-F6 Start debugging test for file (JUnit) F3/Shift-F3 Find next/previous in file Shift-F5/F5 Stop/Continue debugging session Ctrl-F/H Find/Replace in file F4 Run to cursor location in file Alt-F7 Find usages F7/F8 Step into/over Ctrl-F7 Step out Ctrl-Shift-P Find/replace in projects Ctrl-Alt-Up Go to called method Alt-Shift-U Find usages results Ctrl-Alt-Down Go to calling method Alt-Shift-H Turn off search result highlights Ctrl-F9 Evaluate expression Ctrl-R Rename Ctrl-F8 Toggle breakpoint Ctrl-U, then U Convert selection to uppercase Ctrl-Shift-F8 New breakpoint Ctrl-U, then L Convert selection to lowercase Ctrl-Shift-F7 New watch Ctrl-U, then S Toggle case of selection Alt-Shift-V Paste formatted Coding in Java Alt-Insert Generate code Opening and Toggling Between Views Ctrl-Shift-I Fix all class imports Alt-Shift-I Fix selected class’s import Ctrl-Tab (Ctrl-`) Toggle between open documents Alt-Shift-F Format selection Shift-Escape Maximize window (toggle) Alt-Shift Left/Right/Up/Down Shift lines left/right/up/down Ctrl-F4/Ctrl-W Close currently selected window Ctrl-Shift-Up/D Copy lines up/down Ctrl-Shift-F4 Close all windows Ctrl/Alt-F12 Inspect members/hierarchy Shift-F10 Open contextual menu Ctrl-/ Add/remove comment lines Alt-Shift-D Undock window Ctrl-E Delete current line DZone, Inc. | www.dzone.com
  • 3. 3 NetBeans IDE 6.1 Java Editor tech facts at your fingertips Keyboard Shortcuts & Code Templates, continued Java Editor Code Templates, continued St String Refactoring ab abstract This table provides short descriptions of the refactoring bo boolean operations that are available in the IDE, mostly from under br break the Refactoring menu and within the Java editor itself, ca catch ( when you right-click within it. cl class Refactoring Operation Description cn continue Rename Enables you to change the name of a class, df default: variable, or method to something more dowhile do { meaningful. In addition, it updates all source } while (condition); code in your project to reference the element by its new name. eq equals Introduce Variable, Enables you to generate a statement based ex extends Constant, Field, or on the selected code and replace that block fa false Method of code with a call to the statement. fi final Change Method Enables you to add parameters to a method Parameters and change the access modifier. fl float forc for (Iterator it = collection.iterator(); Encapsulate Fields Generates a getter method and and a setter it.hasNext( );) { method for a field and optionally updates all referencing code to access the field using the Object elem = (Object) it.next( ); getter and setter methods. } fore for (Object elem : iterable) { Pull Up Moves methods and fields to a class that their } current class inherits from. fori for (int i = 0; i < arr.length; i++) { Push Down Moves inner classes, methods, and fields to all } subclasses of their current class. fy finally Move Class Moves a class to another package or into another class. In addition, all source code in ie interface your project is updated to reference the class ifelse if (condition){ }else { in its new location. } Copy Class Copies a class to the same or a different im implements package. iof instanceof Move Inner to Outer Level Moves an inner class one level up in hierarchy. ir import Convert Anonymous Converts an anonymous class to an inner class le length Class to Inner that contains a name and constructor. The anonymous inner class is replaced with a call newo Object name = new Object(args); to the new inner class. pe protected Extract Interface Creates a new interface from the selected pr private public non-static methods in a class or interface. psf private static final psfb private static final boolean Extract Superclass Creates a new abstract class, changes the current class to extend the new class, and psfi private static final int moves the selected methods and fields to the new class. psfs private static final String pst printStackTrace(); Use Supertype Where Changes code that references the selected Possible class (or other type) to instead use a psvm public static void main(String[ ] args){ supertype of that type. } Safely Delete Checks for references to a code element and pu public then automatically deletes that element if no re return other code references it. serr System.err.println (quot;|quot;); When typing in the Source Editor, you can generate the sout System.out.println (quot;|quot;); text in the right-column of the following list by typing st static the abbreviation that is listed in the left-column and then sw switch ( pressing Tab. sy synchronized tds Thread.dumpStack(); Java Editor Code Templates th throws En Enumeration trycatch try {} catch (Exception e) {} Ex Exception tw throw Ob Object twn throw new Psf public static final wh while ( Psfb public static final boolean whileit while (it.hasNext()) { Psfi public static final int Object elem = (Object) it.next(); Psfs public static final String } DZone, Inc. | www.dzone.com
  • 4. 4 NetBeans Published on NetBeans Zone (http://netbeans.dzone.com) IDE 6.1 Java Editor tech facts at your fingertips 10 Handy Editor Shortcuts in NetBeans IDE 6.0 Mac OS Keyboard Shortcuts 10 Handy Editor Shortcuts, continued By geertjan 10 Handy Editor Shortcuts in NetBeans IDE 6.0 http://netbeans.dzone.com/prin In most cases, working with the IDE on the Mac is no different Created 2008/01/16 - 10:13pm 1. Move/copy up/down. Press Ctrl-Shift-Up and the current from working on other operating systems. Two significant selectiontois copiedoncethe knowNetBeans aboveall of these are new that no some were The following are some of the many cool will be able do without, to you lines right IDE 6.0 keyboard shortcuts they're there. Not the current in 6.0, programmer differences do exist, however. Firstly, the Options window on there before, but deserveZone (http://netbeans.dzone.com) is moved instead Published on NetBeans to be highlighted because often they're overlooked. selection. Press Alt instead of Ctrl and it the Mac is found under NetBeans > Preferences. Secondly, ofMove/copy up/down. Press Ctrl-Shift-Upof Up and the lines of code lines right 1. copied. Press Down instead and the current selection is copied to the the About box is under NetBeans > About. above the current selection. Press Alt Shortcuts is moved instead of copied. IDE 10 Handy Editor instead of Ctrl and it in NetBeans Press Down will be copied below code will be copied below the current selection, as below: instead of Up and the lines of the current selection, as below: Scrolling and Selecting 6.0 By geertjan Keys Action Created 2008/01/16 - 10:13pm Cmd-[ Moves the insertion point to the highlighted matching bracket. The following are some of the many cool NetBeans IDE 6.0 keyboard shortcuts that no programmer Note that this shortcut only works when the insertion point is will be able to do without, once you know they're there. Not all of these are new in 6.0, some were located immediately after the opening bracket. there before, but deserve to be highlighted because often they're overlooked. Cmd-Shift-[ Selects the block between a pair of brackets. Note that this shortcut 1. Move/copy up/down. Press Ctrl-Shift-Up and the current selection is copied to the lines right only works when the insertion point is located immediately after above the current selection. Press Alt instead of Ctrl and it is moved instead of copied. Press Down either the opening or closing bracket. instead of Up and the lines of code will be copied below the current selection, as below: 2. Capture inner/outer syntactic element. Each time you press Alt-Shift-Period, the selection Ctrl-G Jumps to any specified line. 2. Capture successively widersyntactic element. Each time you expands to a inner/outer syntactic element. For example, below one statement was selected, the key combination Alt-Shift-Period was pressed, and then the complete content of the surrounding Cmd-A Selects all text in the file. press Alt-Shift-Period, the selection expands to a the current statement to block statement was shown to be selected. The selection expands from succes- surrounding block statements to the surrounding method and, from there, to the surrounding class sively wider syntactic element. Forpress Alt-Shift-Comma, instead of and further. To successively narrow the selection, example, below one Code Folding statement was selected, the key combination Alt-Shift-Period Alt-Shift-Period. Keys Action was pressed, and then the complete content of the Cmd-Minus (-) Collapses the block of code in which the insertion point surrounding block statement was shown to be selected. is currently located. The selection expands from the current statement to 2. Capture inner/outer syntactic element. Each time you press Alt-Shift-Period, the selection Cmd-Plus (+) Expands the block of code which is adjacent to the surrounding blockwider syntactic element. Forsurrounding one statement was selected, expands to a successively statements to the example, below method insertion point. the key combination Alt-Shift-Period was pressed, and then the complete content of the surrounding and,statement was shown to be selected. The selection expands from the current statement to block from there, to the surrounding class and further. Cmd-Shift-Minus (-) Collapses all blocks of code in the current file. To successively narrowto the surrounding methodAlt-Shift-Comma,to the surrounding class surrounding block statements the selection, pressand, from there, and further. To successively narrow the selection, press Alt-Shift-Comma, of instead Cmd-Shift-Plus (+) Expands all blocks of code in the current file. instead of Alt-Shift-Period. Alt-Shift-Period. Cutting, Copying, Pasting, and Deleting Text 3. Generate code skeletons. Whenever you want to generate commonly needed pieces of code, such Keys Action Cmd-Z Undo. Reverses a series of editor actions one at a time (excluding Save). 1 of 4 4/21/08 10:44 Cmd-Y Redo. Reverses a series of Undo commands one at a time. Cmd-X Cut. Deletes the current selection and places it on the clipboard. Cmd-C Copy. Copies the current selection to the clipboard. Cmd-V Paste. Pastes the contents of the clipbard at the insert point. Backspace Delete Deletes the current selection. 3. Generate code skeletons. Whenevergenerate commonly needed pieces of code, such 3. Generate code skeletons. Whenever you want to you want to generate 10 Handy Editor Shortcuts needed pieces of commonly in NetBeans IDE 6.0 code, such as constructors, http:/ Cmd-E Deletes the current line. Cmd-K Copies the word preceding the insertion point and then 1 of 4 getters, and setters, simply click Alt-Insert, and a small popup 4/21/08 10:44 pastes it after the insertion point (the insertion point must appears with agetters, items fromsimply click Alt-Insert, and a small popup appears as constructors, list of and setters, which you can select: be in the whitespace preceeding or following a word). items from which you can select: Press K multiple times to cycle through preceding words in succession. Cmd-Shift-K Copies the word following the insertion point and pastes it at the insertion point (the insertion point must be located in the 10 Handy Editor Shortcuts in NetBeans IDE 6.0 http://netbeans.dzo whitespace preceeding or following a word.) Press L multiple times to cycle through consecutive following words. as constructors, getters, and setters, simply click Alt-Insert, and a small popup appears with a list items from which you can select: To Change Default Settings: 1. Choose Tools > Options from the main menu. 2. For code templates, select Editor and click the Code 4. Inplace rename. If you want to change a variable, method, or other item, of which 4. Inplace in your code,you want to change will see that all instances of the item turn are used rename. If press Ctrl-R, and you a variable, method, Templates tab. Here you can also change the expansion or other item, of which more than one are used inselected item, all the other ins same time, as shown below. Now, when you change the your key, from Tab to something else. at the same time, until you press Escape, at which point the inplace rename mode come code, press Ctrl-R, and you will see that all instances of the 3. For keyboard shortcuts, select Keymap and choose a item turn blue at the same time, as shown below. Now, profile from the Profile drop-down list. when you change you want to change a variable, method, or other item, of which more than 4. Inplace rename. If the selected item, all the other instances changein your code, press Ctrl-R, andyou will see Escape, at which item turn blue at the are used at the same time, until you press that all instances of the same time, as shown below. Now, when you change the selected item, all the other instances cha pointsame time, until rename Escape, at which point the inplace rename mode comes to an end at the the inplace you press mode comes to an end. 10 HANDY EDITOr SHOrTCUTS The following are some of the many cool NetBeans IDE 6.0 keyboard shortcuts that no programmer will be able to do 5. Add/Remove comment lines. Select one or more lines, press Ctrl-/ and then the se without, once you know they’re there. Not all of these are commented out, as shown below. Press the same keys again and the commented lines new in 6.0, some were there before, but deserve to be be commented. This was, of course, also possible in previous releases, but previously different keyboard shortcuts, one for commenting and one for uncommenting. Now th highlighted because often they’re overlooked. been combined into one shortcut, you can quickly toggle between comment and uncom 5. Add/Remove comment lines. Select more efficient. press Ctrl-/ and then the selected lines makes this activity much faster and one or more lines, commented out, as shown below. Press the same keys again and the commented lines will no lon DZone, Inc. | www.dzone.com This was, of course, also possible in previous releases, but previously there were be commented. different keyboard shortcuts, one for commenting and one for uncommenting. Now that they hav
  • 5. 5 NetBeans IDE 6.1 Java Editor tech facts at your fingertips 4. Inplace rename. If you want to change a variable, method, or other item, of which more than one are used in your code, press Ctrl-R, and you will see that all instances of the item turn blue at the same time, as shown below. Now, when you change the selected item, all the other instances change at the same time, until you press Escape, at which point the inplace rename mode comes to an end. 10 Handy Editor Shortcuts, continued 8. Jump to last edit. Often, you find yourself in a situation where you have edited in one document, while you 5. Add/Remove comment lines. Select one or more lines, currently find yourself in a completely different document. press Ctrl-/ and then the selected lines are commented How do you get back to the place where you were last out, as shown below. Press the same keys again and the editing your code? That is likely to be the place where you commented lines will no longer be commented. This want to get backedit. Often, you find yourself in a situation where you hav 8. Jump to last to, in order to do some more editing. while you currently find yourself in a completely different document. How was, of course, also possible in previous releases, but Now, whenever you click Ctrl-Q, the last edited document to be the place place where you were last editing your code? That is likely previously there were two different keyboard shortcuts, is found, and the cursormore editing. Now, whenever you click Ctrl-Q, the to, in order to do some lands on the line where the last 5. Add/Remove comment lines. Select one or more lines, press Ctrl-/ and edit theand the cursorare then took place. lines lands on you line wherethe button took place. Alter found, selected Alternatively, the can click the last edit one for commenting and one for uncommenting. Now commented out, as shown below. Press the same keys again and the commented lines will in the top the top left of the SourceSource Editor: shown below, no longer left corner corner of the Editor: button shown below, in that they have been was, of course, also possible inyou can releases, but previously there were two be commented. This combined into one shortcut, previous quickly toggle between comment and uncomment, one for uncommenting. Now that they have different keyboard shortcuts, one for commenting and which been combined into one shortcut, you can quickly toggle between comment and uncomment, which makes this activity much faster and more efficient. makes this activity much faster and more efficient. 9. Bookmarks. When you you press Ctrl-Shift-M,current line line is quot;bookma 9. Bookmarks. When press Ctrl-Shift-M, the the current 6. Inspect members/hierarchy. Both the members of the current class as well as its can later quickly cycle back/forward to it (with Ctrl-Shift-Period a that you hierarchy can be is “bookmarked”. What this means is that you can later 6. Inspect members/hierarchy. Both the members of the of the current file are shown. linethe a small icon in the left sidebar, as shown below, unt displayed and then filtered. Press Alt-F12 and the ancestors bookmarked On gets quickly cycle back/forward to it (with Ctrl-Shift-Period and on the line again, to remove the bookmark: current class as well as Ctrl-F12, the current file's members are displayed, as shown here: other hand, if you press its hierarchy can be displayed and Ctrl-Shift-Comma). The bookmarked line gets a small then filtered. Press Alt-F12 and the ancestors of the current icon in the left sidebar, as shown below, until you press 10 Handy Editor Shortcuts in NetBeans IDE 6.0 10 Handy Editor are shown. On the IDE 6.0 hand, if you press Ctrl-F12, file Shortcuts in NetBeans other Ctrl-Shift-M on the line again, to remove the bookmark: http://netbeans.dzone.com/print/280 the current file’s members are displayed, as shown here: 10 Handy Editor Shortcuts in NetBeans IDE 6.0 http://netbeans.d 3 of 4 10 Handy Editor Shortcuts in NetBeans IDE 6.0 http://netbeans.dzone.com/print/280 2 of 4 10. 10.Highlightexitexit points.the cursor on cursor thethe return type and you will ei Highlight points. Place the cursor on on return type Highlight exit points. Place Place the points highlighted: 4/21/08 10:44 AM the return type and you will immediately see all 10. pointsyou will immediately see all exit points highlighted: and highlighted: 7. Switch between documents. When you have multiple documents open at the same time, press 7. Ctrl and between then a small popup appears. You can scroll through the popup, which displays all Switch Tab, and documents. When you have multiple documents open at the same time, press Ctrl and Tab, the open documents, and then choose the document that you want to open: and then a small popup appears. You can scroll through the popup, which documents. When you have multiple and 7. Switch between displays all the open documents, documents open at the same time, press Ctrl and Tab, and then a small popup appears. You can scroll through the popup, which displays all then choose the document choose thewant to open: you want to open: the open documents, and then that you document that Source URL: http://netbeans.dzone.com/news/10-handy-editor-shortcuts-netbeans-ide-60 QUICk OPTIONS WINDOW OvErvIEW The Options window lets you customize NetBeans IDE in a number of URL: Most people don’t know how much can be Source ways. http://netbeans.dzone.com/news/10-handy-editor-shortcuts-n customized there. The table below provides an overview. General 8. Jump to last edit. Often, you find yourself in a situation where you have edited inSets the IDE-wide browser and the one document, Web Browser n proxy settings. Proxy Settings n while you currently find yourself in a completely different document. How do you get back to the place where you were last editing your code? That is likely to be the place where you Sets theto get back options, Editor want editor-specific n Code Folding to, in order to do some more editing. Now, whenever you click Ctrl-Q, the last edited specifically those relating to code document is n Code Completion 8. Jump tothe cursorOften, on the line where the last edit where you Alternatively, you can click the and last edit. lands you in a completely different document. How do you in back to theindentation, code templates, found,you currently find yourselffind yourself in a situation took place.have editedget onefolding, code completion, camel case document, n Camel Case Behavior while behavior, n Indentation buttonwhere you were in the top left corner of the is likely Editor: place where you want tomacros. place shown below, last editing your code? That Source to be the and get back n Code Templates Source URL: to, in order to do some more editing. Now, whenever you click Ctrl-Q, the last edited document is n Macros FYI http://netbeans.dzone.com/news/10-handy- found, and the cursor lands on the line where the last edit took place. Alternatively, you can click the Java Code Sets options specifically for the Java n Formatting button shown below, in the top left corner of the Source Editor: editor, relating to the formatting, hints, Hints editor-shortcuts-netbeans-ide-60 n mark occurrences, and task list. n Mark Occurrences n Tasklist DZone, Inc. | www.dzone.com
  • 6. 6 NetBeans IDE 6.1 Java Editor tech facts at your fingertips Quick Options Window Overview, continued rESOUrCES Fonts & Colors Sets the fonts and colors for syntax, n Syntax highlighting, annotations, and diff n Highlighting viewer. n Annotations Resource URL n Diff NetBeans DZone http://netbeans.dzone.com/ Keymap Sets the keyboard profile to be used n NetBeans Profile Community throughout the IDE. By default, profiles n Eclipse Profile are provided for NetBeans, Eclipse, n Emacs Profile NetBeans Tutorials http://www.netbeans.org/kb/index.html and Emacs. A legacy profile is also n NetBeans 5.5 Profile NetBeans Video Tutorials http://www.netbeans.org/kb/60/screencasts.html provided, for NetBeans 5.5 keyboard shortcuts, which were radically NetBeans Blogs http://planetnetbeans.org/ rewritten in NetBeans IDE 6.0. NetBeans TV http://netbeans.tv/ Miscellaneous Sets the options for Ant processing, n Ant appearance, diffing, the Matisse GUI n Appearance NetBeans Weekly http://www.netbeans.org/community/news/newsletter/ Builder, JavaScript, Profiler, ToDo Tasks, n Diff Newsletter: latest.html and Versioning. n GUI Builder n Profiler n ToDo Tasks Thanks to the following people who kindly gave of their time n JavaScript and expertise in reviewing this refcard: Adam Bien, Tonny Kohar, n Versioning Varun Nischal, Kristian Rink, and Tom Wheeler. ABOUT THE AUTHOrS rECOMMENDED BOOkS Geertjan Wielenga is the NetBeans technical Rich Client Programming Pro NetBeans IDE 6 Rich writer responsible for documentation related to will help you get started Client Platform Edition fo- the NetBeans Java editor. He is a co-author of with NetBeans module cuses on the new features the book Rich Client Programming: Plugging development, master of NetBeans 6 as well as into the NetBeans Platform. He is known for his NetBeans’ key APIs, and what has changed since popular blog at http://blogs.sun.com/geertjan, learn proven techniques NetBeans 5.5, empowering as well as for his role as a Zone Leader at Javalobby. for building reliable you to be a more effective desktop software. and productive developer. Patrick Keegan has been writing about the NetBeans IDE for over 9 years. In addition to writing help and tutorials, he is co-author of BUY NOW the NetBeans IDE Field Guide and has contrib- books.dzone.com/books/richclientprog uted to other books on NetBeans and Java. books.dzone.com/books/pronetbeans Want More? Download Now. Subscribe at refcardz.com Upcoming Refcardz: Available: n Ruby Published June 2008 n Groovy n jQuerySelectors FrEE n Core .NET n Design Patterns n Adobe Flex n Flexible Rails: Flex 3 on Rails 2 n Apache Struts 2 Published May 2008 C# Windows PowerShell n n Available: n Dependency Injection in EJB 3 Published July 2008 Published April 2008 n RSS and Atom n Spring Configuration n GlassFish Application Server n Getting Started with Eclipse GWT Style, Configuration n Silverlight 2 Getting Started with Ajax and JSNI Reference n IntelliJ IDEA Published April 2008 Published April 2008 DZone, Inc. 1251 NW Maynard ISBN-13: 978-1-934238-13-4 Cary, NC 27513 ISBN-10: 1-934238-13-9 50795 888.678.0399 DZone communities deliver over 3.5 million pages per month to 919.678.0300 more than 1.5 million software developers, architects and designers. Refcardz Feedback Welcome DZone offers something for every developer, including news, refcardz@dzone.com $7.95 tutorials, blogs, cheatsheets, feature articles, source code and more. Sponsorship Opportunities 9 781934 238134 “DZone is a developer’s dream,” says PC Magazine. sales@dzone.com Copyright © 2008 DZone, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, Version 1.0 photocopying, or otherwise, without prior written permission of the publisher.