You can view the JDK and eclipse source code at will during programming.

Source: Internet
Author: User

When we want to viewSource codeYou don't want to view the class files one by one.

 

Follow these steps: press Ctrl and click the name of the method you want to view.

 

If you view the source information for the first timeCode...

 

Select the JDK source code package path and select the src.zip file.

 

Click OK.

 

 

 

 

It is relatively difficult to view eclipse source code

 

Open source in JavaProgramI have to admit that JDK and eclipse source code are the best and the best open source code, which is worth the trouble.

 

Eclipse source code efficiency is recognized as the fact that the following example is also a reference to the library and the creation of class PATH variables.

 

The following shows the source code of the jface class.

 

Step 1: add the SWT package to the eclipse build path (Library Reference)

 

Right-click Project name --- Properties

 

 

 

In the pop-up option port, select Java build path --- database --- add variable --- Select eclipse_home --- click Extension

 

Select SWT --- SWT. Jar (Other plugins --- org. Eclipse. jface_3.2.2 --- jface. Jar)

 

 

 

Step 2: Set the class PATH variable to view SWT source code

 

 

Write a code with SWT

 

For example:

Import Org. eclipse. SWT. widgets. button; </P> <p> public class testjface {</P> <p> button B1; </P> <p> Public static void main (string ARGs []) {</P> <p >}< br/>}

 

Hold down CTRL and click the button, which is the same as viewing the JDK source code.

 

The following figure shows the effect.

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.