Home » Tag Archives: SWT

Tag Archives: SWT

SWT Look and Feel: Customize FlatScrollBar Color and More

java-logo

Recently I introduced a custom slider control useful for improving the SWT look and feel of more subtle view layouts. Happily it seems the widget already found early adopters outside of the Code Affine world. Which led to some enhancements that will be presented in the following sections.                 SWT Look and Feel ...

Read More »

Sacrilege – a Custom SWT Scrollbar

java-logo

SWT is a thin abstraction layer on top of native OS widgets. Which is a very good thing if you intent that your applications integrate well with the OS look and feel. But as a trade-off this approach limits styling capabilities significantly. In particular I perceive the native SWT scrollbar often disruptive on more subtle view layouts. Coming across this ...

Read More »

SWT Mouse Click Implementation

eclipse-logo

Doing a bit of SWT custom widget development lately, I stumbled across the question why is there no such thing as a default SWT mouse click listener? As this subject raises once in a while, I thought writing a word or two about the rational ground behind – and how to implement mouse clicks in general – would not hurt. ...

Read More »

How to Safely Use SWT’s Display asyncExec

java-logo

Most user interface (UI) toolkits are single-threaded and SWT is no exception. This means that UI objects must be accessed exclusively from a single thread, the so-called UI thread. On the other hand, long running tasks should be executed in background threads in order to keep the UI responsive. This makes it necessary for the background threads to enqueue updates ...

Read More »

Clean SWT Listener Notifcations with SWTEventHelper

eclipse-logo

Writing tests for SWT based UIs often requires to notify widget listeners programmatically. Unfortunately the code to create, initialize and finally to trigger the event is a bit verbose and distracts from the actual purpose of the test. After writing similar initialization routines a couple of times I came up with a little utility class that avoid these redundancies and ...

Read More »

Responsive UIs with Eclipse and SWT

eclipse-logo

Recently I had the problem that my ‘well-conceived’ view design did not scale down reasonably. I realized that the flexibility to arrange viewparts in stacks of arbitrary sizes in an Eclipse workbench window does not exactly ease the development of appealing UIs. At least if you strive for more than a set of actions placed around a list, table or ...

Read More »

RichText editor component for SWT based applications

java-duke-logo

This article will go through the task of implementing our own RichText editor component with SWT. I faced the need for such a visual component when developing a desktop based application for one of my customers and wanted to add a functionality to allow users to write rich text comments with bold, italic, strike through, etc. capabilities. At that moment ...

Read More »

Integrating JavaFX 2.0 with Swing and SWT

javafx-logo

One of the improvements in JavaFX with JavaFX 2.0 has been greater ease of interoperability with Swing and SWT. Several online resources document how this is done. These include Integrating JavaFX into Swing Applications and SWT Interop. However, in a nice example of effective class-level Javadoc documentation, the respective JavaFX classes javafx.embed.swing.JFXPanel and javafx.embed.swt.FXCanvas each provide a simple code sample ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.