{"id":6334,"date":"2021-07-29T01:09:07","date_gmt":"2021-07-28T18:09:07","guid":{"rendered":"https:\/\/www.phidgets.com\/education\/?page_id=6334"},"modified":"2022-08-26T00:18:14","modified_gmt":"2022-08-25T17:18:14","slug":"java-gui","status":"publish","type":"page","link":"https:\/\/www.phidgets.com\/education\/learn\/projects\/java-gui\/","title":{"rendered":"Java &#8211; Graphical User Interfaces"},"content":{"rendered":"<p>[et_pb_section bb_built=&#8221;1&#8243; specialty=&#8221;off&#8221; next_background_color=&#8221;#000000&#8243; _builder_version=&#8221;4.4.1&#8243; custom_padding=&#8221;||0px|&#8221; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;][et_pb_row _builder_version=&#8221;4.4.1&#8243; use_custom_gutter=&#8221;on&#8221; gutter_width=&#8221;3&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;][et_pb_column type=&#8221;1_2&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Java &#8211; Graphical User Interfaces&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<\/p>\n<div class=\"ph-overline-text\"><!-- [et_pb_line_break_holder] -->    <a href=\"\/education\/learn\/projects\">Projects<\/a><!-- [et_pb_line_break_holder] -->    <\/div>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<h1>Java &#8211; Graphical User Interfaces<\/h1>\n<p>[\/et_pb_code][et_pb_code admin_label=&#8221;Description&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<pee>In this project, you will learn how to use Phidgets with Java to create a Graphical User Interface (GUI, pronounced &#8220;gooey&#8221;).<\/pee>[\/et_pb_code][et_pb_code admin_label=&#8221;ph-button-cta: Start&#8221; _builder_version=&#8221;4.4.1&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<a class=\"ph-button-cta\" href=\"#setup\"><!-- [et_pb_line_break_holder] -->  <\/p>\n<div class=\"ph-button-cta__icon\"><\/div>\n<p><!-- [et_pb_line_break_holder] -->  Start<!-- [et_pb_line_break_holder] --><\/a>[\/et_pb_code][\/et_pb_column][et_pb_column type=&#8221;1_2&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221;][et_pb_image _builder_version=&#8221;4.6.6&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_title.png&#8221; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; align=&#8221;center&#8221; \/][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section bb_built=&#8221;1&#8243; specialty=&#8221;on&#8221; _builder_version=&#8221;4.4.1&#8243; use_custom_gutter=&#8221;on&#8221; gutter_width=&#8221;3&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; prev_background_color=&#8221;#000000&#8243;][et_pb_column type=&#8221;1_4&#8243;][et_pb_code admin_label=&#8221;ph-vertical-nav&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; saved_tabs=&#8221;all&#8221;]<\/p>\n<div class=\"ph-vertical-nav ph-vertical-sticky\"><!-- [et_pb_line_break_holder] -->  <a href=\"#prereq\" class=\"ph-vertical-nav-item\">Prerequisites<\/a><!-- [et_pb_line_break_holder] -->  <a href=\"#setup\" class=\"ph-vertical-nav-item\">Setup<\/a><!-- [et_pb_line_break_holder] -->  <a href=\"#create\" class=\"ph-vertical-nav-item\">Create Project<\/a><!-- [et_pb_line_break_holder] -->  <a href=\"#runcode\" class=\"ph-vertical-nav-item\">Run Code<\/a><!-- [et_pb_line_break_holder] -->  <a href=\"#practice\" class=\"ph-vertical-nav-item\">Practice<\/a><!-- [et_pb_line_break_holder] --><\/div>\n<p>[\/et_pb_code][\/et_pb_column][et_pb_column type=&#8221;3_4&#8243; specialty_columns=&#8221;3&#8243;][et_pb_row_inner _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; module_id=&#8221;prereq&#8221;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221;Prerequisites&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<\/p>\n<h2>Prerequisites<\/h2>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<ul><!-- [et_pb_line_break_holder] --><\/p>\n<li>This project assumes you have a basic understanding of GUIs with Java. If you do not, we recommend reviewing a tutorial from such as <a href=\"https:\/\/netbeans.apache.org\/kb\/docs\/java\/quickstart-gui.html\" target=\"_blank\" rel=\"noopener noreferrer\">Designing a Swing GUI in NetBeans IDE<\/a> or <a href=\"https:\/\/www.eclipse.org\/windowbuilder\/\" target=\"_blank\" rel=\"noopener noreferrer\">Window Builder with Eclipse IDE<\/a>.<\/li>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<li>This project assumes you have completed the Getting Started Kit Advanced Lessons on events and error handling.<\/li>\n<p><!-- [et_pb_line_break_holder] --><\/ul>\n<p>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; module_id=&#8221;prereq&#8221;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221;Note&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<\/p>\n<h2>NetBeans and Eclipse<\/h2>\n<p><!-- [et_pb_line_break_holder] --><pee>This project is only available for Java with NetBeans and Java with Eclipse. <a class=\"ph-toggle-settings\">Set your language<\/a> so we can display relevant code examples<\/pee>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; module_id=&#8221;setup&#8221;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221;Setup&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<\/p>\n<h2>Setup<\/h2>\n<p><!-- [et_pb_line_break_holder] --><pee>All you need for this project is the Getting Started Kit.<\/strong><\/pee>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner _builder_version=&#8221;4.4.1&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; custom_padding=&#8221;||0px|&#8221;][et_pb_column_inner type=&#8221;1_3&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221;Part: GSK&#8221; _builder_version=&#8221;4.18.0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; saved_tabs=&#8221;all&#8221; background_pattern_color=&#8221;rgba(0,0,0,0.2)&#8221; background_mask_color=&#8221;#ffffff&#8221; global_module=&#8221;8489&#8243;]<\/p>\n<div class=\"ph-part-card\"><!-- [et_pb_line_break_holder] -->  <\/p>\n<div class=\"ph-part-card__top\"><!-- [et_pb_line_break_holder] -->    <\/p>\n<div class=\"ph-part-card__type\"><!-- [et_pb_line_break_holder] -->      <\/p>\n<div class=\"ph-overline-text\"><!-- [et_pb_line_break_holder] -->        <a href=\"\">Kit\/<\/a><!-- [et_pb_line_break_holder] -->        <a href=\"\">Getting Started Kit<\/a><!-- [et_pb_line_break_holder] -->      <\/div>\n<p><!-- [et_pb_line_break_holder] -->    <\/div>\n<p><!-- [et_pb_line_break_holder] -->    <\/p>\n<div class=\"ph-part-card__title\"><!-- [et_pb_line_break_holder] -->      <\/p>\n<h3>Getting Started Kit<\/h3>\n<p><!-- [et_pb_line_break_holder] -->    <\/div>\n<p><!-- [et_pb_line_break_holder] -->  <\/div>\n<p><!-- [et_pb_line_break_holder] -->  <\/p>\n<div class=\"ph-part-card__bottom\"><!-- [et_pb_line_break_holder] -->    <img decoding=\"async\" src=\"\/education\/wp-content\/uploads\/2022\/08\/KIT4003_2_Square.jpg\" ><!-- [et_pb_line_break_holder] -->  <\/div>\n<p><!-- [et_pb_line_break_holder] --><\/div>\n<p>[\/et_pb_code][\/et_pb_column_inner][et_pb_column_inner type=&#8221;1_3&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][\/et_pb_column_inner][et_pb_column_inner type=&#8221;1_3&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner admin_label=&#8221;Row&#8221; disabled_on=&#8221;off|off|off&#8221; disabled=&#8221;off&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; module_id=&#8221;create&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221; (invisible anchor)&#8221; _builder_version=&#8221;4.4.1&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; module_id=&#8221;move&#8221; module_class=&#8221;ph-hidden-anchor&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner admin_label=&#8221;Row&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; module_class=&#8221;ph-user-netbeans&#8221;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221;NETBEANS &#8211; Download Phidget Java Folder&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h2>Create Project (NetBeans)<\/h2>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<h3>Download Java Folder<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Before starting, download and extract the <a href=\"https:\/\/www.phidgets.com\/downloads\/phidget22\/libraries\/windows\/edu\/Phidget22Java.zip\">Phidget Java Folder<\/a> (you will use this in step 3)<\/pee>[\/et_pb_code][et_pb_video _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/09\/java_windows_extract.mp4&#8243; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 1&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 1<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Open NetBeans and select <strong>File > New Project<\/strong> to create a new Java Application.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_netbeans_new.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 2&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 2<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Name the project <em>GettingStartedGUI<\/em> and place it in the location of your choice. Make sure to uncheck <strong>Create Main Class<\/strong> and then press <strong>Finish<\/strong>.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_netbeans_uncheck.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 3&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 3<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>After creating your project, right-click on <strong>Libraries<\/strong> and click on <strong>Add JAR\/Folder&#8230;<\/strong><\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_netbeans_addjar.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 4&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 4<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Navigate to the folder you downloaded and extracted and select the <strong>phidget22.jar<\/strong> file.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/04\/java_netbeans_8.jpg&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 5&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 5<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Next, navigate to the <strong>Windows<\/strong> tab and select the <strong>Files<\/strong> option.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/09\/java_netbeans_files.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 6&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 6<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Transfer the other Phidget library files to your project.<\/pee>[\/et_pb_code][et_pb_video _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/09\/java_netbeans_dll_transfer.mp4&#8243; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 7&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 7<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Create a new <strong>JFrame<\/strong> called <i>MainFrame<\/i>.<\/pee>[\/et_pb_code][et_pb_video _builder_version=&#8221;4.6.6&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_netbeans_jframe.mkv&#8221; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 8&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 8<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Place a button on your window and title it <strong>LED On<\/strong>. Generate an event for the button.<\/pee>[\/et_pb_code][et_pb_video _builder_version=&#8221;4.6.6&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_netbeans_button.mkv&#8221; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 9&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 9<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>In the design tab, click on your window. Next, under JFrame properties, click <strong>Events<\/strong> and find the <strong>windowOpened<\/strong> event. Click on the dropdown menu and select <strong>formWindowOpened<\/strong><\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_netbeans_windowopened.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 10&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 10<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Review the code below and add the relevant sections to your MainFrame.java file. Hover over the comments below for more information about specific sections of the code. <strong>Note:<\/strong> Due to the way NetBeans generates code for GUIs, full code is not provided. You must place the code below into the relevant areas of your code.<\/pee>[\/et_pb_code][et_pb_code admin_label=&#8221;Code Sample&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<\/p>\n<pre class=\"language-java\"><!-- [et_pb_line_break_holder] -->  <code><!-- [et_pb_line_break_holder] -->    \/\/Add Phidgets Library<!-- [et_pb_line_break_holder] -->    import com.phidget22.*;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->    \/\/Define | Define object here so it can be used throughout your program.<!-- [et_pb_line_break_holder] -->    private static DigitalOutput redLED;<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->        try {<!-- [et_pb_line_break_holder] -->                \/\/Change button text<!-- [et_pb_line_break_holder] -->                if (redLED.getState()){<!-- [et_pb_line_break_holder] -->                    jButton1.setText(\"LED On\");<!-- [et_pb_line_break_holder] -->                }<!-- [et_pb_line_break_holder] -->                else{<!-- [et_pb_line_break_holder] -->                    jButton1.setText(\"LED Off\");<!-- [et_pb_line_break_holder] -->                }<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->                \/\/Flip LED state<!-- [et_pb_line_break_holder] -->                redLED.setState(!redLED.getState());<!-- [et_pb_line_break_holder] -->            }<!-- [et_pb_line_break_holder] -->            catch (PhidgetException e) {};<!-- [et_pb_line_break_holder] -->    }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->    private void formWindowOpened(java.awt.event.WindowEvent evt) {<!-- [et_pb_line_break_holder] -->        try {<!-- [et_pb_line_break_holder] -->        \/\/Create<!-- [et_pb_line_break_holder] -->        redLED = new DigitalOutput();<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Address<!-- [et_pb_line_break_holder] -->        redLED.setHubPort(1);<!-- [et_pb_line_break_holder] -->        redLED.setIsHubPortDevice(true);<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Attach Listener | Use this to control the button on the GUI. If the Phidget is attached, the button will be enabled.<!-- [et_pb_line_break_holder] -->        redLED.addAttachListener(new AttachListener() {<!-- [et_pb_line_break_holder] -->            public void onAttach(AttachEvent e) {<!-- [et_pb_line_break_holder] -->                jButton1.setEnabled(true);<!-- [et_pb_line_break_holder] -->            }<!-- [et_pb_line_break_holder] -->        });<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->        \/\/Detach Listener | Use this to control the button on the GUI. If the Phidget is detached, the button will be disabled.<!-- [et_pb_line_break_holder] -->        redLED.addDetachListener(new DetachListener() {<!-- [et_pb_line_break_holder] -->            public void onDetach(DetachEvent e) {<!-- [et_pb_line_break_holder] -->                jButton1.setEnabled(false);<!-- [et_pb_line_break_holder] -->            }<!-- [et_pb_line_break_holder] -->        });<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->        \/\/Open | Use open without a timeout value becuase GUIs are event driven and we do not want to wait on the main thread.<!-- [et_pb_line_break_holder] -->        redLED.open();<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        } catch (PhidgetException e) {}<!-- [et_pb_line_break_holder] -->    }<!-- [et_pb_line_break_holder] --><\/code><!-- [et_pb_line_break_holder] --><\/pre>\n<p>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner admin_label=&#8221;Row&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; module_class=&#8221;ph-user-eclipse&#8221;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221;ECLIPSE- Download Phidget Java Folder&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h2>Create Project (Eclipse)<\/h2>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<h3>Download Java Folder<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Before starting, download and extract the <a href=\"https:\/\/www.phidgets.com\/downloads\/phidget22\/libraries\/windows\/edu\/Phidget22Java.zip\">Phidget Java Folder<\/a> (you will use this in step 3)<\/pee>[\/et_pb_code][et_pb_video _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/09\/java_windows_extract.mp4&#8243; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 1&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 1<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>In order to build GUIs with Eclipse, you will need to download the <strong>WindowBuilder<\/strong> extension. Navigate to <strong>Help > Eclipse Marketplace<\/strong>.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_eclipse_marketplace.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_code admin_label=&#8221;Step 1 contd&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<pee>Search for <i>WindowBuilder<\/i> and download:<\/pee>[\/et_pb_code][et_pb_video _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_eclipse_windowbuilder2.mkv&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 2&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 2<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Select <strong>File > New > Java Project<\/strong><\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/04\/java_eclipse_1.jpg&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 3&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 3<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Name the project <i>GettingStartedGUI<\/i> and click <strong>Next<\/strong>.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_eclipse_nameproject.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 4&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 4<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Navigate to the <strong>Libraries<\/strong> tab and select <strong>ClassPath<\/strong>. Next, click on <strong>Add External Jars&#8230;<\/strong><\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/09\/java_eclipse_3_4.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 5&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 5<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Navigate to the folder you downloaded and extracted and find the <strong>phidget22.jar<\/strong> file.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/09\/java_eclipse_3_4.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 6&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 6<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Press <strong>Finish<\/strong><\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/09\/java_eclipse_create.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 7&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 7<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>When asked to create a module file, press <strong>Don&#8217;t Create<\/strong><\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/09\/java_eclipse_module_2.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 8&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 8<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Transfer the other Phidget library files to your project.<\/pee>[\/et_pb_code][et_pb_video _builder_version=&#8221;4.6.6&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/09\/java_eclipse_dll_transfer.mp4&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 9&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 9<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Right-click on your project and select <strong>New > Other<\/strong>. Expand <strong>WindowBuilder<\/strong> and find <strong>Swing Designer > Application Window<\/strong>. Finally, click <strong>Next<\/strong>.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_eclipse_newswing.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 10&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 10<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Name the window <i>MainWindow<\/i> and click <strong>Finish<\/strong>.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_eclipse_name.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 11&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 11<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Add a JButton to your window by going to the <strong>Design<\/strong> tab and generate an event for the button.<\/pee>[\/et_pb_code][et_pb_video _builder_version=&#8221;4.6.6&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_eclipse_button2.mkv&#8221; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 12&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 12<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Right-click on the frame and add the windowOpened event handler.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_eclipse_windowopened.png&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; width=&#8221;75%&#8221; \/][et_pb_divider _builder_version=&#8221;4.6.6&#8243; color=&#8221;#ffffff&#8221; divider_weight=&#8221;25&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][et_pb_code admin_label=&#8221;Step 13&#8243; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221;]<\/p>\n<h3>Step 13<\/h3>\n<p><!-- [et_pb_line_break_holder] --><pee>Review the code below and add the relevant sections to your MainWindow.java file. Hover over the comments below for more information about specific sections of the code. <strong>Note:<\/strong> Due to the way Eclipse generates code for GUIs, full code is not provided. You must place the code below into the relevant areas of your code.<\/pee>[\/et_pb_code][et_pb_code admin_label=&#8221;Code Sample&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<\/p>\n<pre class=\"language-java\"><!-- [et_pb_line_break_holder] -->  <code><!-- [et_pb_line_break_holder] -->\/\/Add Phidgets Library<!-- [et_pb_line_break_holder] -->import com.phidget22.*;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->\/\/Define | Define object here so it can be used throughout your program.<!-- [et_pb_line_break_holder] -->DigitalOutput redLED;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->JButton btnNewButton = new JButton(\"LED On\");<!-- [et_pb_line_break_holder] -->btnNewButton.addActionListener(new ActionListener() {<!-- [et_pb_line_break_holder] -->    public void actionPerformed(ActionEvent e) {<!-- [et_pb_line_break_holder] -->        try {<!-- [et_pb_line_break_holder] -->            \/\/Change button text<!-- [et_pb_line_break_holder] -->            if (redLED.getState()) {<!-- [et_pb_line_break_holder] -->                btnNewButton.setText(\"LED on\");<!-- [et_pb_line_break_holder] -->            }<!-- [et_pb_line_break_holder] -->            else {<!-- [et_pb_line_break_holder] -->                btnNewButton.setText(\"LED Off\");<!-- [et_pb_line_break_holder] -->            }<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->            \/\/Flip LED state<!-- [et_pb_line_break_holder] -->            redLED.setState(!redLED.getState());<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->        } catch (PhidgetException err) {};\t<!-- [et_pb_line_break_holder] -->    }<!-- [et_pb_line_break_holder] -->});<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->frame.addWindowListener(new WindowAdapter() {<!-- [et_pb_line_break_holder] -->    @Override<!-- [et_pb_line_break_holder] -->    public void windowOpened(WindowEvent e) {<!-- [et_pb_line_break_holder] -->        try {<!-- [et_pb_line_break_holder] -->            \/\/Create <!-- [et_pb_line_break_holder] -->            redLED = new DigitalOutput();<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->            \/\/Address<!-- [et_pb_line_break_holder] -->            redLED.setHubPort(1);<!-- [et_pb_line_break_holder] -->            redLED.setIsHubPortDevice(true);<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->            \/\/Attach Listener | Use this to control the button on the GUI. If the Phidget is attahced, the button will be enabled.<!-- [et_pb_line_break_holder] -->            redLED.addAttachListener(new AttachListener() {<!-- [et_pb_line_break_holder] -->                public void onAttach(AttachEvent av) {<!-- [et_pb_line_break_holder] -->                    btnNewButton.setEnabled(true);<!-- [et_pb_line_break_holder] -->                }<!-- [et_pb_line_break_holder] -->            });<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->            \/\/Detach Listener | Use this to control the button on the GUI. IF the Phidget is detached, this button will be disabled.<!-- [et_pb_line_break_holder] -->            redLED.addDetachListener(new DetachListener() {<!-- [et_pb_line_break_holder] -->                public void onDetach(DetachEvent dv) {<!-- [et_pb_line_break_holder] -->                    btnNewButton.setEnabled(false);<!-- [et_pb_line_break_holder] -->                }<!-- [et_pb_line_break_holder] -->            });<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->            \/\/Open | Use open without a timeout value because GUIs are event driven and we do not want to wait on the main thread.<!-- [et_pb_line_break_holder] -->            redLED.open();<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->        } catch (PhidgetException error) {}<!-- [et_pb_line_break_holder] -->    }<!-- [et_pb_line_break_holder] -->});<!-- [et_pb_line_break_holder] --><\/code><!-- [et_pb_line_break_holder] --><\/pre>\n<p>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner admin_label=&#8221;Row&#8221; disabled_on=&#8221;off|off|off&#8221; disabled=&#8221;off&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; module_id=&#8221;runcode&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221; (invisible anchor)&#8221; _builder_version=&#8221;4.4.1&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; module_id=&#8221;move&#8221; module_class=&#8221;ph-hidden-anchor&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; module_class=&#8221;ph-user-netbeans&#8221;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221;NETBEANS &#8211; Run Your Code&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<\/p>\n<h2>Run Your Code<\/h2>\n<p><!-- [et_pb_line_break_holder] --><pee>When you click the button on your GUI, your LED will turn on\/off.<\/pee>[\/et_pb_code][et_pb_video _builder_version=&#8221;4.6.6&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_netbeans_video2.mp4&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; module_class=&#8221;ph-user-eclipse&#8221;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221;ECLIPSE  &#8211; Run Your Code&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<\/p>\n<h2>Run Your Code<\/h2>\n<p><!-- [et_pb_line_break_holder] --><pee>When you click the button on your GUI, your LED will turn on\/off.<\/pee>[\/et_pb_code][et_pb_video _builder_version=&#8221;4.6.6&#8243; src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/07\/java_gui_eclipse_video.mp4&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; \/][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner _builder_version=&#8221;4.4.1&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; module_id=&#8221;practice&#8221;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221;Practice&#8221; _builder_version=&#8221;4.6.6&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<\/p>\n<h2>Practice<\/h2>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<ol><!-- [et_pb_line_break_holder] --><\/p>\n<li>Unplug your Getting Started Kit from your computer. What happens to the button on your form?<\/li>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<li>Create a label on your form and use it to display the state of the red button from your Getting Started Kit.<\/li>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<li>Re-create the <a href=\"https:\/\/www.phidgets.com\/education\/learn\/getting-started-kit-tutorial\/tug-of-war\/\" target=\"_blank\" rel=\"noopener noreferrer\">Tug of War<\/a> game from the Getting Started Kit using your GUI. This time, display the current button count for each player on your GUI using labels and include a button on your form that resets the game so it can be played again.<\/li>\n<p><!-- [et_pb_line_break_holder] --><\/ol>\n<p>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner admin_label=&#8221;Row&#8221;][et_pb_column_inner type=&#8221;4_4&#8243; saved_specialty_column_type=&#8221;3_4&#8243; custom_padding__hover=&#8221;|||&#8221; custom_padding=&#8221;|||&#8221; saved_specialty_column_type=&#8221;3_4&#8243;][et_pb_code admin_label=&#8221;ph-button-cta: Back to Projects&#8221; _builder_version=&#8221;4.4.1&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243;]<a class=\"ph-button-cta\" href=\"\/education\/learn\/projects\"><!-- [et_pb_line_break_holder] -->  <\/p>\n<div class=\"ph-button-cta__icon\"><\/div>\n<p><!-- [et_pb_line_break_holder] -->  Back to Projects<!-- [et_pb_line_break_holder] --><\/a>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][\/et_pb_column][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":0,"parent":842,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"<!-- wp:paragraph -->\r\n<p>This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:<\/p>\r\n<!-- \/wp:paragraph --><!-- wp:quote -->\r\n<blockquote class=\"wp-block-quote\">\r\n<p>Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi\u00f1a coladas. (And gettin' caught in the rain.)<\/p>\r\n<\/blockquote>\r\n<!-- \/wp:quote --><!-- wp:paragraph -->\r\n<p>...or something like this:<\/p>\r\n<!-- \/wp:paragraph --><!-- wp:quote -->\r\n<blockquote class=\"wp-block-quote\">\r\n<p>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.<\/p>\r\n<\/blockquote>\r\n<!-- \/wp:quote --><!-- wp:paragraph -->\r\n<p>As a new WordPress user, you should go to <a href=\"https:\/\/www.phidgets.com\/education\/wp-admin\/\">your dashboard<\/a> to delete this page and create new pages for your content. Have fun!<\/p>\r\n<!-- \/wp:paragraph -->","_et_gb_content_width":"","footnotes":""},"class_list":["post-6334","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/6334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/comments?post=6334"}],"version-history":[{"count":43,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/6334\/revisions"}],"predecessor-version":[{"id":8492,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/6334\/revisions\/8492"}],"up":[{"embeddable":true,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/842"}],"wp:attachment":[{"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/media?parent=6334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}