It's all about Java: eclipse
Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Thursday, 22 April 2021

Java programming language and IDEs

IDE: Integrated Development Environment

Integrated development environment, in short IDE is a convenient environment to write, execute and  debug the code or programs on a single platform. IDEs support not only writing code smoothly but also provides a provision to write scripts, XML files, simple text files and build scripts like Ant, Maven are few among others.

In short IDEs are development environments to execute complete development activities using one application.


IDEs and Editors

IDEs and Editors fulfills the same purpose. That is writing code. But IDEs are glued or closely works with respective programming language's compilers, runtime environments, profilers and other language specific tools to put developer in a comfortable zone. 

Some of the features of IDE:
  1. Auto completion
  2. Syntax Highlighting
  3. Code debugger
  4. Profilers
  5. Multipage editors

Auto completion:

Auto completion feature suggests APIs [methods, classes and interfaces] and keywords etc as we start typing in the editor. This helps in not spending much time on typing APIs.




Syntax Highlighting:

Syntax is a structure of arranging APIs, operators and keywords to make computer instructions, subsequently which becomes executables.

Class names, method names, operators and Keywords are highlighted with different colors and formats to differentiate them and to increase the readability. Syntax highlighting helps importantly when single program or file has thousands of statements or lines.

Code Debugger:

Debugger is a feature to identify bugs, errors and shows intermittent results of set of programming instructions or statements and subsequently helps in correcting and developing a bug free computer programs






Profilers:

Profiler is the tool usually shipped along with JDK [if it is a Java] and helps in understanding the memory usage of a computer application graphically. These graphics includes different charts and GUI controls. 



Profilers gives information about

  •  Memory usage,
  •  details of Threads being used,
  •  Heap dumps,
  •  CPU utilization etc

Multipage Editors:

Multipage editors shows the same file content in multiple perceptions. For example XML file content can be viewed in different views. 1. Hierarchical view 2. Simple text format and 3. Graphical view etc


  


Few more notable points about IDEs and Editors:

  1. IDEs are scalable to support multiple programming languages
  2. Editors can not be glued to a programming language's compiler
  3. Editors does not support Auto completion
  4. Editors does not support code debugging
 

IDEs for Java and IDEs built using Java

Usually IDEs are developed using different programming languages where, few of them are open source and few are commercial. Few of the industry endorsed IDEs are:

  • Eclipse
  • Netbeans
The above listed IDEs are developed using Java programming language and also used to develop Java applications and programs. It is little tricky to understand for beginners. 
And both IDEs share common features like scalability, modularity, code completion etc.
You can download Eclipse and Netbeans distributions from their respective sites.


Happy Coding! :)

Sunday, 28 January 2018

Java desktop GUI.

Graphical user interface in short GUI makes computer users easy to understand and use the application software comfortably. Almost all modern programming languages allows application developers to develop GUIs.

Java has AWT/Swing as default API as part of Java Foundation classes in short JFC which are shipped with JDK. Hence these toolkits can be used directly in our applications with out adding external libraries like jars to our application's class path. But there are some other toolkits which found useful and industry endorsed in developing GUI.

    •      SWT 
    •      JFaces [Framework for SWT]
    •      Java FX
    •      Swing
    •      AWT

AWT:

Abstract window toolkit is available since java first version. AWT uses native operating system resources like Fonts, colors and components like table, tree, dialogues, windows etc.

Few notable points about AWT:
  • AWT is heavy weight. It uses OS resources
  • There are limited components in AWT precisely only components which are available in native OS. 
  • We can not have a new component according to our business logic need. ex: Tri state checkbox or treetable  
  • AWT behaves differently on different platforms
  • Hence it violates the java Platform independence rule
  • The program GUI developed with AWT looks differently on different OSs. Means on linux it renders linux graphics look and feel and on windows platform it renders windows graphics look and feel.   
  • Provides event model API which also used by Swing toolkit

