Results 1 to 6 of 6
- 05-03-2010, 10:05 PM #1
Member
- Join Date
- Jul 2009
- Posts
- 46
- Rep Power
- 0
JOptionPane withour parent frame.
Is there a way to get a JoptionPane to work without having a parent frame. I java an application that runs as a service that has no GUI but, if there is certain errors I want it to show a jOptionPane. This didn't work.
Java Code:JOptionPane.showMessageDialog(null, "Please insert a blank disc and reburn last backup.", "Disc Error", JOptionPane.ERROR_MESSAGE);
- 05-03-2010, 10:07 PM #2
Senior Member
- Join Date
- Mar 2010
- Posts
- 266
- Rep Power
- 4
how exactly did it not work? did it not show at all or threw an exception? it could actually be impossible to do if you have defined no Frames at all, but you should be able to do something like
Java Code:JOptionPane.showMessageDialog(new JFrame(), "Please insert a blank disc and reburn last backup.", "Disc Error", JOptionPane.ERROR_MESSAGE);
- 05-03-2010, 10:39 PM #3
Member
- Join Date
- Jul 2009
- Posts
- 46
- Rep Power
- 0
- 05-03-2010, 10:56 PM #4
Senior Member
- Join Date
- Mar 2010
- Posts
- 266
- Rep Power
- 4
it could be that the service is not allowed to generate any UI... in which case you're basically screwed. One option is to do try some kind of native message box, and run it from System.getRuntime().exec()...
- 05-03-2010, 11:22 PM #5
- 05-04-2010, 05:14 PM #6
Member
- Join Date
- Jul 2009
- Posts
- 46
- Rep Power
- 0
Similar Threads
-
Submit values to a parent page
By carag in forum New To JavaReplies: 1Last Post: 12-11-2009, 12:33 AM -
Returning focus to a frame after hiding another frame
By fletcher in forum AWT / SwingReplies: 7Last Post: 11-02-2009, 06:31 PM -
How show a popWindow that have JPanel like parent
By Wolverine in forum AWT / SwingReplies: 4Last Post: 05-23-2009, 08:59 AM -
Parent & Child window issues......
By jithan in forum New To JavaReplies: 2Last Post: 09-20-2008, 09:21 AM -
disable parent window
By ismailsaleh in forum AWT / SwingReplies: 1Last Post: 01-07-2008, 11:15 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks