JavaFX源代码没有显示 [英] JavaFX source code not showing

查看:180
本文介绍了JavaFX源代码没有显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 http://hg.openjdk下载了JavaFx源代码.java.net / openjfx / 2.2 / master / rt / summary

zip文件中文件夹的名称是 re-e71070b0e0c0

The name of the folder in the zip file is re-e71070b0e0c0.

我解压缩了这个并在Idea中添加了项目结构 - 全局库下的文件夹,但它不起作用。当我尝试打开一个类时,它只显示字段名称和 / *编译代码* / 。我在手册中找不到任何内容。

I unzipped this and added the folder under Project Structure - Global Libraries in Idea, however it doesn't work. When I try to open a class it just shows field names and /* compiled code */. I couldn't find anything in the manual.

推荐答案

这些指令仅对JavaFX 2.x分支是必需的,并且在JDK 8发布后将被废弃。

下载源zip并解压后,打开Idea并按照以下说明操作:

After you have downloaded the source zip and extracted it, open Idea and follow these instructions:


  1. 修改1.7 SDK的源结构:

  1. Modify the source structure for your 1.7 SDK:

文件|项目结构| SDKs | Sourcepath

对于解压缩的zip中的每个子项目,输入 Alt + Insert 并添加相应的源目录。例如 rt-e71070b0e0c0 \ _javafx-ui-charts \ src rt-e71070b0e0c0 \ javafx-ui-common\src 等。并非所有JavaFX 2.x源代码目前都是开源的,所以这只会添加开源部分。

For each sub-project in the extracted zip, type Alt+Insert and add the respective source directory. For example rt-e71070b0e0c0\javafx-ui-charts\src, rt-e71070b0e0c0\javafx-ui-common\src, etc. Not all JavaFX 2.x source code is currently open sourced, so this will only add the open sourced portions.

设置文档查找路径:

文件|项目结构| SDKs |文档路径

为文档指定URL Alt + S http://docs.oracle.com/javafx/2/api/

Specify a url Alt+S for the documentation: http://docs.oracle.com/javafx/2/api/

在JavaFX应用程序源代码中,将光标放在JavaFX类用法上,例如LineChart:

In your JavaFX application source, place your cursor over a JavaFX class usage, for instance LineChart:


  1. Ctrl + B 从您下载的zip中打开源代码文件LineChart.java。

  2. Shift + F1 在浏览器中打开LineChart上的文档。

  3. Ctrl + Q 可快速访问IDE中的文档。

  1. Press Ctrl+B to open the source code file LineChart.java from your downloaded zip.
  2. Press Shift+F1 to open documentation on the LineChart in a browser.
  3. Press Ctrl+Q to get quick access to documentation from in the IDE.


2013年10月16日更新

JDK 8 现在包含JavaFX源文件。

JDK 8 now includes JavaFX source files.

告诉Idea JavaFX源的位置:

To tell Idea where JavaFX sources are:


  1. 修改1.8 SDK的源结构:

  1. Modify the source structure for your 1.8 SDK:

文件|项目结构| SDKs | Sourcepath

Alt + S 添加文件 javafx-src.zip ,它位于JDK 8发行版的根目录中。

Press Alt+S to add the file javafx-src.zip, which is located in the root directory of the JDK 8 distribution.

设置文档查找路径:

文件|项目结构| SDKs |文档路径

为文档指定URL Alt + S http://download.java.net/jdk8/jfxdocs

Specify a url Alt+S for the documentation: http://download.java.net/jdk8/jfxdocs.

JDK 8 JavaFX文档网址当JDK 8达到一般可用性发布阶段时,可能会发生变化。

The JDK 8 JavaFX documentation url will likely change when JDK 8 reaches General Availability release stage.

上面的步骤3提供了快速访问JavaFX的键盘快捷键来自项目的资源和文档。

Step 3 above provides keyboard shortcuts to quickly access the JavaFX sources and documentation from your project.

这篇关于JavaFX源代码没有显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