WindowBuilder Pro Tutorial - UniBg

2y ago
19 Views
2 Downloads
361.40 KB
7 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Aydin Oneil
Transcription

WindowBuilder Pro TutorialInformatica III – B Angelo Gargantini 2011Materiale preso dal sito di googleVedremo i seguenti passi:1. Install the latest WindowBuilder Pro build into Eclipse 3.4, 3.5 or 3.6.2. Create a new project using the appropriate project wizard.3. Use a class wizard to create your first GUI window or edit an existing window4. Choose an appropriate layout manager for your window.5. Add various components from the Palette and edit their properties using the Property Pane.6. Visually create and edit your window's menubar.7. Add event handlers to various widgets to provide behavior.8. If you create a new Composite or JPanel, you can embed it in another window using theChoose Component command.9. You can test launch your window by right-clicking on it and selecting Run As JavaApplication.10.Internationalize your application and manage multiple locales.

1.Install the latest WindowBuilder Pro build into EclipseIf you are already familiar with installing Eclipse plugins, you can just use the update site URLbelow for your version of Eclipse.Eclipse 3.7 latest/3.2.Create a new project using the appropriate project wizardWindowBuilder Pro provides a large number ofwizards. Each toolkit contributes one or morewizards.The wizards may be accessed from the Eclipse Newwizard (File New Other) or the drop downwizard menu in the Eclipse toolbar.Ci sono tantissimi oggetti:Quelli più usati sono JFrame Jdialog

3.Use a class wizard to create your first GUI window or edit anexisting windowEditing Existing WindowsTo open a file that has not been created by the tool or that is currently edited by a different editor(such as the standard Java Editor), simply right-click on the file and select Open With WindowBuilder Editor.This will open the file in the WindowBuilder Editor in the Source View by default (the editorlayout may be easily customized if you prefer the Design View to appear first or if you want theSource View and Design View to appear at the same time). There are two tabs at the bottom of theeditor window labeled Source and Design as shown below. If you click on the Design tab or hitF12, the file will be displayed in the Design View and you will be able to visually design your GUI.Note: If a file was last opened in the WindowBuilder Editor , it will continue to open in that editoruntil a different editor is selected to edit the file. If you do not see the Source and Design tabs, thismeans that you are not using the WindowBuilder Editor.4.Choose an appropriate layout manager for your window - LayoutManagersA program written in Java may be deployed on multiple platforms. If you were to use standard UIdesign techniques, specifying absolute positions and sizes for your UI components, your UI won'tbe portable. What looks fine on your development system might be unusable on another platform.To solve this problem, Java provides a system of portable layout managers. You use these layoutmanagers to specify rules and constraints for the layout of your UI in a way that will be portable.

Layout managers can provide the following advantages: Correctly positioned components that are independent of fonts, screen resolutions, andplatform differences. Intelligent component placement for containers that are dynamically resized at runtime. Ease of translation. If a string increases in length after translation, the associatedcomponents stay properly aligned.About layout managersWhen writing Java applications, you may need to use layouts to give your windows a specific look.A layout controls the position and size of children in a container. Layout classes are subclasses ofthe abstract class Layout. Both SWT and Swing provide several standard layout classes, and youcan write custom layout classes. Other UI toolkits embed implicit layout managers in each paneltype.In Java, positioning and sizing does not happen automatically. Applications can decide to size andplace a container's children initially, or in a resize listener. Another option is to specify a layoutclass to position and size the children. If children are not given a size, they will have zero size andthey cannot be seen.The layout manager sets the sizes and locations of the components based on various factors such as: The layout manager's layout rules.The layout manager's property settings, if any.The layout datas associated with each component.The size of the container.Each layout manager has characteristic strengths and drawbacks. Grid-based layouts and constraintbased layouts are the most useful and powerful of the standard layouts, but they are also the mostcomplicated. When using the design view, you can change the layout whenever you like. The tooladjusts the code as needed on the fly. Change the layout either by explicitly adding a layoutmanager to the source code for the container, or by selecting a layout for the composite on thedesign surface.

