Solved

How to open a custom dialog box in SWT?

Posted on 2013-06-24
7
486 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
json example 39 135
AWS and Java and Rest - newbie question (Is this an authentication issue) 4 68
get weblogic logged in user in java 2 58
servlet  URL Rewriting 1 28
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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:

861 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

23 Experts available now in Live!

Get 1:1 Help Now