-
2021-02-11 15:57:15
如何快速在手机和电脑之间传文件?这个问题需要分不同的手机、电脑系统来具体讨论,但大致可以分为:iOS生态、iOS和Windows、Android和Windows三种情况。
iOS生态你自然可以使用隔空投送来完成,但Mac的用户还是少数。苹果电脑也并不适合所有人,尤其是你需要使用Excel处理数据、玩游戏等,肯定还是需要使用Winodws系统。
所以这篇文章主要讨论iPhone和Windows之间有哪些联动,以及如何快速高效地实现文件传输。
同步iPhone的日历到Windows
同步日历的主要目的,自然是同步日历上的待办信息,比如:高铁票、机票、会议时间、DDL等。
就我自己而言,使用的是iPhone自带的日历。原因有两个:自带的日历对其它App支持比较好,比如买了火车票之后可以自动添加到日历中;另外一个就是同步,iPhone上的日历在iPad之类上也可以同步显示,而且免费。
但问题就来了,在使用Windows办公的时候,是无法同步这些信息的,所以有时候就会忽略一些记录的工作通知。
直接在Windows中搜索日历,在弹出的日历窗口中选择设置,然后选择添加iCIoud邮箱账户(和Apple ID不同)。
这里需要注意,登录账号输入的是iCIoud邮箱地址,而不是Apple ID的邮箱。不知道的话,你可以在苹果官网最底下选择管理Apple ID,登录后就可以看到。
然后登录的密码需要单独生成,并不是Apple ID的密码。也是在官网登录,然后在安全里有一个App专用密码,把它输入到Windows的日历中,同步就完成了。
接着你还可以修改同步设置,最快可以15分钟同步一次,或者手动,刷新同步还是挺快的,正常使用问题不大。
因为是直接同步了iCloud的邮箱,所以如果是发送到你iCloud邮箱的邮件,也可以直接在Windows的邮件中查看。
这个方法缺点也显而易见,这个方法只能单向同步,你并不可以把Windows中的日历同步到iPhone中。
所以如果你想实现双向同步,可以使用一些第三方日历待办工具,比如滴答清单等,那你就需要付费。
代替隔空投送:坚果云、TIM
隔空投送是苹果生态非常好用的一个功能,用它你可以快速传图片、视频等,而且速度非常快。但这在Windows上实现就比较困难,不过我们可以用坚果云来替代。
坚果云是一个网盘工具,但用来传文件也很方便。不过免费版每个月只有1GB的上传流量和3GB的下载流量。
在iPhone和Windows上安装好坚果云就可以同步了。直接在iPhone中选择分享照片或文件,然后选择坚果云,在发送界面可以选择保存的文件夹。
另外坚果云的本质是一个网盘,所以你在电脑离线的情况下也可以使用,这也是它相比隔空投送的一个优点。
除此外还有许多第三方工具也可以快速同步文件,比如:AirDroid、茄子快传、相册飞船等。但大多都有广告,使用体验效果一般。
而且这些第三方工具,大都是通过局域网来实现。那还不如用QQ,只要在同一个WIFI下,速度也很快,还免费。
手机QQ还有一个面对面快传的功能,免流量速度也还挺快,用它来代替隔空投送,你就可以在iPhone和安卓间快速传文件。
在QQ传输文件的最右侧,你甚至还可以在手机上直接访问电脑的文件。所以如果只是为了传输文件,我觉得应该没有比QQ更好用的软件了。
值得一提的是,如果你只需要办公功能,强烈安装TIM(办公版本的QQ),没有太多花哨的功能,界面也简洁许多。
Duet Display:把iPad当成Windows的屏幕
最新版的MacOS Catalina支持随航功能,你可以把iPad当成显示器。如果你想在Windows上实现这种功能的话,需要安装第三方工具:Duet Display。
这是一个收费的App,AppStore价格68元。用它你就可以把它iOS和Android变成Mac或Windows的拓展屏。
没有什么特别的使用难度或者技巧,安装好App之后直接按照引导说明连接就可以了。
快贴:打通iPhone和Windows的剪切板
接力功能在iPhone和Mac中一般有两个用途:第一个是浏览网页,你在手机上看了之后可以在电脑上继续看;第二个就是剪切板,你在手机上复制的文字在电脑上也可以直接粘贴,反之亦然。
接力浏览网页我觉得不是很实用,但是iPhone和Windows也可以实现,你只需要使用Microsoft Eage来看网页就可以了。
剪切板的话可以使用【快贴】这个第三方工具来完成,在iPhone和Windows上都下载客户端,然后选择端对端加密,设置PIN密码。
这样剪切板就联动完成了,你在电脑上复制剪贴的的内容,快贴App里也会直接同步,你可以直接复制、收藏、删除以及添加提醒。
用Windows版iCloud管理文件
iCloud也有Windows版本的客户端,你可以直接下载,地址是https://www.apple.com/icloud/setup/, 用Windows的浏览器打开会提示你安装。
有了客户端之后,你就可以在PC管理你手机的相册、App同步的内容。比如你在手机或iPad上用XMind做了一个思维导图,在iCloud中就可以找到对应的文件,这样在Windows中就可以打开。
(Windows版iCloud)
用前面提到的坚果云等网盘也可以实现,这个方法仅适用于没有Windows客户端或者没有自带云服务的软件(比如Xmind)。
所以思维导图我更推荐使用幕布,相比XMind一年388元的定价,幕布的90元便宜不少,而且还可以多平台云同步。
除此外,用Windows版的iCloud你还可以把Safari的书签同步到Chrome中。你要在iCloud设置中选择书签,然后把Chrome勾上,它会提示你安装插件,然后你可以同步Safari的书签了。
最后关于iCloud,我还想说的是,如果你即是Mac的用户也是Windows的用户,非常建议用它。完全可以把它当成一个网盘使用,比如我就在iCloud中放了许多自己平时作图常用的素材,可以直接同步使用。
如果你更新到了iOS13系统,在iPhone分享文件可以选择iCloud链接,相比百度云来说不容易失效下载速度也快。
但也有缺点,首先是生成的链接只有1个月有效,而且不可以设置密码;然后是iCloud免费账户的容量很小,基本上都需要扩容。
写在最后
整体上来说,文章中提到的方法都有一定局限,肯定比不上原生系统带来的体验。但我觉得已经足够使用了,很多时候我们离不开Winodws,所以就只能在之间求同存异。
另外还有一点值得说的是,文章推荐的工具都是免费的,所以它可能并不是最好用的。比如日历,同步iCloud过来的过程略繁琐,如果你觉得麻烦可以直接购买滴答清单等,其它的也一样。
这周晚一点会把这篇文章改成视频脚本,在B站重新发布,希望大家到时候也能来看。
更多相关内容 -
Win7日历小工具
2012-02-28 19:57:04windows 7 综合日历工具,在WINDOWS7下直接安装应用,直接托放到桌面。 -
Windows 日历增强软件 VueMinder Calendar Ultimate 2019.05 中文多语免费版.zip
2021-05-10 15:18:14覆盖日历的日,周,月,年,列表和时间表的意见。 6.桌面日历 直接查看您的日程安排上的Windows桌面背景。 7.同步和共享日历 同步你的本地网络,谷歌日历。 微软的Exchange,Outlook中的iCalendar,等等。 8.提醒 ... -
DIY仿win7日历的JS日历控件
2011-05-31 15:33:44现网上很多各种各样的JS日历控件,前断时间在由于在项目里也正好用着选择日期,在网上搜索了好多都不是很合心意,于是在那时,突然心血来潮想...该日历控件外形与WIN7的相似,经反复测过,支持目前所有流行的浏览器。 -
使用JS制作的windows7侧边栏万年历
2011-11-10 20:39:10具有万年历、支持农历公历的(节日、生日、纪念日)设置,可更改皮肤、可以选择多种明星整点报时、可将自定义的节日皮肤备份、还原。2011年11月10日更新 -
win7中国日历
2012-11-04 12:38:57我之前在本坛找过也百度过多次,半天没找到真正意义上的官方中国日历,还好现在找到了,拿来分享。 -
一款实用的Windows小插件 ——桌面日历DesktopCal
2021-06-18 11:08:06一款实用的Windows小插件 ——桌面日历DesktopCal2017-04-14 18:54:4963点赞359收藏46评论发现之旅一直在寻找一款好用的Windows(本人qiong,没用过Mac)桌面日历软件,就像实物放在桌上的台历一样 ,显示月份的每一天...一款实用的Windows小插件 ——桌面日历DesktopCal
2017-04-14 18:54:49
63点赞
359收藏
46评论
发现之旅
一直在寻找一款好用的Windows(本人qiong,没用过Mac)桌面日历软件,就像实物放在桌上的台历一样
,显示月份的每一天,并能在上面标注要做的或提醒自己的一些事项,数据能云端保存。终于,在某一天,无意中发现了本文的主角--桌面日历DesktopCal
。下载链接如下
桌面日历桌面日历®是一款放置在桌面上的日历。双击桌面即可记录琐事,非常方便,非常实用。桌面日历®能帮您轻松管理约会、待办事项、日程安排 ... 不仅如此,桌面日历®还提供万年农历、节气与各种常见的节庆、纪念日等信息。chs.desktopcal.com直达链接
日常使用
此软件暂时只有Windows版,尚无Mac版,移动端也暂时没有,有点遗憾
。软件很小3.3M左右,安装也很方便,首先来个总览图
软件可以调整在桌面上的位置及大小,点击拖动即可,很方便(这两张是手机拍摄,见谅)
左键双击日期中任一空白区域即可添加事项,左下角第一个画板图标可以更改每日的背景颜色
左下角第三个是事项编号方式,共有三种,数字、无或点。
左下角第二个是划横线功能,当一件事做完或期限已过可以点击,提示作用。
整个软件的透明度可调,从不透明、10%、20%........到完全透明,作为强迫症的我用的是50%
每个日期单元格之间的间隙可调,从0、1、2.......到10,我依然强迫的选择了5
单元格内事项的字体可调,但是操作是对整体的,不能单独修改各单元格内的字体(大部分人应该也不会搞
很多种字体吧)
设置里的常规>外观就不截图了,感兴趣的自己设置研究下;高级>跟随Windows启动最好勾选上,软件占用内存极小,几乎不会影响多少开机时间,但确很重要,其实还不是因为懒
云同步功能:右上方的云图标,可以用邮箱快速注册一个此软件的账号,点击手动同步按钮,软件将会把你的日历上传到服务器,当你更换windows设备时,只要重新下载此软件,再次点击手动同步,将会把服务器上的内容同步到这另一台设备。(自动同步需要购买,40元一年,其实只要经常点点手动,完全不需要
)
每月内容也可以打印出来,右上方>更多>打印,打印时最好把字体设置成黑色,日期颜色默认的改不了
而且,如果在日历视图范围内有其他软件图标或文件,互不影响,参看下图
总结记事,个性化,同步,打印等功能齐全
未来如果能出移动端会更好
能多个弹出提醒功能最好,毕竟有时忙起来会忘了看
未经授权,不得转载
-
Windows7 最好用的日程提醒小工具!再也不用担心忘记事情
2010-11-05 23:48:10Windows7 最好用的日程提醒小工具!再也不用担心忘记事情。可以定时提醒,闹铃提醒,并显示提醒内容。对于日常工作比较繁忙的同志非常实用! -
win7桌面小工具中国日历
2011-01-14 16:00:36解压出来的文件夹放到C:\Program Files\Windows Sidebar\Gadgets 还有些缺点1:同一天有多个节日和纪念日只会显示一个在日历右边其它的就看不到了,左边有空间希望自己能设一些纪念日能显示在上边因为自己不会请会的... -
JS版windows7侧边栏万年历
2011-11-10 19:58:17使用JS开发的windows7侧边栏,具有:万年历、生日、节日、纪念日提醒(能够设置农历、公历),还有皮肤更换、自定义设置的备份、还原,以及天气预报。 -
P90X iCal Generator:生成P90X和P90X3 iCal日历-仅Windows-开源
2021-05-12 13:06:44以iCal(.ics文件)格式生成P90X和P90X3日历,以导入到Google日历或Microsoft Outlook等。 内置支持从文本文件中的事件列表生成日历。 只需从下拉列表中选择该选项,并在设置完所有内容后,单击“保存”即可开始加载... -
微软Windows风格的日历控件VB专用版(CSDN zhaoyonghui100完善)
2012-08-23 09:28:45中文全称:星期一、星期二、星期三、星期四、星期五、星期六、星期日 2、修改代码,解决中文的星期标签中,汉字不能显示的问题。 3、修改代码,解决月份右键: 选择1~10月时,标题中仅显示一个汉字“一”、“二... -
2020 把课程表导入日历 python3 Windows/Macos
2020-09-23 10:22:01借鉴了这位的 文章,思路非常清晰明了,但是在Windows实现时,代码出现了非常多的问题。 这里将代码由python2改成python3,并进行了改进,实测Windows和Mac都可以完美运行 管理课表是大学生非常头疼的事情,稍有不慎...2020 把课程表导入日历 python3
借鉴了这位的 文章,思路非常清晰明了,但是在Windows实现时,代码出现了非常多的问题。
这里将代码由python2改成python3,并进行了改进,实测Windows和Mac都可以完美运行
管理课表是大学生非常头疼的事情,稍有不慎就忘了上课(确实有时候也不是因为忘了,就是不想去),所以我们需要把课程表(word、excel)转成便于查看的形式,作为最方便的形式,整理下课程表,一起导入到日历里。
iOS端其实 App Store 里课程表的应用并不少,各个学校也可能有自己的教务系统爬下来做出来的课程助手,所以管理课程这件事并不是难事。但是这些课程助手与官方app比还是差了一点,所以我选择iOS官方日历+outlook日历。
将课程表导入到日历管理的好处十分明显:- 统一管理。将课程和其他安排统一管理,方便安排和查看
- 好看。官方app毕竟是职业程序员做出来的,优雅而美观,掉链子的可能性最小
程序总共由两个脚本完成,最后将 ICS 导入日历即可。步骤概要:
1、使用 excelReader.py 将保存的 classInfo Excel 表格导出容易解析的 conf_classInfo.json
2、使用 main.py 将配置好的 conf_classTime.json 和生成的 conf_classInfo.json 生成一个 class.ics
3、将 class.ics 导入手机或者电脑
4、搞定!环境要求
Python 3
执行详解
1、配置 classInfo Excel 表格
在工作目录下创建一个 classInfo Excel 表格,表格表头有如下参数:
className:课程名称
startWeek:起始周
endWeek:结束周
weekday:星期
classTime:第几节。(请这里是大课的节数)
classroom:教室2、配置 conf_classTime.json
来吧,照猫画虎:
{ "classTime": [ { "name":"第 1、2 节", "startTime":"0830", "endTime":"1005" }, { "name":"第 3、4 节", "startTime":"1020", "endTime":"1155" }, { "name":"第 5、6 节", "startTime":"1430", "endTime":"1605" }, { "name":"第 7、8 节", "startTime":"1620", "endTime":"1755" }, { "name":"第 9、10 节", "startTime":"1930", "endTime":"2105" } ] }
3、运行 excelReader.py 脚本
如果 classInfo 表格是按照 Demo 的样式保存的,输入 0 继续即可。如果不是……你改回来就可以。
完成后会生成一个 conf_classInfo.json 配置文件4、运行 main.py 脚本
回车后,需要输入两个参数:第一周的星期一日期、提醒时间。提醒时间就是在 iOS、Mac 上创建日历时所使用的设置,实测在Windows的outlook日历一样生效。
完成后在工作目录下会生成一个 class.ics 文件
5、导入手机或者电脑
如果你是 Mac + iOS, 恭喜你,直接点开 class.ics 就可以导入 Mac, 然后等待 iCloud 同步就可以。
如果想单独导入 iOS,可以用另外一个邮箱以添加附件的方式将 ics 发送到你的 iOS 可以收到的邮箱里,在邮箱内打开就可以。
我的设备是Windows+iPhone+iPad
我个人建议是添加到outlook日历里,然后在iOS端添加outlook账号,这样Windows对outlook的支持极其完善,不比apple的日历差,各种提醒非常及时(毕竟是亲儿子),然后在iOS端登陆outlook账号(其实就是微软账号),在日历里添加outlook日历。
这样不管是在手机还是平板还是电脑,都有提醒,不用怕忘记上课了 -
天天万年历 v8.1.0.0.zip
2019-07-13 10:49:32天天万年历是一款最全面最实用最具个性的运行于WINDOWS平台下的桌面时钟、月历、日历且集成了中国传统计时老黄历信息功能,阴阳历法对照全面的万年历软件。 天天万年历具体功能: 一.阴阳历日历 1、公历日期... -
java实现类似Windows7上的时钟日历小程序
2019-03-17 21:39:09g2d.drawString(Integer.toString(i), x - 5, y + 7); } AffineTransform at = g2d.getTransform(); //画60个刻度 for (int i = 0; i ; i++) { int w = i % 5 == 0 ? 3 : 1; int h = i % 5 == 0 ? 8 : 5; g2d....#java实现时钟日历小程序
最终效果如下图
具体代码如下:package swing2; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.geom.AffineTransform; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class CalendarDemo extends JFrame { public static void main(String[] args) { CalendarDemo cd = new CalendarDemo(); cd.show(); System.out.println(cd.getSize()); } public CalendarDemo() { setTitle("xx"); //获取屏幕尺寸 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int width = screenSize.width/2;//width = 740 int height = screenSize.height/2;//heitht = 540 /* int width = 800; int height = 540;*/ //设置关闭窗体时关闭程序 setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); //设置窗体尺寸 setSize(width, height); //允许用户改变窗体大小 setResizable(true); setVisible(true); //将窗体容器分为左右两部分 JSplitPane splitPane = new JSplitPane(); //设置分割线位置 splitPane.setDividerLocation(500); //设置分割线大小 splitPane.setDividerSize(-1); //日历 CalendarPanel calenderPanel = new CalendarPanel(this); //时钟 ColockPanel colockPanel = new ColockPanel(); //设置左边面板为日历面板 splitPane.setLeftComponent(calenderPanel); //设置右边面板为时钟面板 splitPane.setRightComponent(colockPanel); //将分割对象装进容器 Container container = getContentPane(); container.add(splitPane); new Thread(colockPanel).start(); } } //时钟面板 class ColockPanel extends JPanel implements Runnable,ActionListener{ /* private int lastxs, lastys, lastxm, lastym, lastxh, lastyh; private Label cur_clock, cur_week;*/ //private Label cur_day; private int lastxs, lastys, lastxm, lastym, lastxh, lastyh; private Label cur_clock, cur_week; private JButton cur_day; public ColockPanel() { /* this.setLayout(null); this.setBackground(new Color(255, 255, 255)); setVisible(true); cur_clock = new Label("", Label.CENTER); cur_clock.setFont(new Font("Dialog", 1, 15)); cur_clock.setBounds(100, 350, 100, 40); //cur_clock.setBackground(new Color(255, 255, 255)); cur_clock.setForeground(Color.black); cur_week = new Label("", Label.CENTER); cur_week.setFont(new Font("Dialog", 1, 15)); cur_week.setBounds(100, 390, 100, 40); //cur_week.setBackground(new Color(255, 255, 255)); cur_week.setForeground(Color.black); cur_week.setVisible(true); add(cur_week); add(cur_clock);*/ } @Override protected void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; //去锯齿 g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); //清空原来的图形 g2d.setColor(Color.white); g2d.fillRect(0, 0, this.getWidth(), this.getHeight()); //设置画笔颜色 g2d.setColor(Color.black); //圆心坐标 int xCenter = this.getWidth() / 2; int yCenter = this.getHeight() / 2; //计算半径 int radius = (int) Math.min(this.getWidth(), this.getHeight() * 0.8 * 0.5); //画外圆边框 g2d.drawOval(xCenter - radius - 2, yCenter - radius - 2, radius * 2 + 2, radius * 2 + 2); //画表盘 g2d.setColor(new Color(193, 241, 251)); g2d.fillOval(xCenter - radius, yCenter - radius, 2 * radius, 2 * radius); g2d.setColor(Color.black); //画时钟的12个数字 for (int i = 1; i <= 12; i++) { double dd = (Math.PI * i) / 6; int x = (int) (Math.sin(dd) * (radius - 20) + xCenter); int y = (int) (yCenter - Math.cos(dd) * (radius - 20)); g2d.drawString(Integer.toString(i), x - 5, y + 7); } AffineTransform at = g2d.getTransform(); //画60个刻度 for (int i = 0; i < 60; i++) { int w = i % 5 == 0 ? 3 : 1; int h = i % 5 == 0 ? 8 : 5; g2d.fillRect(xCenter - 2, yCenter - radius, w, h);//绘制矩形 g2d.rotate(Math.toRadians(6), xCenter, yCenter);//按参数1的弧度旋转图形 } //获取时间 Calendar calendar = Calendar.getInstance(); int second = calendar.get(Calendar.SECOND); int minute = calendar.get(Calendar.MINUTE); int hour = calendar.get(Calendar.HOUR_OF_DAY); Date currentTime = new Date(); SimpleDateFormat formatter_day = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formatter_clock = new SimpleDateFormat("HH:mm:ss"); SimpleDateFormat format_week = new SimpleDateFormat("EEEE"); setFont(new Font("宋体", Font.PLAIN, 18)); g2d.drawString(format_week.format(currentTime), xCenter - 25, yCenter + (radius / 2)); g2d.drawString(formatter_clock.format(currentTime), xCenter - 35, yCenter + (radius / 3)); g2d.drawString(formatter_day.format(currentTime), xCenter - 40, yCenter - (radius / 2)); int xh = (int) (Math.sin(Math.PI / 360 * (60 * hour + minute)) * (radius / 2) + xCenter); int yh = (int) (yCenter - (Math.cos(Math.PI / 360 * (60 * hour + minute)) * (radius / 2))); int xm = (int) (Math.sin(Math.PI * minute / 30) * ((2 * radius) / 3) + xCenter); int ym = (int) (yCenter - (Math.cos(Math.PI * minute / 30) * ((2 * radius) / 3))); int xs = (int) (Math.sin(Math.PI * second / 30) * ((4 * radius) / 5) + xCenter); int ys = (int) (yCenter - (Math.cos(Math.PI * second / 30) * ((4 * radius) / 5))); //画时针,分针,秒针 g2d.setColor(Color.black); g2d.setStroke(new BasicStroke(3.0f)); g2d.drawLine(xCenter, yCenter, xh, yh); g2d.setStroke(new BasicStroke(2.0f)); g2d.drawLine(xCenter, yCenter, xm, ym); g2d.setStroke(new BasicStroke(1.0f)); g2d.drawLine(xCenter, yCenter, xs, ys); g2d.fillOval(xCenter - 5, yCenter - 5, 10, 10); } /* @Override public void paint(Graphics g) { //g.fillRect(30, , 240, 240); g.setColor(Color.white); g.fillRect(0, 0, 300, 500); //设置表盘颜色 g.setColor(new Color(120, 240, 240)); //设置表盘 g.fillRoundRect(32, 66, 240, 240, 240, 240); g.setColor(Color.BLACK); g.fillRoundRect(145, 185, 10, 10, 10, 10); int xh, yh, xm, ym, xs, ys, s, m, h, xcenter, ycenter; Date currenttime = new Date();//获取当前日期和时间 s = currenttime.getSeconds(); m = currenttime.getMinutes(); h = currenttime.getHours(); //SimpleDateFormat formatter_day = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formatter_clock = new SimpleDateFormat("HH:mm:ss"); SimpleDateFormat format_week = new SimpleDateFormat("EEEE"); cur_clock.setText(formatter_clock.format(currenttime)); cur_week.setText(format_week.format(currenttime)); xcenter = 150; ycenter = 190; //计算秒针,分针,时针的位置 xs = (int) (Math.cos(s * 3.14f / 30 - 3.14f / 2) * 100 + xcenter); ys = (int) (Math.sin(s * 3.14f / 30 - 3.14f / 2) * 100 + ycenter); xm = (int) (Math.cos(m * 3.14f / 30 - 3.14f / 2) * 80 + xcenter); ym = (int) (Math.sin(m * 3.14f / 30 - 3.14f / 2) * 80 + ycenter); if (h <= 12) { xh = (int) (Math.cos((h * 60 + m )* 3.14f / 360 - 3.14f / 2) * 60 + xcenter); yh = (int) (Math.sin((h * 60 + m )* 3.14f / 360 - 3.14f / 2) * 60 + ycenter); } else { h = h - 12; xh = (int) (Math.cos((h * 60 + m )* 3.14f / 360 - 3.14f / 2) * 60 + xcenter); yh = (int) (Math.sin((h * 60 + m )* 3.14f / 360 - 3.14f / 2) * 60 + ycenter); } //g.fillOval(xcenter-85,ycenter-85,240,240); g.setFont(new Font("TimesRoman", Font.PLAIN, 14)); //设置表盘数字颜色 g.setColor(Color.black); //设置表盘数字 g.drawString("12", xcenter, ycenter - 115); g.drawString("1", xcenter + 55, ycenter - 100); g.drawString("2", xcenter + 100, ycenter - 55); g.drawString("3", xcenter + 115, ycenter); g.drawString("4", xcenter + 100, ycenter + 55); g.drawString("5", xcenter + 55, ycenter + 100); g.drawString("6", xcenter, ycenter + 115); g.drawString("7", xcenter - 55, ycenter + 100); g.drawString("8", xcenter - 100, ycenter + 55); g.drawString("9", xcenter - 115, ycenter); g.drawString("10", xcenter - 100, ycenter - 55); g.drawString("11", xcenter - 55, ycenter - 100); //绘制指针 g.setColor(Color.black); Graphics2D g2 = (Graphics2D) g; g2.setStroke(new BasicStroke(1.0f));//设置指针粗细 g.drawLine(xcenter, ycenter, xs, ys); g2.setStroke(new BasicStroke(2.0f)); g.drawLine(xcenter, ycenter, xm, ym); g2.setStroke(new BasicStroke(3.0f)); g.drawLine(xcenter, ycenter, xh, yh); lastxs = xs; lastys = ys; //保存指针位置 lastxm = xm; lastym = ym; lastxh = xh; lastyh = yh; //super.paint(g); }*/ @Override public void run() { while (true) { try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } repaint(0,70,300,500); } } @Override public void actionPerformed(ActionEvent e) { } } //日历面板 class CalendarPanel extends JPanel implements ActionListener { private JPanel selectPanel;//主面板上方有:月份减少按钮 ,选择月份 年份按钮,月份增加按钮 private JPanel showPanel;//该面板有三种显示状态,一种显示日历,一种显示选择月份,一种显示选择年份 private JPanel weekdayPanel;//该面板被添加到showPanel,用于静态显示周一到周日 private JPanel calshowPanel;//该面板被添加到showPanel,用于显示一月中的每一天 private JPanel selectMonth;//该面板被添加到showPanel,用于显示一年中的所有月份 private JPanel selectYear;//该面板被添加到showPanel,用于显示年份的按钮 private JButton btleft;//selectPanel中的三个按钮 private JButton btmid; private JButton btright; private Button[] btday = new Button[42]; private Button[] btmouth = new Button[12]; private Button[] btyear = new Button[12]; private Calendar curcalendar;//记录当前日历上显示的日期 private JFrame jFrame;//存储parent的JFrame,用于调用其setVisible更新界面 public CalendarPanel(JFrame jFrame) { this.jFrame = jFrame; setLayout(null);//设置布局为null setBackground(new Color(143, 241, 219)); selectPanel = new JPanel(); selectPanel.setBackground(new Color(193, 241, 151)); selectPanel.setBounds(0, 0, 500, 50);//设置该面板相对于容器的位置和大小 selectPanel.setLayout(null); add(selectPanel); btleft = new JButton("<"); btleft.setBounds(50, 10, 50, 30); btleft.addActionListener(this); selectPanel.add(btleft); btmid = new JButton(""); btmid.setBounds(175, 10, 150, 30); btmid.addActionListener(this); selectPanel.add(btmid); btright = new JButton(">"); btright.setBounds(400, 10, 50, 30); btright.addActionListener(this); selectPanel.add(btright); weekdayPanel = new JPanel(); weekdayPanel.setBounds(0, 0, 490, 20); weekdayPanel.setBackground(new Color(83, 199, 241)); weekdayPanel.setLayout(new GridLayout(1, 7)); weekdayPanel.setBorder(BorderFactory.createLineBorder(Color.black)); weekdayPanel.add(new JLabel("日", JLabel.CENTER)); weekdayPanel.add(new JLabel("一", JLabel.CENTER)); weekdayPanel.add(new JLabel("二", JLabel.CENTER)); weekdayPanel.add(new JLabel("三", JLabel.CENTER)); weekdayPanel.add(new JLabel("四", JLabel.CENTER)); weekdayPanel.add(new JLabel("五", JLabel.CENTER)); weekdayPanel.add(new JLabel("六", JLabel.CENTER)); calshowPanel = new JPanel(); calshowPanel.setBounds(0, 130, 500,430); calshowPanel.setLayout(new GridLayout(6, 7));//6行7列的网格布局 for (int i = 0; i < 42; i++) { btday[i] = new Button(); btday[i].setBackground(new Color(255,255,255));//new Color(202, 211, 221)灰色 btday[i].setFont(new Font("宋体", 4, 14));//设置字体 btday[i].addActionListener(this); } curcalendar = Calendar.getInstance();//返回当前时间,默认语言和默认环境的日历 int monthday = curcalendar.get(Calendar.DAY_OF_MONTH);//获取在当前月份的第几天 int weekday = curcalendar.get(Calendar.DAY_OF_WEEK);//获取在当前星期的第几天(星期日为第一天) System.out.println(monthday + "---" + weekday); int startcol = 7 - (monthday - weekday) % 7;//当月第一天是一个星期中的第几天 if (startcol > 7) { startcol = startcol%7; } System.out.println(startcol); String midbt_lab = curcalendar.get(Calendar.YEAR) + "年" + (curcalendar.get(Calendar.MONTH) + 1) + "月"; btmid.setText(midbt_lab); Calendar lastcalendar = (Calendar) curcalendar.clone(); lastcalendar.set(Calendar.DAY_OF_MONTH, 1); lastcalendar.add(Calendar.DAY_OF_MONTH, -startcol); int tablestart = lastcalendar.get(Calendar.DAY_OF_MONTH);//该页日历起始时是当月的第几天(例如日历上的第一天是25号) int k = 0; for (int i = 0; i < startcol; i++) { btday[k].setForeground(Color.GRAY); btday[k].setLabel((tablestart++) + ""); calshowPanel.add(btday[k++]); } for (int i = 1; i <= curcalendar.getActualMaximum(Calendar.DAY_OF_MONTH); i++) { btday[k].setForeground(Color.black); btday[k].setLabel(i + ""); if (curcalendar.get(Calendar.DAY_OF_MONTH) == i-1) { btday[i].setBackground(new Color(193, 241, 251)); } calshowPanel.add(btday[k++]); } for (int i = 1; i <= 42 - startcol - curcalendar.getActualMaximum(Calendar.DAY_OF_MONTH); i++) { btday[k].setForeground(Color.GRAY); btday[k].setLabel(i + ""); calshowPanel.add(btday[k++]); } showPanel = new JPanel(); showPanel.setBounds(0, 50, 500, 450); showPanel.setLayout(new BorderLayout()); showPanel.setBorder(BorderFactory.createLineBorder(Color.black)); showPanel.add(weekdayPanel, BorderLayout.NORTH); showPanel.add(calshowPanel, BorderLayout.CENTER); add(showPanel); //选择月份 selectMonth = new JPanel(new GridLayout(3, 4)); selectMonth.setBounds(0, 70, 500, 370); for (int i = 0; i < 12; i++) { btmouth[i] = new Button((i + 1) + "月"); btmouth[i].addActionListener(this); btmouth[i].setBackground(new Color(255,255,255)); btmouth[i].setFont(new Font("Dialog",5,18)); selectMonth.add(btmouth[i]); } //选择年份 selectYear = new JPanel(new GridLayout(3, 4)); selectYear.setBounds(0, 45, 500, 400); for (int i = 0; i < 12; i++) { btyear[i] = new Button((curcalendar.get(Calendar.YEAR) - 6 + i) + ""); btyear[i].addActionListener(this); btyear[i].setBackground(new Color(255,255,255)); btyear[i].setFont(new Font("Dialog",5,18)); selectYear.add(btyear[i]); } } //更新日历方法 private void updatebtday() { int monthday = curcalendar.get(Calendar.DAY_OF_MONTH);//当前日期(在一月中的第几天) int weekday = curcalendar.get(Calendar.DAY_OF_WEEK);//(在一周中的第几天) int startcol = 7 - (monthday - weekday) % 7;//第一天是星期几 if (startcol > 7) { startcol = startcol%7;; } Calendar lastcalendar = (Calendar) curcalendar.clone(); lastcalendar.set(Calendar.DAY_OF_MONTH, 1); lastcalendar.add(Calendar.DAY_OF_MONTH, -startcol); int tablestart = lastcalendar.get(Calendar.DAY_OF_MONTH); String midbt_lab = curcalendar.get(Calendar.YEAR) + "年" + (curcalendar.get(Calendar.MONTH) + 1) + "月"; btmid.setText(midbt_lab); int k = 0; for (int i = 0; i < startcol; i++) { btday[k].setForeground(Color.GRAY); btday[k++].setLabel((tablestart++) + ""); } for (int i = 1; i <= curcalendar.getActualMaximum(Calendar.DAY_OF_MONTH); i++) { btday[k].setForeground(Color.black); btday[k++].setLabel(i + ""); } for (int i = 1; i <= 42 - startcol - curcalendar.getActualMaximum(Calendar.DAY_OF_MONTH); i++) { btday[k].setForeground(Color.GRAY); btday[k++].setLabel(i + ""); } } @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == btmid) {//中间按钮 JPanel getPanel = (JPanel) showPanel.getComponent(0); if (getPanel == weekdayPanel) { btmid.setText(curcalendar.get(Calendar.YEAR) + ""); showPanel.removeAll(); showPanel.add(selectMonth); } else if (getPanel == selectMonth) { showPanel.removeAll(); showPanel.add(selectYear); btmid.setText((curcalendar.get(Calendar.YEAR) - 6) + "-" + (curcalendar.get(Calendar.YEAR) + 5)); } jFrame.setVisible(true); } else if (e.getSource() == btleft) {//左边按钮 JPanel getPanel = (JPanel) showPanel.getComponent(0);//获取容器中的第1个组件 if (getPanel == weekdayPanel) { int month1 = curcalendar.get(Calendar.MONTH); curcalendar.set(Calendar.MONTH, month1 - 1); updatebtday(); } else if (getPanel == selectMonth) { int year = curcalendar.get(Calendar.YEAR); curcalendar.set(Calendar.YEAR, year - 1); btmid.setText(curcalendar.get(Calendar.YEAR) + ""); } else { String str = btyear[0].getLabel(); int first = Integer.parseInt(str); for (int i = 11; i >= 0; i--) { btyear[i].setLabel((--first) + ""); } btmid.setText(first + "-" + (first + 11)); } } else if (e.getSource() == btright) { JPanel getPanel = (JPanel) showPanel.getComponent(0); if (getPanel == weekdayPanel) {//如得到的组件是星期Panel,那么更新日历 int month1 = curcalendar.get(Calendar.MONTH); curcalendar.set(Calendar.MONTH, month1 + 1); updatebtday(); } else if (getPanel == selectMonth) {//如果得到的组件是月份的Panel,那么更新年份 int year = curcalendar.get(Calendar.YEAR); curcalendar.set(Calendar.YEAR, year + 1); btmid.setText(curcalendar.get(Calendar.YEAR) + ""); } else { //如果是选择年份界面,那么改变年份和mid按钮 String str = btyear[11].getLabel(); int last = Integer.parseInt(str); for (int i = 0; i < 12; i++) { btyear[i].setLabel((++last) + ""); } btmid.setText((last - 11) + "-" + last); } } else if (((Button) e.getSource()).getForeground() == Color.GRAY) {//如果发生事件的为灰色按钮 String command = e.getActionCommand(); int com_int = Integer.parseInt(command); if (com_int > 20) {//大于20表明是上个月的,设置月份,调用更新月份的方法 int month3 = curcalendar.get(Calendar.MONTH); curcalendar.set(Calendar.MONTH, month3 - 1); } else if (com_int < 20) {//小于20为下个月的 int month3 = curcalendar.get(Calendar.MONTH); curcalendar.set(Calendar.MONTH, month3 + 1); } updatebtday(); } else if (((Button) e.getSource()).getForeground() == Color.black) { } else if (e.getSource() == btyear[0]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[1]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[2]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[3]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[4]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[5]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[6]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[7]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[8]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[9]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[10]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else if (e.getSource() == btyear[11]) { String str = e.getActionCommand(); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); showPanel.removeAll(); showPanel.add(selectMonth); btmid.setText(str); } else { switch (e.getActionCommand()) { case "1月": curcalendar.set(Calendar.MONTH, 0); break; case "2月": curcalendar.set(Calendar.MONTH, 1); break; case "3月": curcalendar.set(Calendar.MONTH, 2); break; case "4月": curcalendar.set(Calendar.MONTH, 3); break; case "5月": curcalendar.set(Calendar.MONTH, 4); break; case "6月": curcalendar.set(Calendar.MONTH, 5); break; case "7月": curcalendar.set(Calendar.MONTH, 6); break; case "8月": curcalendar.set(Calendar.MONTH, 7); break; case "9月": curcalendar.set(Calendar.MONTH, 8); break; case "10月": curcalendar.set(Calendar.MONTH, 9); break; case "11月": curcalendar.set(Calendar.MONTH, 10); break; case "12月": curcalendar.set(Calendar.MONTH, 11); break; default: String str = e.getActionCommand(); //String[] strs = str.split("月"); int year = Integer.parseInt(str); curcalendar.set(Calendar.YEAR, year); btmid.setText(curcalendar.get(Calendar.YEAR) + ""); showPanel.removeAll(); showPanel.add(selectMonth); return; } showPanel.removeAll(); updatebtday(); showPanel.add(weekdayPanel,BorderLayout.NORTH); showPanel.add(calshowPanel,BorderLayout.CENTER); jFrame.setVisible(true); } } }
-
推荐一个好用的桌面日历和倒数日纪念日管理工具
2020-06-22 16:22:42完美无缝替代 Windows 系统日历 好用的桌面日历和倒数日纪念日管理工具 功能强大无广告,还可以绑定微信提醒,强烈推荐哦。下载地址:https://www.youxiao.cn/yxcalendar/link?user_id=29412 桌面倒数日设置: 1、... -
Windows台式电脑怎么设置添加桌面日历透明便签?
2021-06-26 04:57:48职场人士使用的工作电脑,很多都是Windows台式电脑。为了方便快速记录和定时提醒自己处理工作中的一些临时或者紧急待办事项,有的办公族会在电脑桌面上使用日历便签,尤其是支持设置透明度的便签工具。那么Windows... -
Excel日历控件Mscomct2
2018-08-15 16:08:34如果你是win7 64位的操作系统,你要把MSCOMCT2.OCX 先复制到路径C:\Windows\SysWow64下, 2.然后在开始菜单-搜索 处输入:cmd 3.右键选择以管理员身份运行cmd.exe程序, 4.在弹出的dos窗口中输入:regsvr32 C:\... -
Win10系统日历新事件不能使用的解决方法
2021-07-31 07:35:387、再进入日历的界面,点击新事件就可以使用了(开启或关闭会还原默认值),虽然操作很简单,但是此法可以解决很多Windows10系统中的异常问题。 关于Win10系统日历新事件不能使用的解决方法就跟大家介绍到这边了,... -
微微万年历 v4.1.zip
2019-07-13 10:02:29或者依次打开我的电脑->卸载或更改程序->卸载你所卸载的软件,您可以用 Window XP控制面板中的添加或删除程序功能,或用 Windows Vista、Windows 7中的程序和功能删除微微万年历, 然后点击开始卸载,按步骤依次点击... -
组态王日历控件不显示的解决方法
2018-02-27 14:55:13win7 64位操作系统如何安装Microsoft Date and Time Picker Control 6.0(SP6)控件 我依下列步骤操作出现如附档【找不到模块】的错误信息 1.下载控件:http://activex.microsoft.com/controls/vb6/mscomct2.cab 2.... -
js实现日历
2021-01-18 17:02:45这周写自己的项目发现又用到日历了,加之自己毕业之后的第一个工作中遇到的任务也是需要写个日历(组员写了,我就不用写了) ...其中我们只要知道了每个月的 1日 是星期几,就能很容易地摆放后面的日 -
Java模仿实现Windows时钟日历
2017-05-27 18:19:16Java课程设计要求实现windows日历,所以简单做了下完整复制可以直接运行,但可能有bug,懒得搞了,直接上截图和代码。 时钟画的有点丑,不要在意这些嘛。win7下的时钟日历: 实现的界面: 完整代码:package ... -
飞雪桌面日历
2018-08-09 22:38:24飞雪桌面日历 不用安装,小巧而强大!及少的内存占用集合了超多功能:万年历、世界时钟、定时运行、定时关机、限时用机、休息提醒、备忘录、系统热键、光驱控制、文件清理、网络校时... Windows 2000/XP/2003/Vista/win7 -
Win10 19H1新版18290更新大全:日历整合To-Do
2020-12-24 11:38:3511月29日,微软向Windows 10快速通道Insider会员推送了全新的18290预览版。除了继续完善上一版Light Theme主题外,一个最大改进就是在邮件和日历应用中内嵌了Microsoft To-Do,能够直接跳转到待办清单。1、开始菜单... -
Windows 11正式版终于发布,最低配置要求来了
2021-10-06 00:27:01整理 :孙胜| 来源:CSDN(ID:CSDNnews)今天,微软开始正式推送Windows 11。“让用户与之所爱,更近一步。”这是微软日前官宣Windows 11正式推送日期时许下的愿... -
【源码】日历转换器:格里高利历、波斯历和伊斯兰历法
2020-11-18 17:33:13dateconv(Y,M,D,from_calend,to_calend)计算格里高利公历(“ce”)、波斯太阳历或日晷(“sh”)和伊斯兰历(“lh”)之间的日历转换。输出1x3数字数组向量[Y,M,D],和一个字符数组,该数组带有以波斯语、阿拉伯... -
windows7实验报告.doc
2021-07-27 03:16:00文档介绍:windows7实验报告篇一:Win7操作实验报告WINDOWS 7 上机实验报告七在D盘根目录上建立一个文件夹,文件夹的名字为自己的名字+“_win7_09”,完成后文件夹名如“张三_win7_09”。完成作业后将所有结果(屏幕截图... -
怎么把日历放到电脑桌面
2021-06-26 07:02:261. 如何把日历弄到电脑桌面上准备工具:电脑以WIN7系统为例1.打开电脑,在桌面面中点击开始选项,点击控制面板进入到控制面板页面中。2.在新弹出的控制面板页面找到外观和个性化选项,点击选择该选项进入到个性化... -
win10系统自带的日历hover效果
2018-06-20 11:46:053.用js选中下面的区块,使用的是 td[i+6],td[i+7],td[i+8],但如果选中的是最后一行,那么这三项是超出td的范围的,会提示undefined,我们是用 td[i+6] || dom ,dom为设置的一个隐藏的节点,意思是,td[i+6] ...