急!!! 求一个java编写的记事本代码 能够完成打开、保存、另存为、设置字体。

额最好是有一点点的注释顺便问一下我把所有的都写在了主函数里面可以吗... 额 最好是有一点点的注释 顺便问一下 我把所有的都写在了主函数里面 可以吗 展开
 我来答
手机用户29762
2011-08-24 · TA获得超过303个赞
知道小有建树答主
回答量:628
采纳率:100%
帮助的人:368万
展开全部
我以前做过一个,不过功能有所不同,有菜单和弹出菜单,字体设置,字型设置,颜色等,给你做一下参考。
留下邮箱给你发过去。
源代码:
Private Sub Blue_Click()
Text1.ForeColor = vbBlue
End Sub

Private Sub Form_Load()
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Bld.Checked = False
Itl.Checked = False
Undrln.Checked = False
End Sub

Private Sub Green_Click()
Text1.ForeColor = vbGreen
End Sub
Private Sub bld_click()
Text1.FontBold = Not Text1.FontBold
Bld.Checked = Not Bld.Checked
End Sub
Private Sub Itl_click()
Text1.FontItalic = Not Text1.FontBold
Itl.Checked = Not Itl.Checked
End Sub
Private Sub Undrln_click()
Text1.FontUnderline = Not Text1.FontUnderline
Undrln.Checked = Not Undrln.Checked
End Sub
Private Sub Red_Click()
Text1.ForeColor = vbRed
End Sub

Private Sub Text1_Change()
If Text1 = "" Then
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Else
Red.Enabled = True
Blue.Enabled = True
Green.Enabled = True
End If
End Sub

Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then '如果是鼠标右键按下时
Text1.Enabled = False '使文本框无效
Form1.PopupMenu Fon '弹出右键菜单
Text1.Enabled = True '再次使文本框有效
End If
End Sub
追问
529804464@qq.com   十分感谢!!!
o散落的流年O
2011-08-24
知道答主
回答量:21
采纳率:0%
帮助的人:13.6万
展开全部
有菜单和弹出菜单,字体设置,字型设置,颜色等,给你做一下参考。

源代码:
Private Sub Blue_Click()
Text1.ForeColor = vbBlue
End Sub

Private Sub Form_Load()
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Bld.Checked = False
Itl.Checked = False
Undrln.Checked = False
End Sub

Private Sub Green_Click()
Text1.ForeColor = vbGreen
End Sub
Private Sub bld_click()
Text1.FontBold = Not Text1.FontBold
Bld.Checked = Not Bld.Checked
End Sub
Private Sub Itl_click()
Text1.FontItalic = Not Text1.FontBold
Itl.Checked = Not Itl.Checked
End Sub
Private Sub Undrln_click()
Text1.FontUnderline = Not Text1.FontUnderline
Undrln.Checked = Not Undrln.Checked
End Sub
Private Sub Red_Click()
Text1.ForeColor = vbRed
End Sub

Private Sub Text1_Change()
If Text1 = "" Then
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Else
Red.Enabled = True
Blue.Enabled = True
Green.Enabled = True
End If
End Sub

Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then '如果是鼠标右键按下时
Text1.Enabled = False '使文本框无效
Form1.PopupMenu Fon '弹出右键菜单
Text1.Enabled = True '再次使文本框有效
End If
End Sub
追问
额  看不懂啊
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式