Simple use of IDEA tools

Simple use of IDEA tools

In advance, the version used in ** is IDEA 2020, and there may be differences in other versions. **The installation of IDEA and its cracking are not involved here, and the original intention of using the IDEA tool is as an integrated development tool for the JAVA language, and other aspects will not be involved. Some people may think that IDEA has the breath of eclipse. In fact, sometimes we cannot choose our own integrated development environment, and now the mainstream JAVA development tools are IDEA and eclipse . Adaptation and switching, both operations and their shortcut keys are as consistent as possible.

Having said that, what are the benefits of using an integrated development tool? The integrated development environment is also referred to as IDE. IDE is an application program that provides a program development environment, generally including code editors, compilers, debuggers, and graphical user interfaces. An integrated development software service suite that integrates code writing functions, analysis functions, compilation functions, and debugging functions. Developers can improve development efficiency through functions such as code highlighting, code completion and prompts, syntax error prompts, function tracing, and breakpoint debugging provided by the IDE .

New Project

The organization method of IDEA is protect->module, while the organization method of eclipse is workspace->protect. Each protect of IDEA represents the workspace of eclipse, and each module represents a protect. That is to say, IDEA takes protect as the highest directory, and there are many module projects under protect. Each module is connected with each other to form a project, and the code is stored in the package under the src directory under each module.

Create a new protect

When entering IDEA for the first time, a welcome interface will appear, as follows:

Welcome Screen

We can create a new protect or open a protect on the welcome interface, etc.

The method of our new project protect is as follows:

  1. On the welcome screen, select the New Protect option, or the Protect option in the New option under the File menu to create a new project

    New project 1

  2. Select the last one, Empty Protect, and then click Next directly.

    Create a new protect

    Create a new protect

  3. Set the protect name and location, and click finish

    Screenshot 2021-07-06 143324.png

So far, a simple Protect has been built, and the next step is to create a new module as a directory for storing JAVA packages.

new module

  1. Select the New option under the FIle menu, and finally select Module.

    new module

  2. Just click Next

    New module attribute interface

  3. Set the module name, file location, and finally click finish

    New module3

So far, a simple module has been established, and the next step is to create a JAVA package as a directory for storing various code files and other configuration files.

New JAVA package

First, click on the module directory, there will be a src directory, select and right-click, select the New option, then select the package option, and enter the name to complete the creation of the JAVA package.

Creation of JAVA package

The name of the new JAVA package

Create a new JAVA code file

First, select JAVA, right-click, select the New option, then select the JAVA Class option, and enter the name.

New JAVA file

So far, a simple JAVA project has been created. Next, let’s introduce the shortcut keys and settings related to IDEA.

simple setup

First of all, let's enter the setting option of IDEA first, click the Settings option under the File menu, and click to open the setting.

IDEA settings

This is the setting panel of IDEA. Next, you can start to make simple settings for IDEA.

IDEA settings panel

font settings

There is a search box in the upper left corner of IDEA's settings panel. Enter font to display the Font option. Click to enter the Font (font) setting.

font settings

What we often use is to change the style and font size of the font. The option on the left of Font is to set the font style, the option on the right is to display only characters with equal spacing, and Size is to set the font size. The following Line spacing sets the character line spacing. If you want to return to the default state, select Restore Default. Other options do not require major changes! Finally, click Apply and then OK to complete the setup .

theme color

Enter the Theme option on the Appearance page of the settings to set the theme color.

change theme color

hot key

  • IDEA will automatically save every time you write new code, no need for CTRL+S.
  • When writing code in the JAVA code file, to create a main method, you only need to write psvm, and press the Enter key to automatically create the main method.
  • Similarly, writing sout can automatically generate a newline print statement System.out.println();
  • Delete the line currently being entered: CTRL+Y
  • Run the code: right-click on the code and select run (notebook: CTRL+Shift+Fn+F10), or click the green arrow on the left side of the code.
  • Open and close the directory: select the directory, the left arrow key to close, the right arrow key to open, and the up and down arrow keys to switch the directory up and down.
  • Create a new file: notebook: Fn+alt+insert, a window appears, directly input the type of file to be created, and then select the desired target with the up and down arrow keys in the candidate, and finally press the enter key.
  • Automatically generate construction methods and get and set methods: After writing private variables, press Fn+alt+Insert keys, select Constructor (Setter and Gettter) up and down as the new construction method (set and get methods), and then select the desired construction Variables in the method, and finally press the Enter key to complete the new construction method.
  • The rewriting method is also the Fn+alt+insert shortcut key, and the operation is similar.
  • Launch any window in IDEA by pressing the Esc key
  • Maximize the window: CTRL+Shift+Fn+F12
  • Switch windows: alt + left (right) arrow key, switch pages to the left (right).
  • Open certain windows: alt+the number corresponding to the item (protect, run window, etc.).
  • View the parameters that can be passed in by the constructor (New object): press CTRL+P in the brackets of the constructor

Ask for likes and forward

Guess you like

Origin blog.csdn.net/yumuing/article/details/129106762