5.Add various components from the Palette and edit their propertiesusing the Property PaneThe Palette provides quick access to toolkit-specific components as well as anycustom components installed by the user. The Palette is organized intocategories which may be expanded, collapsed or hidden.To add a components to the Design View, you can: Select it in the palette and drop it on the Design View or ComponentTree by clicking in the desired location. Use the Choose Component command to select the widget type fromChoose Component dialog.Multiple widgets of the same type may be added to the Design View by holdingdown the Ctrl key when selecting the widget in the Palette.The palette may be customized by right-clicking anywhere in the palette toaccess the palette context menu or by opening the Palette Manager dialog.The following commands are common to every palette: 6.SelectionMarqueeChoose componentTab OrderVisually create and edit your window's menubarMenus are a must for just about all GUIs. Using the editor, it is quick andpainless to create menu bars and popup menus.To create a menu bar on your window, select Menu Bar (SWT) or JMenuBar(Swing) from the Palette, and then place it on your window in the DesignView.Note that these instructions only apply to window types that support menubars(e.g., SWT Shells, SWT Application Windows, and Swing JFrames). They donot apply to window types that can't have menubars (e.g., Dialogs & Wizards)or that manage their own menubars through a special framework (e.g., JFace ApplicationWindow).Each window can have at most one Menu Bar,and the only place that you can put a Menu Bar isdirectly on a window. A particular menu will onlybe displayed on the window on which it wascreated. After the Menu Bar is placed, you shouldsee a blank menu bar across the top of yourwindow in the Design View.To

add individual menus to the menu bar, select Cascade Menu Item (SWT) or JMenu (Swing) fromthe Palette, and then place it on the menu bar.7.Add event handlers to various widgets to provide behaviorEvents occur when the user interacts with the UI. The appropriate event-handling code is thenexecuted. In order to know when events occur, event handlers must first be added to yourcomponents. The tool makes it very easy to add and remove event listeners to your components.8.Adding an Event HandlerThere are two ways to add an event handler withthe the editor. The first way is through theProperty Pane. First select a component ineither the Component Tree or the Design View.Click the Show Eventsbutton to reveal theevents list in the Property Pane. Expand anevent and double-click or press Enter on theevent handler you wish to implement.The second way to add an event handler is tosimply right-click on a component (either in theDesign View or in the Component Tree), selectAdd event handler [name of the event] [name of the event handler to implement].A quick way to add event listeners to buttons (including check and radio buttons) and menu items isto simply double-click on the button or menu item. When double-clicked, a selection event listenerwill be created.Any way you add an event, the tool will automatically create an event handler for the selected eventmethod. The editor will then switch to the Source View and go directly to the new event handler

method. The code generated looks like the following:browseButton new Button(shell, SWT.NONE);browseButton.addSelectionListener(new SelectionListener() {public void widgetDefaultSelected(SelectionEvent arg0) {}public void widgetSelected(SelectionEvent arg0) {}});browseButton.setText("Browse.");There are two ways to quickly return to the event-handling codefrom the Design View. In the Property Pane, click the ShowEventsbutton and expand the event. Then double-click orpress Enter on the event method to return to the code. Theevents' list in the Property Pane is a list of all the eventsimplemented, and each individual event's property value is thelist of methods implemented. If a method has been implemented,its property value is the line number in the source code where itsevent-handling code begins.The other way to quickly return to the event-handling code is toright-click on a component (either in the Design View or in theComponent Tree), and then select the menu item for the correctmethod that was implemented. Shown to the right is"actionPerformed - line 111" being selected. In this example, "actionPerformed" is the eventmethod, and "111" is the line number in the source code on which the method begins.Note: the tool is also able to generate an event handler stub method when a new event is created bysetting the appropriate code generation preferences.9.Deleting an Event HandlerThere is only one way to delete an existing event handler in the editor. Select a component in eitherthe Design View or in the Component Tree. In the Property Pane expand expand the event, clickon the event method you wish to delete and then press Delete. If there are no other methods thathave been implemented for that event, the tool will also delete the event listener for that event.10. If you create a new Composite or JPanel, you can embed it inanother window using the Choose Component command.11. You can test launch your window by right-clicking on it andselecting Run As Java Application.12. Internationalize your application and manage multiple locales.

