| <!doctype html> |
| <html class="no-js" lang="en" dir="ltr"> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="x-ua-compatible" content="ie=edge"> |
| <title>Handling Images in a Java GUI Application</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <meta name="description" content="Handling Images in a Java GUI Application - Apache NetBeans"> |
| <meta name="author" content="Apache NetBeans"> |
| <meta name="description" content="Handling Images in a Java GUI Application - Apache NetBeans"> |
| <meta name="keywords" content="Apache NetBeans, Tutorials, Handling Images in a Java GUI Application"> |
| <meta name="generator" content="Apache NetBeans"> |
| <link rel="stylesheet" href="../../../../../../_/css/font-awesome.min.css"> |
| <link rel="alternate" type="application/atom+xml" title="Apache NetBeans Blog" href="https://netbeans.apache.org/blogs/atom" /> |
| <link rel="stylesheet" href="../../../../../../_/css/highlightjs/default.min.css"> |
| <link rel="stylesheet" href="../../../../../../_/css/netbeans.css"> |
| <link rel="apple-touch-icon" sizes="180x180" href="../../../../../../_/images/fav/apple-touch-icon.png"> |
| <link rel="icon" type="image/png" sizes="32x32" href="../../../../../../_/images/fav/favicon-32x32.png"> |
| <link rel="icon" type="image/png" sizes="16x16" href="../../../../../../_/images/fav/favicon-16x16.png"> |
| <link rel="manifest" href="../../../../../../_/images/fav/site.webmanifest"> |
| <link rel="mask-icon" href="../../../../../../_/images/fav/safari-pinned-tab.svg" color="#5bbad5"> |
| <meta name="msapplication-TileColor" content="#ffc40d"> |
| <meta name="theme-color" content="#ffffff"> |
| <link href="../../../../../../_/css/font-open-sans.css" rel="stylesheet"> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| http://www.apache.org/licenses/LICENSE-2.0 |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| </head> |
| <body> |
| <div class="title-bar" data-responsive-toggle="responsive-menu" data-hide-for="medium"> |
| <button type="button" data-toggle="responsive-menu"><i style='font-size: 32px; color: #fff; padding: 8px' class='fa fa-bars'></i></button> |
| <div class="title-bar-title">Apache NetBeans</div> |
| </div> |
| <div class="top-bar" id="responsive-menu"> |
| <div class='top-bar-left'> |
| <a class='title' href="../../../../../../index.html"><img src='../../../../../../_/images/apache-netbeans.svg' style='padding: 8px; height: 48px;'> Apache NetBeans</a> |
| </div> |
| <div class="top-bar-right"> |
| <ul class="vertical medium-horizontal menu" data-responsive-menu="drilldown medium-dropdown"> |
| <li> <input id="search-input" type="text" placeholder="Search the docs"> </li> |
| <li> <a href="../../../../../../front/main/community">Community</a> </li> |
| <li> <a href="../../../../../../front/main/participate">Participate</a> </li> |
| <li> <a href="../../../../../../front/main/blogs">Blog</a></li> |
| <li> <a href="../../../../../../front/main/help">Get Help</a> </li> |
| <li> <a href="https://plugins.netbeans.apache.org/">Plugins</a> </li> |
| <li> <a href="../../../../../../front/main/download">Download</a> </li> |
| </ul> |
| </div> |
| </div> |
| |
| <!-- src/templates/news --> |
| <section class="hero news alternate"> |
| <div class='grid-container'> |
| <div class='cell'> |
| <div class="annotation">Latest release</div> |
| <h1>Apache NetBeans 27</h1> |
| <p><a class="button success" href="../../../../../../front/main/download/nb27">Download</a></p> |
| </div> |
| </div> |
| </section> |
| <div class='grid-container main-content tutorial'> |
| <article class="doc"> |
| <h1 class="sect0">Handling Images in a Java GUI Application</h1> |
| <div class="sectionbody"> |
| <div class="admonitionblock note"> |
| <table> |
| <tbody><tr> |
| <td class="icon"><i class="fa icon-note" title="Note"></i></td> |
| <td class="content">This tutorial needs a review. |
| You can <a href="https://github.com/apache/netbeans-antora-tutorials/edit/main/modules/ROOT/pages/kb/docs/java/gui-image-display.adoc" title="Edit this tutorial in github">edit it in GitHub </a> |
| following these <a href="../../../../../../tutorial/main/kb/docs/contributing">contribution guidelines.</a></td> |
| </tr></tbody> |
| </table> |
| </div> |
| </div> |
| <div id="toc" class="toc"> |
| <div id="toctitle"></div> |
| <ul class="sectlevel1"> |
| <li><a href="#_creating_the_application">Creating the Application</a></li> |
| <li><a href="#_creating_the_application_form">Creating the Application Form</a></li> |
| <li><a href="#_adding_a_package_for_the_image">Adding a Package for the Image</a></li> |
| <li><a href="#_displaying_the_image_on_the_label">Displaying the Image on the Label</a></li> |
| <li><a href="#_building_and_running_the_application">Building and Running the Application</a></li> |
| <li><a href="#_creating_custom_code">Creating Custom Code</a></li> |
| <li><a href="#_summary">Summary</a></li> |
| </ul> |
| </div> |
| <div id="preamble"> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Handling images in an application is a common problem for many beginning Java programmers. The standard way to access images in a Java application is by using the <code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String)">getResource()</a></code> method. This tutorial shows you how to use the IDE’s GUI Builder to generate the code to include images (and other resources) in your application. In addition, you will learn how to customize the way the IDE generates image handling code.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The application that results from this tutorial will be a simple JFrame that contains one JLabel that displays a single image.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_creating_the_application"><a class="anchor" href="#_creating_the_application"></a>Creating the Application</h2> |
| <div class="sectionbody"> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>Choose File > New Project.</p> |
| </li> |
| <li> |
| <p>In the New Project wizard, select Java > Java Application and click Next.</p> |
| </li> |
| <li> |
| <p>For Project Name, type <code>ImageDisplayApp</code>.</p> |
| </li> |
| <li> |
| <p>Clear the Create Main Class checkbox.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="openblock feature"> |
| <div class="content"> |
| <div class="imageblock xref-image left"> |
| <div class="content"> |
| <a class="image" href="../../../../_images/kb/docs/java/newproj.png"><img src="../../../../_images/kb/docs/java/newproj-small.png" alt="newproj small"></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>Click Finish.</p> |
| </li> |
| </ol> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_creating_the_application_form"><a class="anchor" href="#_creating_the_application_form"></a>Creating the Application Form</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>In this section, you create the JFrame form and add a JLabel to the form.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>To create the JFrame form:</strong></p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>In the Projects window, expand the <code>ImageDisplayApp</code> node.</p> |
| </li> |
| <li> |
| <p>Right-click the Source Packages node and choose New > JFrame Form.</p> |
| </li> |
| <li> |
| <p>For Class Name, type <code>ImageDisplay</code>.</p> |
| </li> |
| <li> |
| <p>For Package Name, type <code>org.me.myimageapp</code>.</p> |
| </li> |
| <li> |
| <p>Click Finish.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="paragraph"> |
| <p><strong>To add the JLabel:</strong></p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>In the Palette, select the Label component and drag it to the JFrame.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>For now, the form should look something like the following image:</p> |
| </div> |
| <div class="openblock feature"> |
| <div class="content"> |
| <div class="imageblock xref-image left"> |
| <div class="content"> |
| <a class="image" href="../../../../_images/kb/docs/java/form.png"><img src="../../../../_images/kb/docs/java/form-small.png" alt="form small"></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_adding_a_package_for_the_image"><a class="anchor" href="#_adding_a_package_for_the_image"></a>Adding a Package for the Image</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>When you use images or other resources in an application, typically you create a separate Java package for the resources. On your local filesystem, a package corresponds with a folder.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>To create a package for the image:</strong></p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>In the Projects window, right-click the <code>org.me.myimageapp</code> node and choose New > Java Package.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="openblock feature"> |
| <div class="content"> |
| <div class="imageblock xref-image left"> |
| <div class="content"> |
| <a class="image" href="../../../../_images/kb/docs/java/package.png"><img src="../../../../_images/kb/docs/java/package-small.png" alt="package small"></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>Click Finish.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="paragraph"> |
| <p>In the Projects window, you should see a new package appear within the <code>Source Packages</code> folder.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../../../_images/kb/docs/java/project-with-imagepack.png" alt="project with imagepack"> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_displaying_the_image_on_the_label"><a class="anchor" href="#_displaying_the_image_on_the_label"></a>Displaying the Image on the Label</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>In this application, the image will be embedded within a JLabel component.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>To add the image to the label:</strong></p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>In the GUI Designer, select the label that you have added to your form.</p> |
| </li> |
| <li> |
| <p>In the Properties window, click the Properties category and scroll to the Icon property.</p> |
| </li> |
| <li> |
| <p>Click the ellipsis (…​) button. |
| The icon property editor is displayed.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="openblock feature"> |
| <div class="content"> |
| <div class="imageblock xref-image left"> |
| <div class="content"> |
| <a class="image" href="../../../../_images/kb/docs/java/importimage.png"><img src="../../../../_images/kb/docs/java/importimage-small.png" alt="importimage small"></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>In the icon property dialog box, click Import to Project.</p> |
| </li> |
| <li> |
| <p>In the file chooser navigate to any image that is on your system that you want to use. Then click Next.</p> |
| </li> |
| <li> |
| <p>In the Select target folder page of the wizard, select the <code>newpackage</code> folder and click Finish.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="openblock feature"> |
| <div class="content"> |
| <div class="imageblock xref-image left"> |
| <div class="content"> |
| <a class="image" href="../../../../_images/kb/docs/java/targetfolder.png"><img src="../../../../_images/kb/docs/java/targetfolder-small.png" alt="targetfolder small"></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>Click OK to close the icon property dialog box.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="paragraph"> |
| <p>After you click OK, the IDE does the following things:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Copies the image to your project. Therefore, when you build and distribute the application, the image is included in the distributable JAR file.</p> |
| </li> |
| <li> |
| <p>Generates code in the ImageDisplay class to access the image.</p> |
| </li> |
| <li> |
| <p>Displays your image on the label in the Design view of your form.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="openblock feature"> |
| <div class="content"> |
| <div class="imageblock xref-image left"> |
| <div class="content"> |
| <a class="image" href="../../../../_images/kb/docs/java/label-added.png"><img src="../../../../_images/kb/docs/java/label-added-small.png" alt="label added small"></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>At this point, you can do some simple things to improve the appearance of the form, such as:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>In the Properties window, select the <code>text</code> property and delete <code>jLabel1</code>. That value was generated by the GUI Builder as display text for the label. However, you are using the label to display an image rather than text, so that text is not needed.</p> |
| </li> |
| <li> |
| <p>Drag the <code>jLabel1</code> to the center of the form.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="openblock feature"> |
| <div class="content"> |
| <div class="imageblock xref-image left"> |
| <div class="content"> |
| <a class="image" href="../../../../_images/kb/docs/java/centered.png"><img src="../../../../_images/kb/docs/java/centered-small.png" alt="centered small"></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p><strong>To view the generated code:</strong></p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>In the GUI Designer, click the Source button. (Choose View > Source Editor Toolbar from the main menu if the Source button is hidden.)</p> |
| </li> |
| <li> |
| <p>Scroll down to the line that says Generated Code.</p> |
| </li> |
| <li> |
| <p>Click the plus sign (+) to the left of the Generated Code line to display the code that the GUI Designer has generated.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="paragraph"> |
| <p>The key line is the following:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/me/myimageapp/newpackage/image.png"))); // NOI18N</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Since you have used the property editor for <code>jLabel1’s `Icon</code> property, the IDE has generated the <code>setIcon</code> method. The parameter of that method contains a call to the <code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String)">getResource()</a></code> method on an anonymous inner class of <code>ImageIcon</code>. Notice that the generated path for the image corresponds with its location in the application’s package structure.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>Notes:</strong></p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>If you use the External Image option in the icon property editor, the IDE will generate an absolute path to the image instead of copying the image to your project. Therefore, the image would appear when you run the application on your system, but it would probably not appear when running the application on another system.</p> |
| </li> |
| <li> |
| <p>The <code>getResource</code> method is also useful for accessing other types of resources, such as text files that contain data that your application might need to use.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p><strong>To register event handlers for mouse events on the Jlabel:</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>In the Design View, right-click the JLabel and choose Events > Mouse > mouseClicked/mousePressed/mouseReleased from the popup menu. |
| An event handler is generated for the corresponding event.</p> |
| </div> |
| <div class="admonitionblock note"> |
| <table> |
| <tr> |
| <td class="icon"> |
| <i class="fa icon-note" title="Note"></i> |
| </td> |
| <td class="content"> |
| You can get the mouse coordinates (for example, the location of a mouse click) in the event handler using the <code>event.getPoint()</code>, <code>event.getX()</code>, or <code>event.getY()</code> methods. See <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/event/MouseEvent.html">Class MouseEvent</a> for details. |
| </td> |
| </tr> |
| </table> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_building_and_running_the_application"><a class="anchor" href="#_building_and_running_the_application"></a>Building and Running the Application</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Now that you have generated the code for accessing and displaying the image, you can build and run the application to ensure that the image is accessed.</p> |
| </div> |
| <div class="paragraph"> |
| <p>First you need to set the project’s main class. When you set the main class, the IDE knows which class to run when you run the project. In addition, this ensures that the <code>Main-Class</code> element in the application’s JAR file is generated when you build the application.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>To set the project’s main class:</strong></p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>Right-click the ImageDisplayApp project’s node and choose Properties.</p> |
| </li> |
| <li> |
| <p>In the Project Properties dialog box, select the Run category.</p> |
| </li> |
| <li> |
| <p>Click the Browse button that is next to the Main Class field. Then select the <code>org.me.myimageapp.ImageDisplay</code> class.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="openblock feature"> |
| <div class="content"> |
| <div class="imageblock xref-image left"> |
| <div class="content"> |
| <a class="image" href="../../../../_images/kb/docs/java/mainclass.png"><img src="../../../../_images/kb/docs/java/mainclass-small.png" alt="mainclass small"></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>Click the Select Main Class button.</p> |
| </li> |
| <li> |
| <p>Click OK to close the Project Properties dialog box.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="paragraph"> |
| <p><strong>To build the project:</strong></p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Choose Run > Clean & Build Project (<em>project_name</em>) from the main toolbar.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>You can view the build products of the application in the Files window. The <code>build</code> folder contains the compiled class. The <code>dist</code> folder contains a runnable JAR file that contains the compiled class and the image.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../../../_images/kb/docs/java/files.png" alt="files"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p><strong>To run the project:</strong></p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Choose Run > Run Project (<em>project_name</em>) from the main toolbar.</p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_creating_custom_code"><a class="anchor" href="#_creating_custom_code"></a>Creating Custom Code</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>In many applications, the image that is displayed is not determined statically like it is in this example. For example, the image to display might be determined by something that the user clicks.</p> |
| </div> |
| <div class="paragraph"> |
| <p>If you need to be able to choose the image to display programmatically, you can write your own custom code to access and display resources. The IDE prevents you from writing code directly in the Source view’s "guarded blocks" that contain code generated by the GUI Builder. However, you can insert code in the guarded blocks through property editors that you can access through the Properties window. Using the property editors in this manner ensures that your custom code is not lost when you make design changes in the GUI Builder.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>For example, to write custom code for a JLabel’s <code>icon</code> property:</strong></p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic"> |
| <li> |
| <p>Select the JLabel in the Design View or in the Navigator window.</p> |
| </li> |
| <li> |
| <p>In the Properties window, click the ellipsis (…​) button that is next to the <code>icon</code> property.</p> |
| </li> |
| <li> |
| <p>From the dropdown list at the top of the dialog box, select the Custom Code option.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="openblock feature"> |
| <div class="content"> |
| <div class="paragraph"> |
| <p><span class="image xref-image left"><a class="image" href="../../../../_images/kb/docs/java/custom-code.png"><img src="../../../../_images/kb/docs/java/custom-code-small.png" alt="custom code small"></a></span></p> |
| </div> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The Custom Code option in this property editor lets you fill in the parameter of the <code>setIcon</code> method yourself. You can fill in this parameter with the necessary logic or with a call to a separate method that you have hand-coded elsewhere in the class.</p> |
| </div> |
| <div class="openblock feature"> |
| <div class="content"> |
| <div class="imageblock xref-image left"> |
| <div class="content"> |
| <a class="image" href="../../../../_images/kb/docs/java/custom-view.png"><img src="../../../../_images/kb/docs/java/custom-view-small.png" alt="custom view small"></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_summary"><a class="anchor" href="#_summary"></a>Summary</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>This tutorial has shown you how to access images from an application that you create in the NetBeans IDE. Image handling is further discussed in the Java Tutorial.</p> |
| </div> |
| <div class="paragraph"> |
| <p>*Note: *The example given in this tutorial is very similar to the first example in the <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html">How to Use Icons section</a> of the Java Tutorial. One difference is that the code that is generated when you follow this tutorial uses <code><a href="http://download.oracle.com/javase/6/docs/api/javax/swing/JLabel.html">JLabel</a>’s `<a href="http://download.oracle.com/javase/6/docs/api/javax/swing/JLabel.html#setIcon(javax.swing.Icon)">setIcon</a></code> method to apply the icon to the label. In the Java Tutorial example, the icon is applied to the label by being passed through its constructor.</p> |
| </div> |
| </div> |
| </div> |
| <section class='tools'> |
| <ul class="menu align-center"> |
| <li><a title="Facebook" href="https://www.facebook.com/NetBeans"><i class="fa fa-md fa-facebook"></i></a></li> |
| <li><a title="Twitter" href="https://twitter.com/netbeans"><i class="fa fa-md fa-twitter"></i></a></li> |
| <li><a title="Github" href="https://github.com/apache/netbeans"><i class="fa fa-md fa-github"></i></a></li> |
| <li><a title="YouTube" href="https://www.youtube.com/user/netbeansvideos"><i class="fa fa-md fa-youtube"></i></a></li> |
| <li><a title="Atom Feed" href="https://netbeans.apache.org/blogs/atom"><i class="fa fa-mf fa-rss"></i></a></li> |
| <li><a title="Slack" href="https://tinyurl.com/netbeans-slack-signup/"><i class="fa fa-md fa-slack"></i></a></li> |
| <li><a title="Issues" href="https://github.com/apache/netbeans/issues"><i class="fa fa-mf fa-bug"></i></a></li> |
| </ul> |
| <ul class="menu align-center"> |
| <li><a href="https://github.com/apache/netbeans-antora-tutorials/edit/main/modules/ROOT/pages/kb/docs/java/gui-image-display.adoc" title="See this page in github"><i class="fa fa-md fa-edit"></i> See this page in GitHub.</a></li> |
| </ul> |
| </section> |
| </article> |
| </div> |
| <div class='grid-container incubator-area' style='margin-top: 64px'> |
| <div class='grid-x grid-padding-x'> |
| <div class='large-auto cell text-center'> |
| <a href="https://www.apache.org/"> |
| <img style="height: 60px" title="Apache Software Foundation" src="../../../../../../_/images/asf_logo_wide.svg" /> |
| </a> |
| </div> |
| <div class='large-auto cell text-center'> |
| <a href="https://www.apache.org/events/current-event.html"> |
| <img style="width:234px; height: 60px;" title="Apache Software Foundation current event" src="https://www.apache.org/events/current-event-234x60.png"/> |
| </a> |
| </div> |
| </div> |
| </div> |
| <footer> |
| <div class="grid-container"> |
| <div class="grid-x grid-padding-x"> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../../../front/main/about">About</a></h1> |
| <ul> |
| <li><a href="../../../../../../front/main/community/who">Who's Who</a></li> |
| <li><a href="https://www.apache.org/foundation/thanks.html">Thanks</a></li> |
| <li><a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li> |
| <li><a href="https://www.apache.org/security/">Security</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../../../front/main/community">Community</a></h1> |
| <ul> |
| <li><a href="../../../../../../front/main/community/mailing-lists">Mailing lists</a></li> |
| <li><a href="../../../../../../front/main/community/committer">Becoming a committer</a></li> |
| <li><a href="../../../../../../front/main/community/events">NetBeans Events</a></li> |
| <li><a href="https://www.apache.org/events/current-event.html">Apache Events</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../../../front/main/participate">Participate</a></h1> |
| <ul> |
| <li><a href="../../../../../../front/main/participate/submit-pr">Submitting Pull Requests</a></li> |
| <li><a href="../../../../../../front/main/participate/report-issue">Reporting Issues</a></li> |
| <li><a href="../../../../../../front/main/participate/#documentation">Improving the documentation</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../../../front/main/help">Get Help</a></h1> |
| <ul> |
| <li><a href="../../../../../../front/main/help/#documentation">Documentation</a></li> |
| <li><a href="../../../../../../wiki/main/wiki">Wiki</a></li> |
| <li><a href="../../../../../../front/main/help/#support">Community Support</a></li> |
| <li><a href="../../../../../../front/main/help/commercial-support">Commercial Support</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../../../front/main/download">Download</a></h1> |
| <ul> |
| <li><a href="../../../../../../front/main/download">Releases</a></li> |
| <li><a href="https://plugins.netbeans.apache.org/">Plugins</a></li> |
| <li><a href="../../../../../../front/main/download/#_daily_builds_and_building_from_source">Building from source</a></li> |
| <li><a href="../../../../../../front/main/download/#_older_releases">Previous releases</a></li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| </footer> |
| <div class='footer-disclaimer'> |
| <div class="footer-disclaimer-content"> |
| <p>Copyright © 2017-2025 <a href="https://www.apache.org">The Apache Software Foundation</a>.</p> |
| <p>Licensed under the Apache <a href="https://www.apache.org/licenses/">license</a>, version 2.0</p> |
| <div style='max-width: 40em; margin: 0 auto'> |
| <p>Apache, Apache NetBeans, NetBeans, the Apache feather logo and the Apache NetBeans logo are trademarks of <a href="https://www.apache.org">The Apache Software Foundation</a>.</p> |
| <p>Oracle and Java are registered trademarks of Oracle and/or its affiliates.</p> |
| <p>The Apache NetBeans website conforms to the <a href="https://privacy.apache.org/policies/privacy-policy-public.html">Apache Software Foundation Privacy Policy</a></p> |
| </div> |
| </div> |
| </div> |
| |
| |
| <script src="../../../../../../_/js/vendor/lunr.js"></script> |
| <script src="../../../../../../_/js/search-ui.js" id="search-ui-script" data-site-root-path="../../../../../.." data-snippet-length="100" data-stylesheet="../../../../../../_/css/search.css"></script> |
| <script async src="../../../../../../search-index.js"></script> |
| <script src="../../../../../../_/js/vendor/jquery.min.js"></script> |
| <script src="../../../../../../_/js/vendor/what-input.min.js"></script> |
| <script src="../../../../../../_/js/vendor/foundation.min.js"></script> |
| <script src="../../../../../../_/js/vendor/jquery.colorbox-min.js"></script> |
| <script src="../../../../../../_/js/netbeans.js"></script> |
| <script> |
| $(function(){ $(document).foundation(); }); |
| </script> |
| <script src="../../../../../../_/js/vendor/highlight.min.js"></script> |
| <script> |
| document.addEventListener('DOMContentLoaded', (event) => { |
| document.querySelectorAll('pre code').forEach((el) => { |
| hljs.highlightElement(el); |
| }); |
| }); |
| </script> |
| </body> |
| </html> |