MyEclipse和Eclipse的使用
一.新建项目
- 
    
新建项目: File -> New -> Other -> Java Project -> next -> javase(Project name) -> Finish(打开新的视图)
 - 
    
JRE System Library: Java运行时环境信息
 - 
    
src:源代码(MyEclipse里是ejbModule)
 - 
    
创建第一个类: src(MyEclipse里是ejbModule) -> New -> Class -> Pet(Name); cn.itxdl.day11(Package) -> Finish
 - 
    
新建子类: 找到cn.itxdl.day11 -> 右键 -> new -> class -> Dog(Name) -> Browse -> Pet -> 双击 -> Finish
 - 
    
新建接口: 找到cn.itxdl.day12 -> 右键 -> new -> Interface -> InterfaceTest(Name) -> Finish
 - 
    
新建有接口类: 找到cn.itxdl.day12 -> 右键 -> new -> class -> Gold(Name) -> Add -> cn.itxdl.day12.Metal -> Add -> cn.itxdl.day12.Money -> Finish
 - 
    
新建匿名内部类:
找到cn.itxdl.day12 -> 右键 -> new -> Interface -> A(Name) -> Finish 找到cn.itxdl.day12 -> 右键 -> new -> class -> ATest(Name) -> 勾选public static void main(String[] args) -> Finish 找到cn.itxdl.day12 -> 右键 -> new -> class -> SubA(Name) -> Add -> cn.itxdl.day12.A -> Finish 
二.修改字体
- 
    
窗口字体: Window -> Preferences -> General -> Appearance -> Colors and Fonts -> Java -> Java Editor Text Font -> Edit -> Consolas(字体); 粗体(字形); 20(大小) -> 确定
 - 
    
console字体: Window -> Preferences -> General -> Appearance -> Colors and Fonts -> Debug -> Console Font -> Edit -> Consolas(字体); 粗体(字形); 20(大小) -> 确定
 
三.重置视图
Window -> Perspective -> Reset Perspective
四.自动生成公有的get/set方法
右键 -> Source -> Generate Getters and Setterss -> Select all -> Generate
五.自动生成构造方法
- 
    
无参: 右键 -> Source -> Generate Constructor using Fields -> Deselect all -> Generate
 - 
    
有参: 右键 -> Source -> Generate Constructor using Fields -> Generate
 - 
    
通过父类: 右键 -> Source -> Generate Constructor from superClass -> Generate
 
六.运行
- 
    
右键 -> run as -> Java Application
 - 
    
点击小绿尖角 -> Java Application
 
快捷键
- 
    
Syso使用alt+/: 自动生成System.out.println(); - 注释
    
ctrl + shift +/: 表示采用多行注释选中的内容ctrl + shift +\: 表示取消多行注释Ctrl +/: 表示采用单行注释,再按一下取消注释 - 
    
Ctrl + alt + 方向键: 可以实现对选中内容的复制 alt + 方向键: 可以实现对选中内容的移动