Tolgar
asked on
How to open a custom dialog box in SWT?
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Valeri,
I added the following code to my ToolBarListener:
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:
and I created "CustomInputDialog.java" class.
Is there anything that I am missing in here?
Thanks,
I added the following code to my ToolBarListener:
} else if (toolItem == Gui.item11) {
ChangeListDlg chngListDlg = new ChangeListDlg(shell);
chngListDlg.open();
}
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);
and I created "CustomInputDialog.java" class.
Is there anything that I am missing in here?
Thanks,
ASKER
Hi Valeri,
if you have time, can you please take a look at these questions:
https://www.experts-exchange.com/questions/28190325/Follow-up-question-about-opening-a-custom-dialog-box-in-SWT.html
https://www.experts-exchange.com/questions/28190298/Follow-up-question-about-SWT-to-save-a-text-box-to-a-file.html
https://www.experts-exchange.com/questions/28190298/Follow-up-question-about-SWT-to-save-a-text-box-to-a-file.html
Thanks,
if you have time, can you please take a look at these questions:
https://www.experts-exchange.com/questions/28190325/Follow-up-question-about-opening-a-custom-dialog-box-in-SWT.html
https://www.experts-exchange.com/questions/28190298/Follow-up-question-about-SWT-to-save-a-text-box-to-a-file.html
https://www.experts-exchange.com/questions/28190298/Follow-up-question-about-SWT-to-save-a-text-box-to-a-file.html
Thanks,
ops, I'm really so sorry! :-( attached is the right file...
ChangeListDlg.java
ChangeListDlg.java
ASKER
Awesome! Thank you so much. It works great
Can you also take a look at these two questions:
https://www.experts-exchange.com/questions/28190298/Follow-up-question-about-SWT-to-save-a-text-box-to-a-file.html
https://www.experts-exchange.com/questions/28190295/Follow-up-question-about-SWT-file-and-folder-selection.html
Thanks!
Can you also take a look at these two questions:
https://www.experts-exchange.com/questions/28190298/Follow-up-question-about-SWT-to-save-a-text-box-to-a-file.html
https://www.experts-exchange.com/questions/28190295/Follow-up-question-about-SWT-file-and-folder-selection.html
Thanks!
ASKER
Hi Valeri,
Can you please take a look at this open question:
https://www.experts-exchange.com/questions/28221229/How-to-position-OK-and-CANCEL-buttons-on-the-GUI-window-in-SWT.html
Thanks,
Can you please take a look at this open question:
https://www.experts-exchange.com/questions/28221229/How-to-position-OK-and-CANCEL-buttons-on-the-GUI-window-in-SWT.html
Thanks,
http://www.javaworld.com/community/node/3861
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/Howtocreateyourowndialogclasses.htm
http://www.lazylab.org/48/eclipse/swtjface/custom-swt-dialog/
http://www.java-forums.org/java-tip/5267-example-swt-dialog.html
Hope these are useful to you