1 00:00:00,190 --> 00:00:02,420 As you know, Java's been around for a while. 2 00:00:02,420 --> 00:00:05,030 And the way to develop rich GUI applications with Java 3 00:00:05,030 --> 00:00:07,240 has evolved quite a bit over the years. 4 00:00:07,240 --> 00:00:09,930 I want to take you on a little history tour real quick, 5 00:00:09,930 --> 00:00:12,420 as you will see the predecessors mentioned and referenced. 6 00:00:13,650 --> 00:00:16,370 The first thing to remember is that Java is intended to be, 7 00:00:16,370 --> 00:00:18,650 write once, run anywhere. 8 00:00:18,650 --> 00:00:22,460 As you know, different operating systems have a different way of looking. 9 00:00:22,460 --> 00:00:24,480 Now, by different, I mean the native style. 10 00:00:24,480 --> 00:00:27,360 You know, like, the window is rounded or sharp. 11 00:00:27,360 --> 00:00:29,470 The checkbox has depth or it doesn't. 12 00:00:29,470 --> 00:00:30,360 The scroll bar is around it. 13 00:00:30,360 --> 00:00:31,620 You know, stuff like that. 14 00:00:31,620 --> 00:00:36,071 So, in the very beginning there was a set of tools created called 15 00:00:36,071 --> 00:00:38,801 the Abstract Window Toolkit, or AWT. 16 00:00:38,801 --> 00:00:43,625 What AWT provided was a way to expose a very thin layer that would actually create 17 00:00:43,625 --> 00:00:46,245 a native window and add a native controls. 18 00:00:46,245 --> 00:00:50,290 While this was handy, designers didn't necessarily like how the same half looked 19 00:00:50,290 --> 00:00:51,520 different on different platforms. 20 00:00:52,530 --> 00:00:54,840 Now in addition to the cosmetic differences, 21 00:00:54,840 --> 00:00:58,380 the way that you interacted with them was a little bit different on each platform, 22 00:00:58,380 --> 00:01:02,280 and therefore, some deep knowledge was needed about all of the platforms. 23 00:01:02,280 --> 00:01:05,250 Now these differences, often called quirks, 24 00:01:05,250 --> 00:01:07,820 is a problem that plagues web browsers to this day. 25 00:01:07,820 --> 00:01:08,830 It is not fun. 26 00:01:10,080 --> 00:01:15,410 So, a couple of groups started projects to attempt to fix this quirky problem and 27 00:01:15,410 --> 00:01:21,720 they ended up merging together into one called the Java Foundation Classes or JFC. 28 00:01:21,720 --> 00:01:26,410 These were later renamed to Swing and added to Java, since its release 1.2, 29 00:01:26,410 --> 00:01:30,710 which was released in late 1998. 30 00:01:30,710 --> 00:01:32,860 Swing took a different approach. 31 00:01:32,860 --> 00:01:37,400 It decided to render all of its components instead of relying on native components, 32 00:01:37,400 --> 00:01:39,110 like check box and input field. 33 00:01:39,110 --> 00:01:40,590 This is known as lightweight UI. 34 00:01:40,590 --> 00:01:45,010 Now, under the covers, it in fact is still using AWT for 35 00:01:45,010 --> 00:01:47,920 capturing input like keyboard pressing and mouse movements. 36 00:01:47,920 --> 00:01:50,040 But it uses its own interface completely. 37 00:01:51,100 --> 00:01:53,570 Swing introduced the concept of a pluggable look and 38 00:01:53,570 --> 00:01:55,950 feel, also known as skinning. 39 00:01:55,950 --> 00:01:58,560 What this means was you were able to change the way that 40 00:01:58,560 --> 00:02:02,650 all of the components looked at once, to a completely different look. 41 00:02:02,650 --> 00:02:06,340 Now Swing had a great run, and it introduced many advanced component types, 42 00:02:06,340 --> 00:02:09,860 such as tabs, trees, tables, and lists. 43 00:02:09,860 --> 00:02:11,520 Swing had widespread acceptance, and 44 00:02:11,520 --> 00:02:17,680 it was the de facto way to build Java GUI applications for nearly a decade. 45 00:02:17,680 --> 00:02:21,990 In late 2008, a new contender came on the scene, JavaFX. 46 00:02:21,990 --> 00:02:26,200 Now at first, as expected, it received mixed reviews. 47 00:02:26,200 --> 00:02:29,880 The first version introduced a new scripting language called JavaFX Script. 48 00:02:31,040 --> 00:02:31,560 No. 49 00:02:31,560 --> 00:02:34,640 By version two, this was scrapped, and now, things are just native Java. 50 00:02:36,290 --> 00:02:40,300 JavaFX has matured, and releases now follow Java's releases. 51 00:02:40,300 --> 00:02:46,680 So, JavaFX8 follows JavaSE8, which was released in 2014. 52 00:02:46,680 --> 00:02:50,970 And the release for Java FX9 will follow JavaSE9. 53 00:02:52,680 --> 00:02:58,110 JavaFX is intended to be the GUI solution for Java, replacing Swing. 54 00:02:58,110 --> 00:03:01,870 It and Swing are included in the Java SE Java Runtime edition. 55 00:03:02,920 --> 00:03:05,770 Both will be around for a considerable time though, and 56 00:03:05,770 --> 00:03:07,310 they interoperate well together. 57 00:03:07,310 --> 00:03:10,370 For instance, you can have a JavaFX component embedded in your Swing 58 00:03:10,370 --> 00:03:12,330 application, and vice versa. 59 00:03:12,330 --> 00:03:13,930 JavaFX supports Swing components. 60 00:03:15,330 --> 00:03:19,320 Things that you learned in JavaFX will more or less, directly translate into 61 00:03:19,320 --> 00:03:23,020 other UI frameworks that you encounter, including Swing. 62 00:03:23,020 --> 00:03:26,740 So with that little Java GUI history lesson in place, 63 00:03:26,740 --> 00:03:29,160 let's go spend sometime getting to know JavaFX.