Java語言程序設計10E LiangPPT習題案例14slide.ppt


'Java語言程序設計10E LiangPPT習題案例14slide.ppt'
*Chapter 14 JavaFX Basics*MotivationsJavaFX is a new framework for developing Java GUI programs. The JavaFX API is an excellent example of how the object-oriented principle is applied. This chapter serves two purposes. First, it presents the basics of JavaFX programming. Second, it uses JavaFX to demonstrate OOP. Specifically, this chapter introduces the framework of JavaFX and discusses JavaFX GUI components and their relationships. *ObjectivesTo distinguish between JavaFX, Swing, and AWT (§14.2).To write a simple JavaFX program and understand the relationship among stages, scenes, and nodes (§14.3).To create user interfaces using panes, UI controls, and shapes (§14.4).To use binding properties to synchronize property values (§14.5).To use the common properties style and rotate for nodes (§14.6).To create colors using the Color class (§14.7).To create fonts using the Font class (§14.8).To create images using the Image class and to create image views using the ImageView class (§14.9).To layout nodes using Pane, StackPane, FlowPane, GridPane, BorderPane, HBox, and VBox (§14.10).To display text using the Text class and create shapes using Line, Circle, Rectangle, Ellipse, Arc, Polygon, and Polyline (§14.11).To develop the reusable GUI components ClockPane for displaying an analog clock (§14.12).*JavaFX vs Swing and AWTSwing and AWT are replaced by the JavaFX platform for developing rich Internet applications.When Java was introduced, the GUI classes were bundled in a library known as the Abstract Windows Toolkit (AWT). AWT is fine for developing simple graphical user interfaces, but not for developing comprehensive GUI projects. In addition, AWT is prone to platform-specific bugs. The AWT user-interface components were replaced by a more robust, versatile, and flexible library known as Swing components. Swing components are painted directly on canvases using Java code. Swing components depend less on the target platform and use less of the native GUI resource. With the release of Java 8, Swing is replaced by a completely new GUI platform known as JavaFX. *Basic Structure of JavaFXApplicationOverride the start(Stage) methodStage, Scene, and NodesRunMyJavaFXRunMultipleStageDemo*Panes, UI Controls, and ShapesRunButtonInPane*Display a ShapeThis example displays a circle in the center of the pane.RunShowCircle*Binding PropertiesJavaFX introduces a new concept called binding property that enables a target object to be bound to a source object. If the value in the source object changes, the target property is also changed automatically. The target object is simply called a binding object or a binding property. RunShowCircleCentered*Binding Property: getter, setter, and property getter *Uni/Bidirectional BindingRunBidirctionalBindingDemo*Common Properties and Methods for Nodes style: set a JavaFX CSS stylerotate: Rotate a nodeRunNodeStyleRotateDemo*The Color Class*The Font ClassRunFontDemo*The Image Class*The ImageView ClassRunShowImage*Layout PanesJavaFX provides many types of panes for organizing nodes in a container.*FlowPaneRunShowFlowPane*GridPaneRunShowGridPane*BorderPaneRunShowBorderPane*HBox*VBoxRunShowHBoxVBox*ShapesJavaFX provides many shape classes for drawing texts, lines, circles, rectangles, ellipses, arcs, polygons, and polylines.*Text*Text ExampleRunShowText*LineRunShowLine*Rectangle*Rectangle ExampleRunShowRectangle*Circle*EllipseRunShowEllipse*Arc*Arc ExamplesRunShowArc*Polygon and PolylineRunShowArc*PolygonRunShowPolygon*Case Study: The ClockPane ClassThis case study develops a class that displays a clock on a pane.ClockPane*Use the ClockPane ClassRunDisplayClock
關 鍵 詞:
liangppt 習題 10 10e 案例 14slide 程序設計 語言 14 java
本文標題:Java語言程序設計10E LiangPPT習題案例14slide.ppt
關于我們 - 網站聲明 - 網站地圖 - 資源地圖 - 友情鏈接 - 網站客服點擊這里,給天天文庫發消息,QQ:1290478887 - 聯系我們

本站為“文檔C2C交易模式”,即用戶上傳的文檔直接賣給(下載)用戶,本站只是中間服務平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有【成交的100%(原創)】。本站是網絡服務平臺方,若您的權利被侵害,侵權客服QQ:1290478887 歡迎舉報。

[email protected] 2017-2027 網站版權所有


球探网即时蓝球比分 淘宝广西快三开奖结果定牛 内蒙古快三彩票平台 河北燕风采排列7开奖结果 双色球基本出号走势图 查询湖南快乐十分的开奖结果 双面盘是什么意思 体育彩票怎么玩法介绍 河南体彩十一选五开奖 安徽快三投注 浙江十一选五开奖结果大乐