When writing Java applications, you may need to use layouts to give your windows a specific look. A layout controls the position and size of children in a container. Layout classes are subclasses of the abstract class Layout. Both SWT and Swing provide several standard layout classes, and you can write custom layout classes.

Related Documents:

PRO-94 Trunking Scanner Tutorials (200-0524) (PRO-94) General Scanner Tutorial Index and Table Of Contents Section 1 - Scanner Basics . Pro-94 Tutorial - Storing Talk Group ID's in Talk Group Lists Pro-94 Tutorial - WX Band and Weather Alert Pro-94A Tutorial: Programming Trunked Frequencies.

Read the following documents before using the PHANTOMTM 4 Pro / Pro : 1. In the Box 2. Phantom 4 Pro / Pro User Manual 3. Phantom 4 Pro / Pro Quick Start Guide 4. Phantom 4 Pro / Pro Series Disclaimer and Safety Guidelines 5. Phantom 4 Pro / Pro Series Intelligent Flight Battery Safety Guidelines

behringer ultra-curve pro dsp 24 a/d- d/a dsp ultra-curve pro ultra- curve pro 1.1 behringer ultra-curve pro 24 ad/da 24 dsp ultra-curve pro dsp8024 smd (surface mounted device) iso9000 ultra-curve pro 1.2 ultra-curve pro ultra-curve pro 19 2u 10 ultra-curve pro ultra-curve pro iec . 7 ultra-curve pro dsp8024 .

Pro Tools 9.0 provides a single, unified installer for Pro Tools and Pro Tools HD. Pro Tools 9.0 is supported on the following types of systems: Pro Tools HD These systems include Pro Tools HD software with Pro Tools HD or Pro Tools HD Native hard-ware. Pro Tools These systems include Pro Tools software with 003 or Digi 002 family audio .

Dalle reti a Internet Ipermedialità e multimedialità Il World Wide Web Formazione a distanza ed e-learning Fondamenti di Informatica Telematica e ipermedialità Cazzaniga Paolo Dip. di Scienze Umane e Sociali paolo.cazzaniga@unibg.it Dott. Cazzaniga Paolo Fondamenti di Informatica 3 - A.A. 2012/2013

behringer v-amp pro 19 2 hu 10 cm v-amp pro 8.2 v-amp pro 3 2 v-amp pro 180 ( 120 v) 9 9 8. 11 v-ampire/v-amp pro/v-amp 2 8 iec 8.1 xlr 8.2 6.3 mm 8.3 6.3 mm 8.4 8.3 midi midi 5 din v-amp pro midi midi midi inmidi edit midi out/thru midi out (midi thru) v-amp pro midi midi 8.3.1 midi-sysex v-amp pro edit midi (a ) midi sysex v-amp pro edit

Tutorial Process The AVID tutorial process has been divided into three partsÑ before the tutorial, during the tutorial and after the tutorial. These three parts provide a framework for the 10 steps that need to take place to create effective, rigorous and collaborative tutorials. Read and note the key components of each step of the tutorial .

API 526 provides effective discharge areas for a range of sizes in terms of letter designations, “D” through “T.” 3.19 Flutter Fluttering is where the PRV is open but the dynamics of the system cause abnormal, rapid reciprocating motion of the moveable parts of the PRV. During the fluttering, the disk does not contact the seat but reciprocates at the frequency of the flutter. 3.19 .