Swing:

  • Swing was designed and developed keeping all cons in mind that are caused due to using AWT toolkit.
  • First of all "Swing is pure java hence it is platform independent." This statement made many good things possible:
Few notable points about Swing:
  •  Swing is light weight. It does not depend on native OS resources 
  •  Unlike AWT, it is extensible. New custom components can be developed according to program  requirement. 
   NOTE: See swingx library in it's official site.
  •  Swing has Pluggable look-and-feel support in short PLAF.
  •  Drag and Drop api, 2D api, internationalization are few among other included in Swing toolkit.
  •  Netbeans IDE itself is a good example for swing based application used allot now a days.
  •  Few GUI experts noticed that Swing is slow and not quite professional for commercial applications

SWT:

Standard Widget toolkit in short SWT is another toolkit for developing Java Desktop GUI based applications.
Compared to Swing it is faster and consistent in performance and Eclipse IDE itself is an example for SWT based applications.
Eclipse is industry endorsed IDE specifically for java based software development.
This is not shipped with JDK. Please see eclipse.org [official site] for more details.
And there are Integrated development environments in short IDE which provides Drag and Drop [DAD] palettes also known as GUI Builders for above toolkits for programmer's convenience.
Mostly used IDEs are:
It is advised to code manually to develop the GUI rather using GUI builders provided by different IDEs. And for beginners.  


Sunday, 29 October 2017

Eclipse Java Editor Shortcuts

Eclipse Oxygen Java editor Shortcuts helps in editing source code more comfortably. Frequently used default shortcuts are listed below. 




Description
Shortcut
Delete Line
CTRL + D
Copy Line
CTRL + ALT + Down Arrow
Add method level, class level, member level Comments
SHIFT + ALT + J
Format Java Source code
CTRL + SHIFT + F
Make line commented
CTRL + /
Make multiple lines [block] commented  
CTRL + SHIFT + /
Search selected similar word within the source document
CTRL + K
Select line from beginning to end
SHIFT + End key
Select line from end to beginning
SHIFT + Home key
Select Word by word in same line
CTRL + SHIFT + Right Arrow
Move line above
ALT + Up Arrow
Move line below
ALT + Down Arrow

Shortcuts can be customized and new shortcuts can be created through Keys Page in Preferences wizard.


  1.  Window menu > Go To Preferences 
  2.  Type Keys as the "filter text"
  3.  Please find the image below for reference.


Example:
Add new Shortcut for cut whole line command.

  1.  In Keys page type filter text -- Cut line
  2.  Type your convenient key. In my case I added SHIFT + X
  3.  Finally, Click Apply and Click Apply and Close.
  4.  That's it. Now Test your new Shortcut. 

Happy Coding :)

Monday, 4 July 2011

Java IDE for Learners:


           Simple editors like Notepad, Gedit, edit+  definitely allows us to write a program, but it is always difficult to code, debug and manage even smaller applications. and profession IDEs like Eclipse, Netbeans JDeveloper are definitely not suitable for beginners.[They are pretty advanced to students]

           What if we have an IDE which allows the learners to understand the basic coding principles of java, Fundamentals of Object Oriented Programming[OOP] with the pictorial representation along with syntax highlighting, scope highlighting and other cool features?.. sounds good right.
         
                   
           BlueJ is a simple Java based IDE developed by Kent university for the beginners and students of Java programming language. The coolest thing about BlueJ is it not only allows us to interact[compile, execute] with complete application or program but also single objects.Hence we can create Objects and execute its methods graphically.

Important features are:
  • Create classes and interfaces through wizards and diagrams
  • Create directly object of a class and execute its methods rather than executing complete application.
  • Debugger, Terminal etc
Editor Features:
  •      Syntax Highlighting
  •      Scope Highlighting
  •      Code completion
  •      Navigation View
  •      Switch between source code and Documentation 




Popular posts

Atomicity with Java Programming Language

 Atomicity with Java What is Atomicity Atomicity, in computer science, is considered to be a property [ALL-OR-NOTHING], that the state of a ...