Solved

How to open a custom dialog box in SWT?

Posted on 2013-06-24
7
487 Views
Last Modified: 2013-08-27
Hi,
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?
changelist-dialog.png
0
Comment
Question by:Tolgar
  • 4
  • 2
7 Comments
 
LVL 7

Expert Comment

by:gudii9
ID: 39273574
0
 
LVL 16

Accepted Solution

by:
Valeri earned 500 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);
chngListDlg.open();
}

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

3. you have to add to your project the attached file.
CustomInputDialog.java
0
 

Author Comment

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

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

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 Gui.java:

item11.addListener(SWT.Selection, toolBarListener);

Open in new window


and I created "CustomInputDialog.java" class.

Is there anything that I am missing in here?

Thanks,
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:Tolgar
ID: 39362695
0
 
LVL 16

Expert Comment

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

Author Comment

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

Can you also take a look at these two questions:

http://www.experts-exchange.com/Programming/Languages/Java/Q_28190298.html

http://www.experts-exchange.com/Programming/Languages/Java/Q_28190295.html3

Thanks!
0
 

Author Comment

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

http://www.experts-exchange.com/Programming/Languages/Java/Q_28221229.html

Thanks,
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 191
starter POM and spring-boot-starter,  spring-boot-web 2 53
Weekend adv creator 3 36
going to wrong jsp page 2 19
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to implement Singleton Design Pattern in Java.

813 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now