Results 1 to 3 of 3
- 04-17-2011, 12:02 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
Combination of Threads and Frames
I wasn't sure if I should post this under Threads and Synchronization or AWT/Swing because I feel like it falls under both categories. I apologize if it's in the wrong one :eek:
Here's the scenario though:
I have a JFrame with a number of JPanels on it. When you click on one of the JPanels, it needs to open up another JFrame from which I need to prompt the user for a series of values. I'm trying to avoid using JOptionPanes for all of the inputs as I my JFrame can get all of the inputs at once and theoretically pass them as an array??
My question is this, how can I halt the original JFrame/JPanel until the the user has entered their input and clicked ok, since those values need to be used in the original JFrame/JPanel.
I'm not really asking for specific source code just maybe some ideas or suggestions about how to approach the problem.
I've tried using a synchronize block on the original frame to halt it while the input JFrame would call notify after it has gathered it's input. But it didn't work out.
To simplify the problem its basically this:
Create a JFrame and have it display something
Open another JFrame and use it to gather some input
Display that data on the first JFrame
Thanks for any help!!Last edited by myers.pa; 04-17-2011 at 12:05 AM.
-
A JOptionPane can hold a complex GUI as its Object parameter, and so can a JDialog, both of which would likely be better than a second JFrame.
Use a JOptionPane or modal JDialog. Feel free to create a complex GUI in a JPanel and display it in the option pane or dialog.My question is this, how can I halt the original JFrame/JPanel until the the user has entered their input and clicked ok, since those values need to be used in the original JFrame/JPanel.
-
Since this thread discusses mainly Swing issues, I am moving it to the Swing forum.
Similar Threads
-
JScrollPane and GridBagLayout combination
By lmpeders in forum AWT / SwingReplies: 0Last Post: 03-21-2011, 02:42 PM -
random linear combination of packet
By bhatti in forum NetworkingReplies: 0Last Post: 12-22-2010, 03:46 PM -
JWindow closes after a particular key combination
By chyrl in forum AWT / SwingReplies: 9Last Post: 05-05-2010, 04:33 PM -
Key combination
By dejos456 in forum New To JavaReplies: 9Last Post: 11-30-2009, 07:11 AM -
COMBINATION TEXT..help me..urgent
By conv_bay in forum New To JavaReplies: 10Last Post: 04-27-2009, 11:34 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks