J
js_dev
General Tips
If you're new to Java, after the first few days, do consider using an
IDE with intellisense like JCreatorPro (JCreator Lite is free but has
no intellisense) or IntelliJ IDEA or Gel(GExperts.com) or Eclipse.
JCreatorPro is excellent and so is IntelliJ IDEA. JCreatorPro is
written in C++ making it fast. IntelliJ IDEA has excellent
intellisense. It has a free Open Source license, if you tell them the
name of your project and where it is put up. Eclipse is more than
intellisense It thinks as you type. By far the best. But you need to
invest a few days getting used to it. A refreshing alternative is Gel -
it is FREE and has excellent intellisense. Eclipse has the best
possible online support community and everyone is switching to Eclipse
these days.
Alternatively, you can take the hand-coding route, but will get stuck
at debugging for which the solution is to use any of the few free
visual debuggers available on the www like JSwat and jGRASP.
All the above mentioned IDEs have good intellisense. But don't just sit
over the feature - when you get the popup dropdown, make sure that you
take time to scroll down and see all the methods, variables and
constants of the particular object. This is the fastest method of
getting familiar with the library and it is also a method full of
pleasant surprises.
The comprehensiveness of the library strikes you and so do the design
aims of the libraries - they are meant to solve common programming
tasks - so that you do not have to re-invent the wheel anywhere.
Importing packages:
Beginners often make mistakes at importing the right package or class.
Remember that
import javax.swing.*;
does not allow access to everything in the tree under javax.swing.
It only allows the classes one level under javax.swing. So, for
something inside javax.swing.tree (that is javax.swing.tree.something)
you have to put the line
import javax.swing.tree.*;
or if you know exactly what you want (expert level)
import javax.swing.tree.DefaultMutableTreeNode;
Order of definition of fields/methods not important:
In Java, you can define the fields (data members of the class) after
the entire listings of the method members which use the fields (without
yet being defined in the source file).
This shows that the java compiler reads through the entire file once
before checking for definitions that are absent. Also, you can write
calls to methods that are defined later on in the file without
providing declaration stubs at the beginning as in C.
If you're new to Java, after the first few days, do consider using an
IDE with intellisense like JCreatorPro (JCreator Lite is free but has
no intellisense) or IntelliJ IDEA or Gel(GExperts.com) or Eclipse.
JCreatorPro is excellent and so is IntelliJ IDEA. JCreatorPro is
written in C++ making it fast. IntelliJ IDEA has excellent
intellisense. It has a free Open Source license, if you tell them the
name of your project and where it is put up. Eclipse is more than
intellisense It thinks as you type. By far the best. But you need to
invest a few days getting used to it. A refreshing alternative is Gel -
it is FREE and has excellent intellisense. Eclipse has the best
possible online support community and everyone is switching to Eclipse
these days.
Alternatively, you can take the hand-coding route, but will get stuck
at debugging for which the solution is to use any of the few free
visual debuggers available on the www like JSwat and jGRASP.
All the above mentioned IDEs have good intellisense. But don't just sit
over the feature - when you get the popup dropdown, make sure that you
take time to scroll down and see all the methods, variables and
constants of the particular object. This is the fastest method of
getting familiar with the library and it is also a method full of
pleasant surprises.
The comprehensiveness of the library strikes you and so do the design
aims of the libraries - they are meant to solve common programming
tasks - so that you do not have to re-invent the wheel anywhere.
Importing packages:
Beginners often make mistakes at importing the right package or class.
Remember that
import javax.swing.*;
does not allow access to everything in the tree under javax.swing.
It only allows the classes one level under javax.swing. So, for
something inside javax.swing.tree (that is javax.swing.tree.something)
you have to put the line
import javax.swing.tree.*;
or if you know exactly what you want (expert level)
import javax.swing.tree.DefaultMutableTreeNode;
Order of definition of fields/methods not important:
In Java, you can define the fields (data members of the class) after
the entire listings of the method members which use the fields (without
yet being defined in the source file).
This shows that the java compiler reads through the entire file once
before checking for definitions that are absent. Also, you can write
calls to methods that are defined later on in the file without
providing declaration stubs at the beginning as in C.