Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ToolTip widget behaves inconsistently(When the message has more than one line the tooltip looks different)
ToolTip widget behaves inconsistently [message #1805268] Wed, 10 April 2019 15:22
Julia Kurde is currently offline Julia KurdeFriend
Messages: 88
Registered: November 2011
Location: Berlin, Germany
I am creating a org.eclipse.swt.widgets.ToolTip with SWT.BALLOON style and a text and a message. When the message has only one line the tooltip appears with rounded corners. When the message has more than one line (one or more line breaks) the tooltip has no rounded corners.


This behavior happens on Windows 10.
(The black design you see in the images has nothing to do with it)

Does anyone know why it looks like this?

This is the code to reproduce it:
package probieren.julia;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolTip;

public class ToolTipTest {
	public static void main (String [] args) {
		Display display = new Display ();
		Shell shell = new Shell (display);
		FillLayout fillLayout = new FillLayout ();
		shell.setLayout (fillLayout);

		Button button0 = new Button (shell, SWT.PUSH);
		button0.setText ("Show ToolTip 1");

		Button button1 = new Button (shell, SWT.PUSH);
		button1.setText ("Show ToolTip 2");

		final ToolTip tip = new ToolTip(button0.getShell(), SWT.BALLOON);

		final String str1 = "Das ist die Message.";
		final String str2 = "Das ist die Message.\n...Mit zwei Zeilen...";

		button0.addListener(SWT.Selection, new Listener() {

			public void handleEvent(Event event) {
				tip.setText("Das ist der Text");

		button1.addListener(SWT.Selection, new Listener() {

			public void handleEvent(Event event) {
				tip.setText("Das ist der Text");

		shell.pack (); ();

		while (!shell.isDisposed ()) {
			if (!display.readAndDispatch ()) {
				display.sleep ();
		display.dispose ();

  • Attachment: tooltip1.jpg
    (Size: 9.43KB, Downloaded 257 times)
  • Attachment: tooltip2.jpg
    (Size: 11.16KB, Downloaded 282 times)
Previous Topic:IE 11 compatiblity mode issues with IHTMLDocument
Next Topic:Access "VSplit" system cursor (Windows)
Goto Forum:

Current Time: Sat Apr 17 13:29:20 GMT 2021

Powered by FUDForum. Page generated in 0.02073 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top