Modal dialog to a JFrame creates problem in windows XP

I have a problem with JDialog(modal) when it is set to a JFrame.
It works when the focus is on the dialog.
If some other application is selected from the taskbar of the windows XP and selecting back the JFrame, the dialog is not poping up on to the frame but it is hided. The dialog can be accessed by selecting Alt+Tab.
Any solution for this.Pl help.

hi!
you need to create a Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, so that any one can easily understand where you are doing a mistake.
And don't forget to use the Code Formatting Tags so the code retains its original formatting.
:)

Similar Messages

  • Printer Dialog Box through SDK creating problem

    Hello Experts,
    I have created a addon for printing Invoice Report in which i have given the option of Printer Dialog Box .
    Through sdk i have called that printer dialog box in the addon .It's running well in the server showing the Printer Dialog Box
    but while running the addon in client machine first two to three times printer dialog box appears after that while pressing the
    print button of my addon form Printer dialog box is not appearing .
    Then after restarting the machine Printer dialog box shows which is creating problem for the client use .
    Suggest the right way to sort out the problem .
    If anyone need to see the code which i have written i can post that code.
    Thanks
    Amit

    Hello Janos,
    Following code i have write for prrinter dialog box to open
    Public Sub ShowPrintDialogBrowser()
    Dim MyProcs() As System.Diagnostics.Process
    FileName = ""
    Dim PrintFile As New PrintDialog
    Try
    PrintFile.AllowSelection = True
    PrintFile.ShowNetwork = True
    MyProcs = Process.GetProcessesByName("SAP Business One")
    Dim UserName = Environment.UserName
                 For i As Integer = 0 To UBound(MyProcs)
                    If GetProcessUserName(MyProcs(i)) = UserName Then
                        GoTo NEXT_STEP
                    End If
                Next
                sbo_application.MessageBox("Unable to determine Running processes by UserName!")
                GC.Collect()
                Exit Sub
    NEXT_STEP:
    For i As Integer = 0 To MyProcs.Length - 1
    Dim MyWindow As New WindowWrapper(MyProcs(i).MainWindowHandle)
    Dim ret As DialogResult = PrintFile.ShowDialog(MyWindow)
    If ret = DialogResult.OK Then
    File_Directory = PrintFile.PrinterSettings.PrinterName
    PrintFile.Dispose()
    ElseIf ret = DialogResult.Cancel Then
    File_Directory = ""
    System.Windows.Forms.Application.ExitThread()
    Else
    File_Directory = ""
    System.Windows.Forms.Application.ExitThread()
    End If
    Next
    End If
    Catch ex As Exception
    SBO_Application.MessageBox(ex.Message)
    FileName = PrintFile.PrinterSettings.PrinterName
    Finally
    PrintFile.Dispose()
    End Try
    End Sub
    Imports System.Management
    Private Function GetProcessUserName(ByVal Process As Process) As String
            Dim sq As New ObjectQuery("Select * from Win32_Process Where ProcessID = '" & Process.Id & "'")
            Dim searcher As New ManagementObjectSearcher(sq)
            If searcher.Get.Count = 0 Then Return Nothing
            For Each oReturn As ManagementObject In searcher.Get
                Dim o As String() = New String(1) {}
                'Invoke the method and populate the o var with the user name and domain                        
                oReturn.InvokeMethod("GetOwner", DirectCast(o, Object()))
                Return o(0)
            Next
        End Function
    Regards,
    Amit

  • Hiding Application To System Tray will cause Modal dialog unblock

    I have a JFrame, when I minimize it, it will hide. The user can recall it back by simply double click on its icon, which is created in system tray during application initialization.
    However, I am facing problem when I pop up a modal dialog box. (In Linux)
    When I pop up a modal dialog box, I am expecting setVisible(true) will always being block, until the modal dialog box is closed.
    However, in Linux, user is able to minimize the parent windows, even there is a modal dialog box. During minimization, I have to call JFrame.setVisible(false), in order to hide the application.
    A side effect of calling setVisible(false) for a modal dialog box owner (JFrame), will cause the modal dialog box JDialog.setVisible(true) being unblocked and continue for the next statement.
    How I can prevent this, to ensure the JDialog.setVisible is always blocked, until the JDialog is really closed? Thanks!

    tnx Sarcommand ..i give up on that, i understand the risk if that feature is included..
    all i wanted is to make an internet cafe client/server that blocks the client's pc interaction if log time is reached.blocking only the keyboard and mouse.
    i have seen so many softwares sets the cursor position within the dialog bounding box only with user and password there. though my other application runs the mouse is still captured on the dialog even the dialog lost focus.
    if that would not be possible I'll just send notification to the client, a dialog that does not block any application.
    now, im going to try if the client can do som action whenever the server sends alert if the client java app is not the focus. i will post next time what hapens.but if you tried already, if u dont mind posting it so others could know it also..
    tnx so much Sarcommand..

  • How to remove the default icons from the toolbar of modal dialog box screen

    Hello Friends,
    Iam calling a screen from function module using CALL SCREEN statement.
    The screen is of type Modal Dialog Box. I created some input fields and buttons in the screen. When the screen is displayed, I can see the tool bar at the bottom along with the input fields and buttons in the screen.
    These icons are Continue(Enter), Check, Cancel. How can I supress this??
    I mean in my screeen I want only my input fields and buttons but not the default toolbar. How to do that?
    Regards,
    Raju

    Hi Raju,
    Try this...
    First try to capture the F-codes of ur button apppearing on the dialog box and then exclude it from the PF-status by passing it to itab.
    types: begin of tab_type,
            fcode like rsmpe-func,
           end of tab_type.
    data: tab type standard table of tab_type with
                   non-unique default key initial size 10,
          wa_tab type tab_type.
    clear tab.
    move 'DELE' to wa_tab-fcode.
    append wa_tab to tab.
    move 'PRIN' to wa_tab-fcode.
    append wa_tab to tab.
    set pf-status 'STA3' excluding tab.
    Cheers,
    Simha.
    Reward all the helpful answers..

  • How to open a aspx page in a sp modal dialog for ipad?

    I have a scenario where I need to open a aspx page, inside a SP Modal Dialog.
    I have created the same and it is working perfectly in every browser except IPAD.
    Is there any different approach needs to be taken if I want to view SP Modal dialog in IPAD?
    Thanks in Advance,
    Arindam

    Hi 
    i think you need to make css change for the same as if there is some rendering issue(cropping )
    http://www.a2zmenu.com/Blogs/sharepoint/SharePoint%202010%20Model%20Dialog.aspx
    or you can use css dialog box and try.
    http://www.codeproject.com/Tips/170049/Pure-HTML-CSS-Modal-Dialog-Box-no-JavaScript
    see if this help
    http://sharepoint.stackexchange.com/questions/121147/making-sp-ui-modaldialog-scrollable-on-mobile
    http://sharepoint.stackexchange.com/questions/121147/making-sp-ui-modaldialog-scrollable-on-mobile
    Regards, Rajendra Singh If a post answers your question, please click Mark As Answer on that ost and Vote as Helpful http://sharepointundefind.wordpress.com/

  • Having problem with "windows on top" in jre 6 update 12

    I'm having issue with the jre 6 update 12 with our Swing application. It works fine with update 11. The issue is that my JFrame is somehow getting set to be "always on top" once I've opened an closed a modal dialog from that JFrame. Here is the steps:
    1) Open a JFrame (note the "alwaysOnTop" is not set to true).
    2) Click on a button which will open a modal dialog.
    3) While the dialog is open click on the underlying JFrame (nothing happens as modal dialog is blocking it).
    4) Now close the dialog and suddenly the parent JFrame is now set to be always on top. This won't happen if I didn't click on the parent JFrame while the dialog was open.
    Has anyone else encountered this issue with jre 6 update 12? I'm really puzzled as to why this is happening. There is nothing in the release note to suggest there has been any change in this area in this release. Any help would be much appreciated?

    This is a duplicate of http://forum.java.sun.com/thread.jspa?threadID=5199159, which is (more appropriately) posted in the Web Start forum. Post any replies there.
    Please do not duplicate your posts.

  • In Unix, main JFrame focus not regained after modal dialog exit.

    Hi all,
    I'm new to this forum so hopefully this is the right place to put this question.
    I have a relatively simple GUI application written in Java 6u20 that involves a main gui window (extends JFrame). Most of the file menu operations result in a modal dialog (either JFileChooser or JOptionPane) being presented to the user.
    The problem is that when running on Unix (HPUX), the process of changing focus to one of these modal dialogs occasionally results in a quick flash of the background terminal window (not necessarily that used to launch the Java), and the process of closing the modal dialogs (by any means, i.e. any dialog button or hitting esc) doesn't always return focus to the main extended JFrame object, sometimes it goes to the terminal window and sometimes just flashes the terminal window before returning to the main JFrame window.
    I think the problem is with the Unix window manager deciding that the main focus should be a terminal window, not my Java application, since the problem occurs in both directions (i.e. focus from main JFrame to modal dialog or vice versa).
    In most cases of JOptionPane, I DO specify that the main extended JFrame object is the parent.
    I've tried multiple things since the problem first occured, including multiple calls to a method which calls the following:
    .toFront();
    .requestFocus();
    .setAlwaysOnTop(true);
    .setVisible(true);
    ..on the main JFrame window (referred to as a public static object)...
    just before and after dialog display, and following selection of any button from the dialogs. This reduced the frequency of the problem, but it always tends to flash the terminal window if not return focus to it completely, and when it occurs (or starts to occur then gets worse) is apparently random! (which makes me think it's an OS issue)
    Any help appreciated thanks,
    Simon
    Self-contained compilable example below which has the same behaviour, but note that the problem DOESN'T occur running on Windows (XP) and that my actual program doesn't use auto-generated code generated by a guibuilder:
    * To change this template, choose Tools | Templates 
    * and open the template in the editor. 
    package example;  
    import javax.swing.JOptionPane;  
    * @author swg 
    public class Main {  
         * @param args the command line arguments 
        public static void main(String[] args) {  
            java.awt.EventQueue.invokeLater(new Runnable() {  
                public void run() {  
                    new NewJFrame().setVisible(true);  
    class NewJFrame extends javax.swing.JFrame {  
        /** Creates new form NewJFrame */ 
        public NewJFrame() {  
            initComponents();  
        /** This method is called from within the constructor to 
         * initialize the form. 
         * WARNING: Do NOT modify this code. The content of this method is 
         * always regenerated by the Form Editor. 
        @SuppressWarnings("unchecked")  
        // <editor-fold defaultstate="collapsed" desc="Generated Code">  
        private void initComponents() {  
            jMenuBar1 = new javax.swing.JMenuBar();  
            jMenu1 = new javax.swing.JMenu();  
            jMenuItem1 = new javax.swing.JMenuItem();  
            jMenu2 = new javax.swing.JMenu();  
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);  
            jMenu1.setText("File");  
            jMenuItem1.setText("jMenuItem1");  
            jMenuItem1.addActionListener(new java.awt.event.ActionListener() {  
                public void actionPerformed(java.awt.event.ActionEvent evt) {  
                    jMenuItem1ActionPerformed(evt);  
            jMenu1.add(jMenuItem1);  
            jMenuBar1.add(jMenu1);  
            jMenu2.setText("Edit");  
            jMenuBar1.add(jMenu2);  
            setJMenuBar(jMenuBar1);  
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());  
            getContentPane().setLayout(layout);  
            layout.setHorizontalGroup(  
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)  
                .addGap(0, 400, Short.MAX_VALUE)  
            layout.setVerticalGroup(  
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)  
                .addGap(0, 279, Short.MAX_VALUE)  
            pack();  
        }// </editor-fold>  
        private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {  
            int result = JOptionPane.showConfirmDialog(this, "hello");  
        // Variables declaration - do not modify  
        private javax.swing.JMenu jMenu1;  
        private javax.swing.JMenu jMenu2;  
        private javax.swing.JMenuBar jMenuBar1;  
        private javax.swing.JMenuItem jMenuItem1;  
        // End of variables declaration  
    }

    It won't comfort you much, but I had similar problems on Solaris 10, and at the time we traked them down to a known bug [6262392|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6262392]. The status of this latter is "Closed, will not fix", although it is not explained why...
    It's probably because the entry is itself related to another, more general, bug [6888200|http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=b6eea0fca217effffffffe82413c8a9fce16?bug_id=6888200], which is still open.
    So it is unclear whether this problem will be worked upon (I suspect that yes) and when (I suspect that... not too soon, as it's been dormant for several years!).
    None of our attempts (+toFront(...)+ etc...) solved the issue either, and they only moderately lowered the frequency of occurrence.
    I left the project since then, but I was said that the workaround mentioned in the first bug entry (see comments) doesn't work, whereas switching to Java Desktop instead of CDE reduced the frequency of the issues (without fixing them completely either) - I don't know whether it's an option on HPUX.
    Edited by: jduprez on Jul 9, 2010 11:29 AM

  • How to create application toolbar in modal dialog box in selection-screen

    Hi Experts,
    how to create application toolbar in modal dialog box in selection-screen?
    Regards,
    Swapnika

    Hi,
    Check the following link regarding Model dialog box and appication toolbar
    http://help.sap.com/saphelp_nw70/helpdata/en/d1/801b84454211d189710000e8322d00/frameset.htm
    It helps in solving your problem.
    Thanks.
    Ramya.

  • How to create non-modal dialog box?

    I'm trying to create a non-modal dialog box. The purpose is to show an alarm for the user but should leave the calling VI continuing to run. I have created such a thing -- the problem is that I can't figure out how to get the dialog box to go away! It stops running but the window just hangs around. See the attached VIs and image.
    Thanks in advance for your help,
    Chad
    Attachments:
    alarm_ui.png ‏11 KB
    alarm_ui-2.vi ‏11 KB
    message_to_user.vi ‏11 KB

    Ok, I've attached the files. Thanks for looking at this.
    Chad
    Attachments:
    alarm_ui-2.vi ‏11 KB
    message_to_user.vi ‏11 KB

  • How to create modal dialog to suspend menu activity until process completes

    I have a Swing application with several tabs, buttons, and menu items.
    When the user pushes some of the buttons, a background process is kicked off that may take some time to complete.
    When the process is finished, I get notification from a socket that the process has completed.
    I then display a dialog that notifies the user that the process has completed.
    All this is in place.
    What I need to do is to block the user from pushing any other buttons, selecting tabs or menu items while the process is in progress.
    My thought was to display a modal dialog with a message and no buttons to remove it,
    and then have the application dispose the dialog when I get the completion response.
    Is there a way to do this with a JOptionPane or some variant or do I need to create a modal dialog from scratch?
    Any suggestions?

    I was playing around with this a bit and I think it can be done.
    In the main class of my application, I have a variable
    public JFrame mainFrame;
    mainFrame = this.getFrame():
    In the page where I want to disable the application, I have the following:
    parent.mainFrame.setEnabled(false);
    (parent is a reference to the main class)
    When I get a response back from the socket, I can set
    parent.mainFrame.setEnabled(true);
    This seems to do what I want, but the fly in the ointment is that it disables the entire application.
    If I don't get a response, then the application is hung.
    Can't use the "X" button to close the application.
    I think I can work on some refinements from the clues given to make it work.
    Thanks for the feedback.

  • Focus Problem -- Two Non Modal Dialogs

    Hi ,
    In my applet, when user does something which is not allowed, I display an error message box (JOptionPane dialog - modal).
    There is another dialog box (non modal) that user
    can open to view search results and put it aside the
    applet window to do some parallel work.
    Now when error message dialog appears, the search
    dialog box also pops up even if the user
    has put this behind the applet window (by clicking browser window or applet, the search dialog goes behind the window).
    Can you please let me know, how can I get rid
    of this search dialog (non-modal) popup. I mean
    search dialog should remain open but should not
    come infront (ie should not get focus) when modal
    error message dialog pops up.
    NOTE: I don't want to make search dialog
    a modal dialog.
    Thanx,
    [email protected]

    Thanks for the reply michael. I forgot to mention particularly during my post that i am facing this problem on Solaris system. Running the same application on windows is working fine. I can't make other non-modal dialogs visibility to false because they should be visible on the screen all the time throught out the application life cycle and making it visible/non-visible doesn't get sense in my application. Does anybody is facing the same problem with Solaris system? Plz help.
    Hitesh

  • Howto create non-modal dialogs using ADF Faces

    I would like to use Dialogs in a non-modal manner.
    Trying to use
    <af:commandLink useWindow="true" action="dialog:infoPopup" blocking="false">
    <af:setActionListener from="#{row.xyId}" to="#{infoPopup.currentId}" />
    </af:commandLink>
    doesn't work as expected. I'll get the dialog, but I can't use the page behind it.
    Alternatively I tried to show the page using Javascript opening the pageInfo.faces, but here I have an order problem. The onClick event is processed first and the #{infoPopup.currentId} will be populated after rendering the JSF page. But I want to show infos depending on the xyId.
    Is there any other way to open windows/dialogs?
    Thanks in advance
    Stephan

    The "blocking" attribute basically just blocks you from clicking the commandLink or commandButton twice (or more) before the first click has been processed by the server and a response has been received.
    It is a very good util for avoiding those unwanted IndexOutOfBoundsExcepions when a user hits many buttons thus sending multiple requests to the server.
    By the way, I'd like to see the answer to the non-modal dialog window, because we have a need for them, too.
    Kind regards,
    dj

  • Problem closing a modal dialog in SharePoint 2013

    I have an application page which is opened in a modal dialog in SharePoint. In this dialog I open a document with: createNewDocumentWithProgID 
    and afterwards when I want to close the dialog there is a problem using the call: 
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.commonModalDialogClose', 1, 'Selected');
    The call itself works in some contexts when I use it with "SP.SOD.execute", but it always causes other javascript errors to be thrown, and these errors sometimes causes problems with the application page. Below are the error messages and code, but
    my question essentially is: What is causing javascript errors in SharePoint after the close modal javascript function is called?
    The errors that occur in javascipts after commonModalDialogClose has been called are: 
    Unhandled exception at line 4118, column 17 in http://sp2013server/_layouts/15/init.debug.js?rev=hd6vYIlQjxmYnM/9RloMJA==
    0x800a138f - JavaScript runtime error: Object expected
    The javascript code snippet which throws the error (in init.debug.js ?):
    for (i = 0; i < am; i++) {
                    sodDep = mll[i];
                    if (!IsSodLoaded(sodDep) && (bSync || sodDep.state != Sods.loading)) {
                        LoadSodInternal(sodDep, bSync);
    And this error: 
    Unhandled exception at line 1270, column 5 in http://sp2013server/_layouts/15/init.debug.js?rev=hd6vYIlQjxmYnM/9RloMJA==
    0x800a138f - JavaScript runtime error: Unable to get property 'caller' of undefined or null reference
    The javascript code snippet which throws the error (in init.debug.js ?):
    function ULSOnError(msg, url, line) {
        return ULSSendExceptionImpl(msg, url, line, ULSOnError.caller);
    The problem which sometimes occurs in the application page because of these javascript errors is that something in the page becomes null after the errors occur. And then a null reference exception is thrown and the dialog will not close, instead an error message
    is shown. The null reference exception is like this (could be that the web request has become null?): 
    "Server Error in '/' Application. 
    Object reference not set to an instance of an object. 
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below."
    Stacktrace: 
    [NullReferenceException: Object reference not set to an instance of an object.]
       Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PostLogRequestHandler(Object oSender, EventArgs ea) +120
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +79
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +164
    olha

    Hi,
    Based on your description, when you use JavaScript close dialogue function in SharePoint, it occurs error.
    In SharePoint 2013, I suggest you can use the JavaScript like below:
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', closeModalDialog);
    Here is a detailed article for your reference:
    https://msdn.microsoft.com/en-us/library/jj245759.aspx
    Thanks
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jerry Guo
    TechNet Community Support

  • How to create a modal dialog, which I can still interact with document when the dialog is show.

    HI,
        Now, I am developing an automation plugin, and want to create a modal dialog, which I still can interact with document when the dialog is show.
        I find photoshop has some modal dialog have this function, such as the dialog of Customize Proof Condition and the dialog of Color Settings. Are these dialogs not modal dialog?
         Thanks!

    The whole point of a modal dialog is that you cannot interact with other things while it is active.
    And Photoshop does not support plugins accessing the rest of Photoshop while any plugin UI is active.

  • Problem in modal dialog box

    Hello,
    I've created a function which call a modal dialog box. In this one, the user has to choose a value in a listbox. It's like a popup for the user.
    The screen is called like below:
    CALL SCREEN 0500 STARTING AT 5 5
                       ENDING   AT 100 10.
    The screen is defined with a pf-status containing only one icon(pf-key) with value VALID. In the process after input, I'm controlling the value like below:
    MODULE USER_COMMAND_0500 INPUT.
    data : save_ok like sy-ucomm.
    save_ok = lv_code.
      case save_ok.
        when  'VALID'.
          if lv_prio(2) lt 4.
            message s098(ze).
          else.
            set screen 0.
            leave screen.
          endif.
        when others.
        message s098(ze).
      endcase.
    ENDMODULE.                 " USER_COMMAND_0500  INPUT
    I have a bug when the program is calling twice the function means the popup.
    Instance of program Z.
    loop at X.
       call function YY.......
    endloop.
    The table X contain two values.
    When the popup is called the first time in the loop, all is ok, but when the popup is called the next time, if the user doesn't choose a value in the listbox and just press on the keyboard Enter, then the system go completly out of the program Z and doesn't go in the user_command !!!!
    I've defined the field (listbox) as required, but no effect.
    Is it a bug of the system ? or do I defined the screen incorrectly or ???
    Thanks a lot for your help.

    Hi merle,
    i  have u debugged the program ?  Is it coming to user-command event ?
    What is the type of this field lv_prio ?
    comment set screen 0  & use leave to screen 0
    if lv_prio(2) lt 4.
    message s098(ze).
    else.
    leave to screen 0.
    endif.

Maybe you are looking for

  • Not accepting serial number after reinstall

    I am working with CS3 - Design Suite. I recently installed a CS4, in addition, to check out some of the new features. (It was installed from a friend's disk, but was already active on 2 computers - so I was just testing for 30 days). Once the 30 days

  • How to delete backend system data from GRC,GRC 10 AC

    Hello experts, we have connected multiple ECC systems to GRC by creating connectors with respect to each system and currently we are using,now due to some reasons customer requested to delete complete data from one of the ECC system from GRC. we are

  • How to add data through matrix from sales order row level to

    user defined document type table ... i created matrix in user defined form, i placed one edit text box on that form when i entered docnum of sales order the data of sales order row level should have to upload to matrix , after fill up the some data i

  • Enhance FITV_FPM :Change pop up window text

    HI All, I need to add text in a popup based on expense type entered by the user while creating expense. WDC:FITV_FPM is already enhanced to show the existing text in a popup. I need to add some more text on this pop up based on expense type. Already

  • Without modem will airport still function

    my modem has ceased to function. But should not the airport time capsule still back up iMac and serve as a link between Mac and wireless printer