Results 1 to 16 of 16
Thread: JFrame ??
- 11-03-2008, 04:08 PM #1
Member
- Join Date
- Jul 2008
- Posts
- 22
- Rep Power
- 0
JFrame ??
hi every one..
i have create JFrame class called frame1.>>which include button "new"
i've also created another class called frame2.>>which include button called "OK".
what i need is when i click the button "new" frame2 appears on the top of frame1 and then when i click button "OK" i go back to frame1?
i hope that i wrote my question clearly!
can any body helpme :confused:.
- 11-03-2008, 05:15 PM #2
Member
- Join Date
- Sep 2008
- Posts
- 38
- Rep Power
- 0
are frame1 and frame2 internal frames that you want to call in a container of some sort?
It is quite easy to open a second Frame from a button or a menu item by adding an ActionListener to it, but I am not convinced that is what you want. Or use the 'setVisible()' method.
...i guess...
- 11-03-2008, 05:24 PM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 11-03-2008, 06:30 PM #4
Is he talking about changing which window is in front (z-order??). Will requestFocus() do that?
- 11-04-2008, 03:56 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
It may be, he's talking about top and back.... So need a much better explanation here.
- 11-04-2008, 04:24 AM #6
Don't use two frames. Make the second one a modal JDialog.
db
-
or simply a call to JOptionPane.showMessageDialog(...).
- 11-04-2008, 04:48 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 11-04-2008, 08:33 AM #9
- 11-04-2008, 09:05 AM #10
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ya, I got that. But what's have to do with a message box.
- 11-04-2008, 12:00 PM #11
The message argument to JOptionPane.showMessageDialog is of type Object. If the parameter is a Component, the JOptionPane loads and shows that component in the message area. See the description for parameter message in the API: JOptionPane (Java Platform SE 6)
The OP's problem description would be much better approached with a modal dialog, and JOptionPane provides a convenient static method to display one.
db
- 11-04-2008, 12:46 PM #12
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Got the point. I've not remember the argument list there. Thanks.
- 11-04-2008, 02:45 PM #13
Member
- Join Date
- Jul 2008
- Posts
- 22
- Rep Power
- 0
thanks for your help..
i'll try to do as what darryl.broke said and i'll see if it work..
- 11-04-2008, 08:55 PM #14
- 11-06-2008, 12:04 PM #15
Member
- Join Date
- Jul 2008
- Posts
- 22
- Rep Power
- 0
sorry... for that..
darryl.Burke ;)
my english is bad:p
- 11-06-2008, 04:25 PM #16
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Can you please mark the thread solved if you found the solution here for your question.
Similar Threads
-
how to use JFrame in JSP ??
By priyanka sharma in forum JavaServer Pages (JSP) and JSTLReplies: 8Last Post: 04-06-2011, 04:51 AM -
loading a new Jframe
By Ebylord in forum New To JavaReplies: 0Last Post: 07-22-2008, 08:31 PM -
opening of an exe in JFrame
By smartsubroto in forum New To JavaReplies: 3Last Post: 07-16-2008, 05:01 AM -
jframe
By amith in forum AWT / SwingReplies: 1Last Post: 05-15-2008, 10:03 AM -
Help with JFrame
By Albert in forum AWT / SwingReplies: 2Last Post: 07-04-2007, 04:44 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks