小技巧
图片控件的使用:Image/ImageView
new ImageView(new Image(url,宽,高,true,true))
--绝对路径: file:D:\\图片\\6.jpg
--相对路径: src里面建了个文件夹 images/1.png
滑块:Slider show(true) major(10) getValue()
保留2位小数:String.format("%.2f",jg)
文本域:TextArea width height 自带滚动条
ta.getText()
文件选择器:FileChooser 后缀 File file 绝对路径
日期选择器:DatePicker getValue
颜色选择器:ColorPicker getValue Color
深入下拉框(值类型)
ChoiceBox<Type>
重构其toString()方法
设置转换器 cb.setConverter()
布局参考
布局分析
数据库脚本
USE [db_goodsManager]
DELETE FROM tb_goods
DELETE FROM tb_type
SET IDENTITY_INSERT [dbo].[tb_type] ON
INSERT [dbo].[tb_type] ([tid], [tname]) VALUES (1, N'水果')
INSERT [dbo].[tb_type] ([tid], [tname]) VALUES (2, N'化妆品')
INSERT [dbo].[tb_type] ([tid], [tname]) VALUES (3, N'服装')
INSERT [dbo].[tb_type] ([tid], [tname]) VALUES (4, N'零食')
INSERT [dbo].[tb_type] ([tid], [tname]) VALUES (5, N'生活用品')
SET IDENTITY_INSERT [dbo].[tb_type] OFF
SET IDENTITY_INSERT [dbo].[tb_goods] ON
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (1,N'榴莲1', 1, 98.9, N'水果之王', N'images/s1.jpg', CAST(0x0000AF3400000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (2,N'山竹1', 1, 35.2, N'解乏止渴', N'images/s2.jpg', CAST(0x0000AE2400000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (3,N'柠檬1', 1, 16.1, N'维C多多', N'images/s3.jpg', CAST(0x0000AE6300000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (4,N'西瓜1', 1, 29.9, N'解暑神器', N'images/s6.jpg', CAST(0x0000AF1C00000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (5,N'榴莲2', 1, 98.8, N'水果之王', N'images/s1.jpg', CAST(0x0000AE9C00000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (6,N'山竹2', 1, 35.8, N'解乏止渴', N'images/s2.jpg', CAST(0x0000AF1800000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (7,N'柠檬2', 1, 16.45, N'维C多多', N'images/s3.jpg', CAST(0x0000AE4700000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (8,N'西瓜2', 1, 29.6, N'解暑神器', N'images/s6.jpg', CAST(0x0000AF1D00000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (9,N'榴莲3', 1, 28.7, N'水果之王', N'images/s1.jpg', CAST(0x0000AEDA00000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (10,N'山竹3', 1, 25.9, N'解乏止渴', N'images/s2.jpg', CAST(0x0000AE8000000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (11,N'柠檬3', 1, 16.5, N'维C多多', N'images/s3.jpg', CAST(0x0000AF3900000000 AS DateTime))
INSERT [dbo].[tb_goods] ([gid],[gname], [tid], [gprice], [ginfo], [gpath], [gtime]) VALUES (12,N'西瓜3', 1, 29.1, N'解暑神器', N'images/s6.jpg', CAST(0x0000AEC200000000 AS DateTime))
SET IDENTITY_INSERT [dbo].[tb_goods] OFF
SELECT * FROM tb_goods
SELECT * FROM tb_type
一、菜单栏 菜单 菜单项
MenuBar Menu MenuItem二、工具栏&菜单按钮
ToolBar Button MenuButton三、选项面板 选项
TabPane Tab四、分割面板 上左右布局
SplitPane五、滚动面板
ScrollPane setContent()六、折叠面板(手风琴) 标题面板
Accordion TitledPane