|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/practical-javafx/
课程评论:没有评论
Coursera 课程《Practical JavaFX: GUI Architecture for Beginners》旨在帮助学习者从基础程序过渡到专业应用程序。课程以构建一个真实的自助结账机为例,介绍更高级的设计概念。 **核心内容包括:** * **UI 基础:** 了解基本的 JavaFX 应用程序和构建 UI 的工具。 * **应用构建:** 逐步开发自助结账应用程序,包括界面设计和导航系统的建立。 * **事件处理与数据管理:** 利用事件机制集成虚拟条形码扫描器,并通过 JavaFX 属性(Properties)实现 UI 与数据的实时绑定,展示扫描的商品信息。 * **自定义组件:** 创建自定义 UI 组件,以专业的方式展示商品。 * **样式设计:** 使用 CSS 对应用程序进行美化,保持风格一致。 * **支付功能:** 开发支付界面,集成投币机设备,利用属性和绑定计算和显示支付及找零金额。课程还将介绍控制器生命周期事件,用于关键的清理工作,并实现硬币接收与找零逻辑。 * **收据生成:** 构建收据屏幕和收据打印机设备,从模型中提取数据并格式化成收据显示。 课程中还会探讨比依赖注入(DI)更简洁的实现方式,以达到类似目的并突出 DI 的优势,同时关注组件生命周期管理,以及如何处理组件在任意时机创建和销毁时可能出现的细微错误。
The goal of this course is to help learners bridge the gap between basic programs and professional applications. This is achieved by building something found in the real world, a self-checkout machine, and by introducing more advanced concepts into the design. For example, real-world applications often use dependency injection (DI) for objects' dependencies. We instead use a simpler method that achieves a similar purpose but also clarifies the usefulness of DI. We also dip our toes into component lifecycles and how subtle bugs can arise when components may be created and destroyed at any time. Therefore we crucially manage these lifecycles.In part one of the course, we look at a basic JavaFX application and the fundamental tools at our disposal for building JavaFX UIs.In part two, we dive into writing the self-checkout application, starting with an overview of the various classes and then building out the first two screens as well as creating a systematic way to navigate between them.In part three, we create a virtual barcode scanner and hook it up to the main application using events. When a barcode is scanned, we look up the product and store this data in an appropriate place (the model). We make use of JavaFX properties, which are like supercharged variables. Properties enable us to bind the UI to the data so that the UI updates in real time. We also create custom UI components which are necessary to display scanned products to the customer in a clean and professional way.In part four, we use CSS and stylesheets give the application a clean and consistent styling.In part five, we move on to enabling payment. We create the payment screen along with the coin machine device. We calculate and display various figures such as the payment and the customer's change using properties and bindings. We change the way money is represented to give us more control over its implementation. We introduce a lifecycle event to inform us of the destruction of our controllers to enable crucial clean-up. We create a mechanism for accepting or rejecting coins and giving the correct amount of change based on the coins available.In part six, we create the receipt screen and receipt printer device. We pull the data from the model and format it into a suitable receipt and show it on the screen.