Results 1 to 3 of 3
- 03-09-2009, 09:27 AM #1
Member
- Join Date
- Mar 2009
- Posts
- 1
- Rep Power
- 0
How to create custom Input Dialog
Hi
This is Bab, I am developing a Map tool.. I got a problem here.. I just want to creat a dailg box and that has to ask me for the name of the map and once I press the Ok button then it must go..I did this one using two ways.
1-> JOptionPane.showInputDailog()
2-> JFace Input Dialog
In the first one ,I am not able to control the window.. Actually the dialog has to appear only in one condition.. But once it enters to the loop then for every time it is asking for the input data even though it comes out from the loop(My input method is based on onmouseclick())
if I use the second one it is showing an error like "Invalid access to thread"
My requirement..
Create a dailog that should not effect my input window..
- 03-24-2009, 07:08 AM #2
Member
- Join Date
- Mar 2009
- Posts
- 42
- Rep Power
- 0
Try this code , it is a input dilaog in jface
InputDialog dialog = new InputDialog(parent.getShell(),"Dialog Title","Dialog Message",null , null);
dialog.open();
- 08-02-2009, 12:21 PM #3
Member
- Join Date
- Aug 2009
- Location
- Heidelberg
- Posts
- 47
- Rep Power
- 0
The "invalid access to threads" is usually that you try to update the UI directly.
Put your update in code similar to the following:
Java Code:new Thread(new Runnable() { public void run() { while (true) { try { Thread.sleep(1000); } catch (Exception e) { } Display.getDefault().asyncExec(new Runnable() { public void run() { ... do any work that updates the screen ... } } } } }).start();
Similar Threads
-
Creating a Number Input Dialog in SWT
By Java Tip in forum SWTReplies: 0Last Post: 07-02-2008, 07:53 PM -
Input Verification Dialog Demo
By Java Tip in forum javax.swingReplies: 0Last Post: 06-26-2008, 07:43 PM -
Creating a dialog to input user/password
By prfalco in forum New To JavaReplies: 4Last Post: 02-18-2008, 07:03 AM -
JOptionPane - input dialog
By Java Tip in forum Java TipReplies: 0Last Post: 12-17-2007, 09:09 AM -
Multiple Line Input Dialog Box
By johnt in forum AWT / SwingReplies: 2Last Post: 05-31-2007, 09:30 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks