Share on Google+Share on Google+


SWT allows to create Calendar by using the java.util.Calendar class. The class CLabel allows to write the day and the days of week.



  1. Calendar Example
    SWT allows to create Calendar by using the java.util.Calendar class. The class CLabel allows to write the day and the days of week. The class GridLayout provides the configuration of GridData in the layout. 
  2. Draw Calendar in SWT
    SWT allows to create Calendar by using the java.util.Calendar class. The class CLabel draws the aligned text with different border styles. We are using this class to write the day and the days of week.
  3. SWT TextEditor
    In SWT, the classes ToolBar and ToolItem are allowed to create the TextEditor. The class ToolBar provides the toolBar items and the class ToolItem adds the item to the toolbar.
  4. Show different types of Cursor
    Using SWT we can change the style of cursor, by using the class Cursor of package To show the hand cursor, we have defined the SWT.CURSOR_HAND in the constructor of Cursor.
  5. How to create Combo Box in SWT
    In this example, we have created two different combo boxes where one is performing an action on the second combo box. The items tea , coffee and cold drink are added to the  first combo box by using the method add() of Combo class. 
  6. Temperature Converter in SWT
    SWT provides the class ApplicationWindow of package org.eclipse.jface.window that provides general framework for creating and managing different windows. In this example we are going to show you how to convert the temperature.
  7. Rotate Text in Java
    In SWT, we have used the package org.eclipse.draw2D.Graphics to draw the figure on to the surface. The interface IFigure allows to create the complex Graphics and the Figure class implements the Graphical figures.
  8. Tree Example
    SWT provides a class Tree to represent the data in the hierarchical way and TreeItem to represents the  hierarchy of tree items in a tree by adding an item to the tree.
  9. Create Tree in SWT
    SWT allows an advantage of creating a tree. To represent the data in the hierarchical way, the class Tree is used. It provides the hierarchy of items.
  10. SWT Spinner
    In SWT, the class Spinner of package org.eclipse.swt.widgets is used. The method setMinimum() sets the minimum value and the method setMaximum() sets the maximum value.
  11. Create Scale in SWT
    In order to create the scale, SWT provides the class Scale of package org.eclipse.swt.widgets.*. This class shows the different ranges of numeric values.
  12. Create Radio Buttons in SWT
    In SWT, the style RADIO defined in the Button class allows to create radio button. We have create an array object of Button class. The class Label displays the specified string.
  13. Create Progress Bar in SWT
    SWT allows to create a Progress bar by providing the class ProgressBar of package org.eclipse.swt.widgets. With the use of this class, you can display the progress in the form of bar.
  14. Create Menu Bar in SWT
    In SWT, the classes Menu and MenuItem of package org.eclipse.swt.widgets is allowed to create a menu bar. The method setMenu() sets the pull down menu.
  15. Create Popup List in SWT
    SWT allows to create the popup list by providing the class PopupList of package org.eclipse.swt.custom. In the given example, we are going to popup the list of Indian states.
  16. Login Form in SWT
    To create a login form in SWT, the Label class set the labels User Name and Password and Text class sets the text for the specified fields. The method shell.setLayout(new GridLayout(2, false)) sets the layout of the login form.
  17. How to create Link in SWT
    SWT allows to create link by using the class Link of package org.eclipse.swt.widgets. The class Link displays the specified text with links. The method setText(message) sets the text specified. 
  18. Use Group Class in SWT
    In SWT, the class Group of package org.eclipse.swt.widgets provides an etched border with an optional title. In the given example, we have create two groups by using the class Group.
  19. Draw a Flowchart
    To draw a flowchart, we have used the package org.eclipse.draw2d.* and org.eclipse.swt.*. The Shell class provides the shell on which the flowchart is displayed.
  20. Drag and Drop Example in SWT
    In SWT, the class DND provides all the constants to drag the source and drop. The class DragSource defines the source for drag transfer. The method setTransfer() sets the text to be transferred by the DragSource.
  21. Show Font Dialog and Color Dialog
    SWT allows to show Color Dialog and Font Dialog by providing the classes FontDialog and ColorDialog. The FontDialog class provides the font dialog and allow the user to select a font from the available fonts.
  22. Creating List in Java using SWT
    In this example, we have create a list of certain items using SWT that provides the class List of package org.eclipse.swt.widgets to create the list in Java language.
  23. Create Scroll Bar in Java using SWT
    The given example will show you how to create scroll bar in Java using SWT, for that we have created a class with the name ScrollBarExamle that imports a package org.eclipse.swt.widgets, which is used to create ScrollBar in Java.
  24. Create ToolTip Text in SWT
    The ToolTip is the element of graphical user interface used in the conjunction with a cursor pointer. In SWT, the method setToolTipText() of class TabItem sets the tooltip text. In the given example, we have create tabs using the class TabFolder and TabItem to show the toolTipText.
  25. Create Tabs in Java using SWT
    This Tab Example in Java, will teach you how to create tabs using SWT in Java. After going through the example you will be able to create different tabs with different values on the same page. Just follow the given instruction.
  26. SWT Browser
    In SWT, the class Browser of package org.eclipse.swt.browser allows to create a browser. In the given example, the class Browser implements the browser and allows the user to navigate through HTML documents.
  27. Create Expand Bar in SWT
    SWT provides an application of creating a Expand Bar using the classes ExpandBar and ExpandItem. The class ExpandBar provides the layout of selectable expand bar items.
  28. SWT File Browser
    This section illustrates you how to browse a file.
  29. Use of ColorRegistry and FontRegistry
    This section illustrates you the use of ColorRegistry and FontRegistry. SWT provides a great application of ColorRegistry and FontRegistry. These are the classes of package org.eclipse.jface.resource.
  30. Create a Sash in SWT
    In this section, you will study how to create a Sash. In SWT, the class Sash represent a selectable user interface object that allows the user to drag the outline.
  31. Create a Sash Form
    In this section you will study how to create a Sash Form. In SWT, the class SashForm lays out a Row or Column arrangement (as specified by the orientation) and places a Sash between them.
  32. StyledText in SWT
    This section illustrates you how to create a Styled Text. To display the stylish and impressive text, we have used the class StyledText of package org.eclipse.swt.custom. 
  33. Create Table in SWT
    In this section, you will study how to create a table. SWT provides the classes Table, TableItem, TableColumn of package org.eclipse.swt.widgets to create a table.
  34. Demonstrates TableTree
    This section shows you Table Tree. SWT provides the class TableTree to display the hierarchy of items in a tabular form.
  35. Create a ToolBar
    This section illustrates you how to create a ToolBar in SWT. The method setBounds() sets the size and location of toolBar.
  36. Use of PreferenceStore class
    This section demonstrates you the use of class PreferenceStore.  SWT provides the class PreferenceStore to persist the non-default values to the files or streams and to load the default values from the file or streams.
  37. Demonstrates Wizard
    This section illustrates you how to implement the wizard. In SWT, the class WizardDialog shows a wizard to the user. 




Posted on: December 19, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: SWT  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image