Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to open a custom dialog box in SWT?

Posted on 2013-06-24
7
Medium Priority
?
515 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 16

Accepted Solution

by:
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);
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

610 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