MyEclips基础使用技巧和作业-01

版权声明:多多交流。 https://blog.csdn.net/qq_42776455/article/details/82499996

MyEclips基础使用技巧

怎样导入非新建项目

点击File->import:
这里写图片描述
选择要导入项目的文件夹
这里写图片描述

JAVA代码自动补全设置

Window菜单栏->Preferences->Java->Editor->Content Assist,右下侧auto-activaction的Enable auto activation打上勾。
Auto activation delay 默认为200,设置小点但不易太小,运行会卡顿,适当就好
Auto Activation triggers for java 后面直接写入后面内容。

.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,([{

这里写图片描述
下面的advanced选项全选。
这里写图片描述

HTML代码自动补全

10.0版本以后,不在支持设置里自动补全。所以要采用以下方法。
File–>Export–>General–>Preferences,将这个配置文件导出到桌面上。
这里写图片描述
这里写图片描述
使用文本编辑器打开此文件,在里面添加如下一行内容后保存,再导入到MyEclipse。

/instance/org.eclipse.wst.html.ui/autoProposeCode=<\= abcdefghijklmnopqrstuvwxyz\: 

这里写图片描述
再将配置文件原路导回。

字体大小和样式设置

这里写图片描述

作业-01

index.jsp源码:

<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
	Date nowday = new Date();
	int hour=nowday.getHours();
	SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	String time = format.format(nowday);
	
 %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Alarm Clock!</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style>
		.main{
			text-align: center;
			background-color: #fff;
			border-radius: 20px;
			width: 300px;
			height: 350px;
			margin: auto;
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
		}
	</style>

</head>
  
  <body>
  <div class="main">
  <center >
     <table border='1' width="300">
     	<tr height="30">
     		<td align="center"> <b>姓名:学号</b></td>
 
     	</tr>
     	<tr height="30">
     		<td align="center">温馨提示!</td>
     	</tr>
     	<tr height="30">
     		<td align="center">现在时间为:<%=time %></td>
     	</tr>
     	<tr height="30">
     		<td align="center">
     		<%
     			if(hour>=24&&hour<5)
     				out.print("现在是凌晨!时间还很早,再睡会儿吧!");
     			else if(hour>=5&&hour<10)
     				out.print("迎接新的一天吧。");
     			else if(hour>=10&&hour<13)
     				out.print("吃午饭休息吧。");
     			else if(hour>=13&&hour<18)
     				out.print("下午继续努力工作吧。");
     			else if(hour>=18&&hour<21)
     				out.print("晚上好、");
     			else if(hour>=21&&hour<24)
     				out.print("夜已深,睡觉晚安。");
     		 %>
     		 </td>
     	</tr>
     	
     </table>
 </center>
 </div>
 </body>
</html>

效果:

作业-01

猜你喜欢

转载自blog.csdn.net/qq_42776455/article/details/82499996