Supported SWT Code Snippets
as of 2005-07-03
- "Hello World"
- Accessibility
- Browser
- BusyIndicator
- Button
- Canvas
- Caret
- Clipboard
- Combo
- Composite
- Control
- CoolBar
- CTabFolder, CTabItem
- Cursor
- DirectoryDialog
- Display
- create two one shot timers (5000 ms, 2000 ms)
- create one repeating timer (every 500 ms)
- stop a repeating timer when a button is pressed
- get the bounds and client area of a display
- fill a table from a background thread (sync exec)
- post mouse events (UI testing tools only)
- post key events (UI testing tools only)
- Drag and Drop
- FileDialog
- Font
- FormLayout
- GC
- GridLayout
- Image
- Label
- Link
- List
- Menu
- create a bar and pull down menu (accelerators, mnemonics)
- create a popup menu (set in multiple controls)
- create a menu with radio items
- enable menu items dynamically (when menu shown)
- fill a menu dynamically (when menu shown)
- show a popup menu (wait for it to close)
- update a status line when an item is armed
- access About, Preferences and Quit menus on carbon
- Monitor
- OLE and ActiveX
- OpenGL
- Printing
- Program
- ProgressBar
- RowLayout
- Sash
- SashForm
- Scale
- ScrolledComposite
- Shell
- create a dialog shell
- create a dialog shell (prompt for a value)
- create a splash screen
- prevent a shell from closing (prompt the user)
- prevent escape from closing a dialog
- open a shell minimized (iconified)
- open a shell maximized (full screen)
- create a non-rectangular window
- set icons with different resolutions
- emulate transparent shell
- Slider
- Spinner
- StyledText
- Swing/AWT
- TabFolder, TabItem
- Table, TableItem, TableColumn
- add 1000 sorted entries to a virtual table every 500 ms
- color cells and rows in table
- create a table (no columns, no headers)
- create a table (columns, headers, lines)
- create a table with 1,000,000 items (lazy)
- create a table (lazy with a thread)
- detect a selection or check event in a table (SWT.CHECK)
- find a table cell from mouse down (SWT.FULL_SELECTION)
- find a table cell from mouse down (works for any table style)
- insert a table item (at an index)
- insert a table column (at an index)
- make columns reorderable by dragging
- place arbitrary controls in a table
- print selected items in a table
- remove selected items
- resize columns as table resizes
- scroll a table (set the top index)
- select an index (select and scroll)
- sort a table by column
- update table item text
- TableCursor
- TableEditor
- Text
- add a select all menu item to the control
- detect CR in a text control (default selelection)
- prevent CR from going to the default button
- prompt for a password (set the echo character)
- resize a text control (show about 10 characters)
- select all the text in the control
- set the selection (i-beam)
- set the selection (start, end)
- verify input (only allow digits)
- verify input in a template (YYYY/MM/DD)
- detect when the user scrolls a text control
- TextLayout, TextStyle
- ToolBar, ToolItem
- Tool Tips
- Tracker
- Tray, TrayItem
- Tree
- TreeEditor