Improve company productivity with a Business Account.Sign Up


How to open a custom dialog box in SWT?

Posted on 2013-06-24
Medium Priority
Last Modified: 2013-08-27
I have a GUI in SWT and in this GUI when I click on a button in the toolbar, I would like to see the view that I show in the attachment.

How can I do it in SWT?
Question by:Tolgar
  • 4
  • 2
LVL 16

Accepted Solution

Valeri earned 2000 total points
ID: 39298291
1. In your ToolBarListener add the following code for the respective "itemAAA"
} else if (toolItem == Gui.itemAAA) {
ChangeListDlg chngListDlg = new ChangeListDlg(shell);;

2. in add listener for this item
item2.addListener(SWT.Selection, toolBarListener);

3. you have to add to your project the attached file.

Author Comment

ID: 39330903
Hi Valeri,
I added the following code to my ToolBarListener:

} else if (toolItem == Gui.item11) {
ChangeListDlg chngListDlg = new ChangeListDlg(shell);;

Open in new window

Problem: It complains about "ChangeListDlg". It says "ChangeListDlg" cannot be resolved to a type. And the quick fix it recommends is to create a ChangeListDlg class. Do you think there is something wrong about the names of the classes?

I also added the following line to my

item11.addListener(SWT.Selection, toolBarListener);

Open in new window

and I created "" class.

Is there anything that I am missing in here?

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

LVL 16

Expert Comment

ID: 39364602
ops, I'm really so sorry! :-( attached is the right file...

Author Comment

ID: 39364635
Awesome! Thank you so much. It works great

Can you also take a look at these two questions:


Author Comment

ID: 39443421
Hi Valeri,
Can you please take a look at this open question:


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

606 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question