and Braille displays, to get information from the user interface. Java 2D API. Enables developers to easily incorporate high-quality. 2D graphics, text, and images. This Swing Java Tutorial describes developing graphical user interfaces (GUIs) interfaces (GUIs) for applications and applets, using the Swing components. Swing è un framework per Java, appartenente alle Java Foundation Classes ( JFC) e orientato La Internet Foundation Classes (IFC) era una libreria grafica per Java Grazie a questo, la maggior parte dei componenti Swing hanno associati modelli (specificati in termini di Java interfaces), il programmatore può usare.

Author: JoJoktilar Dounris
Country: Australia
Language: English (Spanish)
Genre: Education
Published (Last): 8 August 2004
Pages: 267
PDF File Size: 16.63 Mb
ePub File Size: 1.65 Mb
ISBN: 889-6-86633-138-6
Downloads: 26674
Price: Free* [*Free Regsitration Required]
Uploader: Gazilkree

When the horizontal guideline appears indicating that the JComboBox’s baseline is aligned with the baseline of the text in the JLabel and the spacing between the two components is suggested with a vertical guideline, click to position the combo box.

In this task we’ll add four JTextFields that will display the contact information and the JLabels that will describe them. Da Wikipedia, l’enciclopedia libera.

Afterwards, we’ll set the four buttons to be the same size so they can be easily recognized as offering related functionality. Move the cursor grafoche the form below the E-mail JPanel.

Designing a Swing GUI in NetBeans IDE – Tutorial

To demonstrate this, we’ll insert a JTextField inteefacce the JLabels we added previously, as shown in the following two illustrations.

In poche parole, il disegno e lo stile grafico dei componenti non vengono richiesti al toolkit grafico nativo del sistema operativo, ma vengono riprodotti tramite una loro emulazione. While still pressing the Shift key, place another JLabel immediately to the right of the first. Finishing Up Now we need to add the buttons that will enable users to confirm the information they enter for an individual contact and add it to the contact list or cancel, leaving the database unchanged.


Your application is up and running. It is often beneficial to set several related components, such as buttons in modal dialogues, to be the same size for visual consistency.

The JTextField snaps into position in the form aligned with the JLabel’s baseline, as shown in the following illustration. Select all four JButtons by pressing the Inteerfacce key while making your selection.

Swing (Java)

Titled borders are added to both JPanel components. The JPanel component is extended to span between the container’s left and right margins in accordance with the recommended offset, as shown in the following illustration. While Java applications often consist of several IDE projects, for the purposes of this tutorial, we will build a simple application which is stored entirely in a single project.

Because we want to visually distinguish the functions in the upper and lower sections of our GUI, we need to add a border and title to each JPanel. To resize the JPanel: Then type E-mail Address: It discusses painting issues specific to Swing components, provides an overview of painting concepts, and has examples of custom components that paint themselves.

The JTextField’s right edge snaps to the alignment guideline indicating the preferred margins.

Now we’ll add the combo box that will enable users to select the format of the information that our ContactEditor application will display. External Tools and Services.

As shown in the following illustration, the JComboBox’s right edge snaps into alignment with the JPanel’s recommended edge margin and the component’s width is automatically set to resize with the form. The JTextFields are set to resize horizontally at runtime. If you forget to release the Shift key prior to positioning inrerfacce last JLabel, simply press the Escape key. Release the resize handle to resize the component. Provides a representation of all the components, both visual and non-visual, in your application as a tree hierarchy.


Altri progetti Wikimedia Commons. Questo significa che il comportamento dei componenti la reazione agli eventi, il rendering, ecc.

Move the cursor immediately to the right of the First Name: You can only edit code appearing in the white areas of the Editor when in Source view. La libreria Swing viene utilizzata come libreria ufficiale per la realizzazione di interfacce grafiche in Java.

We’ve got off to a good start building our ContactEditor GUI, but let’s take a minute to recap what we’ve learned while we add a few more of the components our interface inherfacce. Drag the ihterfacce handle on the JComboBox’s right edge toward the right until the alignment guidelines appear suggesting the preferred offset between the JComboBox and JPanel edges.

First we’ll accomplish this using the Properties window and then we’ll try it using the pop-up menu.

Notice that the ButtonGroup does not appear in the form itself, however, it is visible in the Navigator’s Other Components area. As you add components to a form, the GUI Builder provides visual feedback that grafichhe in positioning components based on your operating system’s look and feel.

As in the previous examples, double-click the JLabel to select its display text and then enter Display Format: