szymon_wro
|
Posted: September 03, 2009 12:23 by szymon_wro
|
|
Hello, I'm new to Monkeybars and I think it's really nice and useful. However I'm lost completely with dialogs. I followed older topics on google groups and the most recent one on kenai: http://kenai.com/projects/monkeybars/forums/forum/topics/1394-define_handler-for-JDialog? . No luck. If I get the dialog to pop up, then I cannot get it event handlers working. If it is possible, could give me a step by step guide how to set up custom modal dialogs (something beyond JOptionPane, extending JDialog)? I like your approach to MVC and the tuple (triple?, triad?) construct. I'd love to get the same approach to the specified and complicated dialogs. Best regards Szymon Wrozynski |
Modal Dialogs
by: sundbp
Logan Barnett
|
Posted: September 03, 2009 15:33 by Logan Barnett
|
|
Szymon, Here's some code I've been using:
Some other code I have isn't as nice. It's been a while since I've used this code, but I believe this is done because the dialog is modal.
I hope that gives you a start. Let me know if you have more questions! |
Logan Barnett
|
Posted: September 03, 2009 15:35 by Logan Barnett
|
|
Ugh, some of that got cut off due to styling. Time to file a bug! |
sundbp
|
Posted: December 16, 2009 00:51 by sundbp
|
|
Hi, I've been using monkeybars for a couple of days and I really like it so far. Great work, thanks a lot! I was wondering if you could expand a bit on the topic of dialogs? Perhaps even a working example we could put on the wiki to avoid it coming up repeatedly. Also, I've been using netbeans 6.8 to design some forms etc. It doesn't seem like new JDialog's can be created as a "top level frame", they can get added to an existing frame or pane. That doesn't seem ideal for useage with monkeybars and I thought I'd see if anyone has some input on that side as well. How to deign a dialog with netbeans for useage with monkeybars? Thanks. |
Logan Barnett
|
Posted: December 16, 2009 13:27 by Logan Barnett
|
|
When you say "top level frame", are you referring to a modal dialog? Is Netbeans not liking what you're doing with the Dialogs? I haven't played with Netbeans 6.8 yet. I'll put together an example in the next couple of days. Feel free to remind me if I run late! |
sundbp
|
Posted: December 16, 2009 15:30 by sundbp
|
|
I mean that in netbeans you can't create a new JDialog and have the java class created being type JDialog - or that's how it seems to me, may be missing something in the GUI. You create a JFrame or a JPanel, and then from within the GUI designer you can add a JDialog (which will be part of the file created for the JFrame/JPanel). Can't add JDialog in project view, just GUI designer view. I tried to create a JFrame and then just change the JFrame to JPanel in the Java code class declaration. No issues (GUI designer also alright). So that's a workaround. |
Logan Barnett
|
Posted: December 17, 2009 01:34 by Logan Barnett
|
|
I seem to remember that there was an "other" that you could pick that would let you choose some of the less common things (and I think JDialog is included). If that doesn't work, you can always do the UI by hand. I have an example posted in the source code repositories (see the left panel). You can also get it here: http://kenai.com/projects/monkeybars/sources/dialog-demo/show |
by: sundbp









