Results 1 to 9 of 9
Thread: pause until JFrame is closed.
- 11-30-2008, 04:55 PM #1
Member
- Join Date
- Nov 2008
- Posts
- 19
- Rep Power
- 0
- 11-30-2008, 05:11 PM #2
It will do this by it's own work. To get a window without a console, we can use javaw
Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 11-30-2008, 06:05 PM #3
Member
- Join Date
- Nov 2008
- Posts
- 19
- Rep Power
- 0
But I have a class to communicate with a user (with BufferedReader) in console.
That class just open picture of JFrame corresponding to user's command until "stop"-command is given.
I can open as many pictures I want, but if close one with a mouse, then my program will stop (console and JFrame(s)), although "stop"-command haven't given yet.
-
why are you mixing Swing and console apps here? It seems a poor program design. Also, are you setting the JFrame's setDefaultCloseOperation to JFrame.EXIT_ON_CLOSE? If so, don't. Or perhaps what you really want to do is show your pictures in a JOptionPane or a JDialog.
- 11-30-2008, 06:33 PM #5
Member
- Join Date
- Nov 2008
- Posts
- 19
- Rep Power
- 0
I am sorry, I am new to swing. I don't know all of it's property yet. So currently I am poor in taking advance of swing properties.why are you mixing Swing and console apps here?
I have this code line in JFrame, so I think yes:Also, are you setting the JFrame's setDefaultCloseOperation to JFrame.EXIT_ON_CLOSE?
Just in case. My JFrame have a subclass that extends JPanel to draw simple picture then add that component to JFrame.Java Code:setDefaultCloseOperation(EXIT_ON_CLOSE);
Close JFrame will close my console, that is bad thing i don't want to happen :(
- 11-30-2008, 06:38 PM #6
Member
- Join Date
- Nov 2008
- Posts
- 19
- Rep Power
- 0
I don't think JOptionPane and JDialog are things I need, because I just want to show a picture that's all.
- 11-30-2008, 07:59 PM #7
Member
- Join Date
- Nov 2008
- Posts
- 19
- Rep Power
- 0
I found a dirty trick. It won't solve my problem but it make feel right =)
Dirty-trick : use "HIDE_ON_CLOSE" instead "EXIT_ON_CLOSE"
- 11-30-2008, 09:11 PM #8
I don't thinik it sounds all that bad for get-going, all a gui is is what you are doing here without the cli ( command line interface - a "dos box" )
hide() and show() are fully legitimate, you may need to call paint or repaint or paintLater or whatever they call it today,....
Wait tilll you get to implementingYou are in shallow waters brother, holler while you can.....Java Code:DocFlavor flavor = new DocFlavor(new String("application/vnd.hp-PCL",new String("String"));Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
-
Similar Threads
-
Exception : ResultSet is closed
By nanimtech in forum JDBCReplies: 5Last Post: 08-06-2009, 03:11 PM -
how to pause and repaint in a loop, to draw a mathematical function.
By Abdelhamidem in forum AWT / SwingReplies: 3Last Post: 06-05-2008, 11:10 PM -
Socket Closed!
By rameshraj in forum NetworkingReplies: 0Last Post: 05-06-2008, 11:48 AM -
Socket Closed!
By rameshraj in forum NetworkingReplies: 0Last Post: 05-06-2008, 10:11 AM -
Help with Pause
By trill in forum Java AppletsReplies: 2Last Post: 09-28-2007, 08:50 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks