Messages - dialogs

Hi,
could anyone tell me what class is used to create popup messages? like a box with a message and a button for o.k. or cancel?

You can show dialog boxes with JDialog, or even easier with the JOptionPane.
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

Similar Messages

  • Problem in Displaying JOptionpane Message Dialog (JRE 1.5.0_04 or later)

    Hi! All,
    I am getting a deadlock kind a situation while displaying JOptionpane message dialog. It's very rare to simulate also. I am also posting the Thread dump which i have taken programmatically, when this situation arises.
    For your Information, I am using JRE 1.5.0_04 or later version on Windows XP.
    We searched on Java.sun.com site, & we got that two bugs are related to our problem, but there are arises in JRE 1.4.2 or before version & have been fixed at JRE 1.5 .
    Follwing are the bugs ID in Sun Bugs Database: 4978089, 4828019.
    Can anyone suggest me which is the stable JRE 1.5 version to avoid this problem. Also can anyone suggest me the workaround of this problem. I want to fix this in our application ASAP.
    following is My Thread Dump :
    Thread[Finalizer,8,system]
         java.lang.Object.wait(Native Method)
         java.lang.ref.ReferenceQueue.remove(Unknown Source)
         java.lang.ref.ReferenceQueue.remove(Unknown Source)
         java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
    Thread[Java2D Disposer,10,javawsApplicationThreadGroup]
         java.lang.Object.wait(Native Method)
         java.lang.ref.ReferenceQueue.remove(Unknown Source)
         java.lang.ref.ReferenceQueue.remove(Unknown Source)
         sun.java2d.Disposer.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[JCIL_Sess(813251)_EvtThd(24880015),5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         java.awt.EventQueue.invokeAndWait(Unknown Source)
         javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
         in.co.netsol.telecom.desktop.CallAppearanceTable$EventAdapter.OnCallEstablished(CallAppearanceTable.java:982)
         in.co.netsol.telecom.ctios.events.EventSinkAdapter.OnEvent(EventSinkAdapter.java:142)
         com.cisco.cti.ctios.cil.EventPublisher.PostEvent(EventPublisher.java:175)
         com.cisco.cti.ctios.cil.EventPublisher.FireEvent(EventPublisher.java:142)
         com.cisco.cti.ctios.cil.CtiOsSession.FireEvent(CtiOsSession.java:1849)
         com.cisco.cti.ctios.cil.Call.FireEvent(Call.java:254)
         com.cisco.cti.ctios.cil.Call.OnCallEstablishedEvent(Call.java:1136)
         com.cisco.cti.ctios.cil.Call.OnEvent(Call.java:943)
         com.cisco.cti.ctios.cil.CtiOsSession.OnEvent(CtiOsSession.java:2107)
         com.cisco.cti.ctios.cil.CilServiceEvent.ReceiverThread(CilServiceEvent.java:256)
         com.cisco.cti.ctios.cil.CilServiceEvent$1.run(CilServiceEvent.java:173)
    Thread[pool-1-thread-5,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         java.awt.EventQueue.invokeAndWait(Unknown Source)
         javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
         in.co.netsol.telecom.desktop.command.MakeAgentReadyCommand$EventAdapter$1.run(MakeAgentReadyCommand.java:190)
         java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[DestroyJavaVM,5,main]
    Thread[AWT-Shutdown,5,javawsApplicationThreadGroup]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         sun.awt.AWTAutoShutdown.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[JCIL_Conn(18096534)_Watchdog,5,main]
         java.lang.Object.wait(Native Method)
         com.cisco.cti.ctios.util.UnNamedEvent.WaitForSingleObject(UnNamedEvent.java:147)
         com.cisco.cti.ctios.cil.CilConnection.WatchdogThread(CilConnection.java:527)
         com.cisco.cti.ctios.cil.CilConnection$1.run(CilConnection.java:1071)
    Thread[AWT-EventQueue-0,6,main]
         java.awt.Container.getComponents_NoClientCode(Unknown Source)
         java.awt.Container.getComponents(Unknown Source)
         javax.swing.JToolBar.getComponentAtIndex(Unknown Source)
         javax.swing.plaf.basic.BasicToolBarUI.navigateFocusedComp(Unknown Source)
         javax.swing.plaf.basic.BasicToolBarUI$Actions.actionPerformed(Unknown Source)
         javax.swing.SwingUtilities.notifyAction(Unknown Source)
         javax.swing.JComponent.processKeyBinding(Unknown Source)
         javax.swing.JComponent.processKeyBindings(Unknown Source)
         javax.swing.SwingUtilities.processKeyBindings(Unknown Source)
         javax.swing.UIManager$2.postProcessKeyEvent(Unknown Source)
         java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
         java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
         java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
         java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
         java.awt.Component.dispatchEventImpl(Unknown Source)
         java.awt.Container.dispatchEventImpl(Unknown Source)
         java.awt.Window.dispatchEventImpl(Unknown Source)
         java.awt.Component.dispatchEvent(Unknown Source)
         java.awt.EventQueue.dispatchEvent(Unknown Source)
         java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         java.awt.EventDispatchThread.run(Unknown Source)
    Thread[AWT-Windows,6,main]
         sun.awt.windows.WToolkit.eventLoop(Native Method)
         sun.awt.windows.WToolkit.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[Timer-0,5,javawsApplicationThreadGroup]
         java.lang.Thread.dumpThreads(Native Method)
         java.lang.Thread.getAllStackTraces(Unknown Source)
         in.co.netsol.telecom.log.ThreadDumpLoggingTask.getStackTraces(ThreadDumpLoggingTask.java:47)
         in.co.netsol.telecom.log.ThreadDumpLoggingTask.run(ThreadDumpLoggingTask.java:36)
         java.util.TimerThread.mainLoop(Unknown Source)
         java.util.TimerThread.run(Unknown Source)
    Thread[JCIL_Conn(18096534)_Rcvr,5,main]
         java.net.SocketInputStream.socketRead0(Native Method)
         java.net.SocketInputStream.read(Unknown Source)
         com.cisco.cti.ctios.cil.NetPort.ReceiveData(NetPort.java:405)
         com.cisco.cti.ctios.cil.NetPort.ReceiveData(NetPort.java:363)
         com.cisco.cti.ctios.cil.CilPacket.ReadFromPort(CilPacket.java:649)
         com.cisco.cti.ctios.cil.CilConnection.ReadPacket(CilConnection.java:670)
         com.cisco.cti.ctios.cil.Connection.ReceiverThread(Connection.java:398)
         com.cisco.cti.ctios.cil.Connection$1.run(Connection.java:472)
    Thread[pool-1-thread-2,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         java.awt.EventQueue.invokeAndWait(Unknown Source)
         javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
         in.co.netsol.telecom.desktop.command.SupervisorAssistCommand$EventAdapter$1.run(SupervisorAssistCommand.java:152)
         java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[pool-1-thread-1,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         java.awt.EventQueue.invokeAndWait(Unknown Source)
         javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
         in.co.netsol.telecom.desktop.command.ConferenceCallCommand$EventAdapter$1.run(ConferenceCallCommand.java:144)
         java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[JCIL_Svc(5450181)_TxQThd(3083604),5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         com.cisco.cti.ctios.util.QueueThread.GetQItem(QueueThread.java:152)
         com.cisco.cti.ctios.util.QueueThread.run(QueueThread.java:259)
    Thread[pool-2-thread-1,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         java.awt.Dialog.show(Unknown Source)
         javax.swing.JOptionPane.showOptionDialog(Unknown Source)
         javax.swing.JOptionPane.showMessageDialog(Unknown Source)
         javax.swing.JOptionPane.showMessageDialog(Unknown Source)
         in.co.netsol.telecom.desktop.DesktopMainPanel$3.run(DesktopMainPanel.java:1871)
         java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[Signal Dispatcher,9,system]
    Thread[Reference Handler,10,system]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
    Thread[TimerQueue,5,javawsApplicationThreadGroup]
         java.lang.Object.wait(Native Method)
         javax.swing.TimerQueue.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[pool-1-thread-4,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         java.awt.EventQueue.invokeAndWait(Unknown Source)
         javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
         in.co.netsol.telecom.desktop.command.MakeAgentNotReadyCommand$EventAdapter$1.run(MakeAgentNotReadyCommand.java:146)
         java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[pool-1-thread-6,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         java.awt.EventQueue.invokeAndWait(Unknown Source)
         javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
         in.co.netsol.telecom.desktop.command.TransferCallCommand$EventAdapter$1.run(TransferCallCommand.java:136)
         java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[traceMsgQueueThread,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         com.sun.deploy.util.Trace$TraceMsgQueueChecker.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thread[pool-1-thread-3,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Unknown Source)
         java.awt.EventQueue.invokeAndWait(Unknown Source)
         javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
         in.co.netsol.telecom.desktop.command.EmergencyCommand$EventAdapter$1.run(EmergencyCommand.java:146)
         java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         java.lang.Thread.run(Unknown Source)
    Thanks & Regards,
    Pradeep Gupta

    Update to the latest version 1.5.0_06 available from:
    http://java.sun.com/j2se/1.5.0/download.jsp
    It is advisable to remove previous version(s) installations unless required otherwise for a specfic application.

  • How to change the Button content as CamelCasing in Windows phone 8.1 Message dialog

    This was already raised in
    Stack over flow, While showing the native Message dialog in Windows phone, i cant change the captions as camel case of command buttons. Is this a bug with windows phone 8.1(WinRT) are is there any workaround to fix this issue?
    Sankar

    This isn't recommended and violates the system style.
    If you want a custom dialog you need to use a different control. The MessageDialog always lower cases the buttons to match the system style and is not generally customizable.
    If you use a ContentDialog you can customize it fairly extensively, and it doesn't try to fix the case of its buttons. You'll probably want to create your own ContentDialog class (there's a template under Add.New Item...) with your desired contents, but here's
    a quick content-free example:
    ContentDialog cd = new ContentDialog();
    cd.Title = "My Title";
    cd.PrimaryButtonText = "CoNtInUe";
    cd.SecondaryButtonText = "sToP";
    await cd.ShowAsync();
    Also note that the guidelines
    for message dialogs suggest using clear and specific verbs rather than generic OK/Cancel.

  • Need help in makinga message dialog box dissapear automaticly

    hi i have the following code that displays a message dialog box that tells me when a user is online.
    how do i make it disapear automaticly after say, 5 seconds.on msn messenger a similar technique is used where when a user comes online, a message box appears stating who and then dissapears after a couple of seconds..
    i need this to work so that say if a user is away from the pc for such a given time, the message box will just pile up if loads of users have appeared online during the duration that the user was away from his pc..
    here is what i have
    JOptionPane.showMessageDialog(null, "error " + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);

    U cant do that using a JOptionPane, use a JDialog instead.
    use dialog.setVisible(true);
    after this start a timertask which executes after 5 seconds and disposes the dialog

  • How to make the length of Message Dialog follows the length of text

    Hi all.
    I am making a Message Dialog From JOptionPane because i do not want to use some static methods of JOptionPane (JOptionPane.Show ...)
    My source codes following :
    public static void showMessageDialog(String message) {
              JOptionPane optionPane = new JOptionPane();
              JDialog dialog = optionPane.createDialog(null, "Message");
              optionPane.setMessage(message);
              optionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE);
              JButton btnOk = new JButton("OK");
              optionPane.setOptions(new Object[] { btnOk });
              dialog.setVisible(true);
    }It runs well but having a problem. When message is a long text --> JDialog can not show all text, dialog's length does not resize automatically following message's length.
    Have a the way to make it ? How to solve ?
    Thanks in advance !
    Diego
    Edited by: ThuCT on Feb 1, 2010 3:28 AM

    Add a dialog.pack() call. See SSCCE below.
    i do not want to use some static methods of JOptionPane (JOptionPane.Show ...)Why? In this case the built-in static method handles the size as expected.
    public class TestJOptionPaneSizeAdaptsToMessageLength {
       public static void main(String... args) {
           String message = "This is a very long message, I say long but really it is a very very long one, and when I say long I do mean it!!! ";
           message += message;
           message += message;
           message += message;
           showMessageDialog(message);
    //       showMessageDialogUsingStaticJOptionPaneMethod(message);
       public static void showMessageDialog(String message) {
            JOptionPane optionPane = new JOptionPane();
            JDialog dialog = optionPane.createDialog(null, "Message");
            optionPane.setMessage(message);
            optionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE);
            JButton btnOk = new JButton("OK");
            optionPane.setOptions(new Object[] { btnOk });
            dialog.pack();
            dialog.setVisible(true);
       public static void showMessageDialogUsingStaticJOptionPaneMethod(String message) {
            JOptionPane.showMessageDialog(null, message);
    }Edited by: jduprez on Feb 1, 2010 11:39 AM
    I have to admit, I am a zealous fan of the built-in JOptionPane.showXxx methods :o)

  • JOptionPane show Message Dialog always on top found a Solution

    just thought of a solution for the age old java problem with message boxes / dialogs / input .
    It's funny when you google it you'll find like a million people asking for a solution but none or very few that gives an answer that works.
    this is probly not a new solution but i came up with this yesterday and thought i would "share".
    dunno why the java developers hasnt made a always on top function for this since there seems to be a very high demand for it.
    this hax will hopefully work at all times.
    hope google will find this thread, i searched for a solution yesterday and found none? which is surprising and im a pro googler too.
    import javax.swing.*;
    public class main{
         public static void main(String args[]){
              JFrame j=new JFrame();
              j.setAlwaysOnTop(true);
              j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              j.setVisible(true);
              j.setVisible(false);
              JOptionPane.showMessageDialog(j,"hi");
              System.exit(0);
    }

    I didn't realize it was an "age old problem." The JOptionPane's showXXX methods just show an ordinary modal dialog. If you want to set the alwaysOnTop property of said dialog then you just need to obtain a reference and call the method in question.
    JOptionPane op = new JOptionPane("hi",JOptionPane.INFORMATION_MESSAGE);
    JDialog dialog = op.createDialog("Message Dialog");
    dialog.setAlwaysOnTop(true); //<-- this line
    dialog.setModal(true);
    dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    dialog.setVisible(true);No need for an intermediate frame.

  • JRE 1.6. 0_01 is giving issues in message dialog box size

    Hi There,
    I am displaying message dialog for one of my web application. To resize the dialog automatically, I have set getPrefferedSize() property.
    This is working fine with JRE 1.5.0_11 and all lower version, even ok with 1.4.x. But if I am viewing the applet in a browser having JRE 1.6.0, dialog box size is automatically streatched. Height of the dialog box is increased automatically more than the desktop height. I can not view top & bottom area of the dialog box on my desktop.
    Please guide me why is this issue only with JRE 1.6.0 and what should I do to eliminate & resolve it.
    Thanks.

    Really? I thought all official versions would be downloadable through webstart. I'm curious why would Sun not make them available. Now I need to explain to my higher-ups why I promised to get webstart to automatically update all our user's JRE but now failed to make good. :-(
    Regarding the printing problem: With b105 the printouts would have text that is upside, mirrored and cropped. It was a total mess. The problem is reproducible. We manually upgraded some users to b106 and the problem disappeared completely. I think Sun fixed it in 106 but now the problem is getting all our users onto JRE b106.
    Java Webstart is supposed to do this for me but now it appears to be failing me big time.

  • SQL plus pop up message dialog

    Dear all,
    Did anyone come across any experience like that:
    When I execute a SQL statment that may need return a several thousands line in SQLPlus,
    If I used SQLPlus version 3.3.4.00 (Oracle 7), a pop up message dialog will come up like
    "Query is Executing ..." and a "Cancel" button is available in dialog box also.
    However, If I used SQLPlus version 8.0.5 (Oracle 8 or laster), this pop up won't show up anymore.
    The pop up is useful if I need to break the process and I just want to know if anything is required to configured on latest SQLPlus to activate this!
    Thanks and Regards
    Kenneth

    The removal of the cancel dialog was an unfortunate side effect
    of an internal rewrite of SQL*Plus code in 8.0. The fundamental
    problem still persists into 9i and it is not until 9i release 2
    (being touted on www.oracle.com) that the iSQL*Plus web interface
    (though not the SQL*Plus GUI on Windows) has a cancel button.
    This was spoken about on the OTN iSQL*Pus discussion forum a
    while back.
    -- CJ

  • JOptionPane's message dialog over JDialog not recognizing mouse click

    I have a JOptionPane's message dialog like JOptionPane.showMessageDialog() which comes over a JDialog. When I try to click the OK button of this message dialog, nothing is happening. But, Enter key and Escape keys are working on it.
    Can any one give a solution?

    Hi,
    here are the steps how it goes.
    Step 1:
    private void generateMessageDialog(
            String message,
            int messageType,
            String messageTypeText,
            Component parentFrame)
            JOptionPane optionPane = new JOptionPane();
            optionPane.setMessage(message);
            optionPane.setMessageType(messageType);
            JDialog dialog = optionPane.createDialog(parentFrame, 
    messageTypeText);
            dialog.show();
    }If an exception occurs while connecting to my server, this method will be called to generate an error dialog.
    I have another thread which monitors the connection to server every 2500 ms. If the connection is lost, this thread will automatically generates a logon dialog. This dialog is a custom dialog that contains login fields.
    Step 2:
    public void run()
            int previousState = -1;
            while(previousState != CErrorCodes.SESSION_INVALID && previousState != CErrorCodes.NO_CONNECTION_TO_SERVER)
                int currentState = isConnected();
                // Check if a logoff action is pending
                if (currentState == CErrorCodes.REQUEST_SUCCEEDED)
                    if (getClientController().isLogOffPending())
                        break;
                previousState = currentState;
                try
                    sleep(2500);
                catch (InterruptedException e)
                    break;
    // generate the logon  dialog
            getClientController().getLogOnDialog();
    }If step 2 is executed before step 1, then the dialog generated by step 1 will come over the logon dialog generated by step 2. In this case, the ok button of the dialog generated in step 1 will not recognize mouse click. but enter or escape works. Both the dialogs are modal.
    Please let me know if you need furthur info. I look forward for your rep.
    Edited by: MallikMajety on Nov 8, 2007 6:02 AM

  • ADF: How to display exceptions on message dialogs

    Hi,
    Is it possible to display error messages and exceptions on message dialog (such as mandatory fields check) or another page instead of the default messages area in the page.
    Regards,
    Ahmad Esbita

    Hi,
    I think you will need to write a custom component to do it.
    When i've used ADF 10.1.2 with Struts i've created a Taglib to generate a javascript alert with error messages.
    You can do the same thing with ADF Faces, if don't have another solution.
    Regards

  • Close Popup on clicking OK button of Information Message Dialog

    JDev 11.1.1.5.0 ADF BC
    I have a popup and a dialog inside it where user inputs some data and clicks Save button.
    I am showing an Information message on click of Save on successful insertion of data into the database.
    What I am looking to achieve is that I want to close the popup window on click of the OK button which is inside the information message dialog that is been shown on successful Saving of data.
    There is already a similar thread Close popup in adf but that doesn't have a correct answer.

    1) Bind the main popup to a bean variable:
    <af:popup id="mainPopup" binding="#{MyBean.myPopup}" ...>
    public class MyBean
      private RichPopup myPopup;
    }2) Add a DialogListener to the <af:dialog> of the information message:
    <af:popup id="infoPopup">
      <af:dialog dialogListener="#{MyBean.infoPopupDialogListener}">
        ... Info message here ...
      </af:dialog>
    </af:popup>3) Use this DialogListener to close the main popup programatically:
      public void infoPopupDialogListener(DialogEvent dialogEvent) {
        myPopup.hide();
    }Dimitar

  • Popup Message Dialog  in Purchase Order

    Hi Guys,
    On Purchase Order hav the Popup Message Dialog to show all the messages that occurs during the creation of the Purchase Order. Now, I have the following problem ;
    - I created on Purchase Order and occurred during the creation of 3 posts.
    How can I cath the index of the 3rd Post, for example.
    tks
    Flavio Ferreira

    Hi,
    Check the condition record key comb1 and 2 for the vendor for the document type, if two output types are maintained delete one and try.
    Regards,
    BK

  • Message dialogs

    Hi,
    In my code I am showing a message dialog (using a Message object) and checking which button was pressed (Yes, No, Cancel). The dialog is shown a number of times in a loop. The first time it works fine, but then it starts to give the result as 0 every time, no matter which button is pressed. I am reusing the same Message object.
    Oddly, if a different message dialog is shown inbetween showing the original one and checking its result, this seems to fix the problem.
    Does anyone know why this could be happening?
    Thanks for any help you may be able to give,
    Katie

    Try this:
    public class DialogTest extends JApplet {
    //------------- properties -----------------------------------------
    JButton
         b1 = new JButton("Start");
    ActionListener al = new ActionListener() {
         public void actionPerformed(ActionEvent e) {
         int n = optionPane.showConfirmDialog(null, "choose one", "choose two", JOptionPane.YES_NO_OPTION);
         txt.setText("Choice " + n);
    JLabel
         txt = new JLabel("INIT");
    final JOptionPane optionPane = new JOptionPane();
    public void init(){
         Container cp = getContentPane();
         cp.setLayout(new FlowLayout());
         cp.add(b1);
         b1.addActionListener(al);
         cp.add(txt);
    }//init()
    //----------

  • Duplicate message dialogs

    Hi,
    I am outputting a message dialog from a thread within an applet.
    However when I do this, I aleways get two dialogs the same, one
    hidden behind the applet.
    I assume that since it normally only produces one dialog, it has
    something to do with the thread.
    Does anyone have any ide how to resolve this problem ?
    Sue

    I can't reproduce your problem. I downloaded SwingWorker 3 and used this code:import java.awt.*;
    import javax.swing.*;
    public class Test extends JApplet {
        public void init () {
            new SwingWorker () {
                public Object construct () {
                    return new ArchiveRestorePullTask ();
            }.start ();
            getContentPane ().add (new JLabel ("Just testing...", SwingConstants.CENTER));
        private class ArchiveRestorePullTask {
            public ArchiveRestorePullTask () {
                try {
                    Thread.sleep (5000);
                } catch (InterruptedException exception) {}
                if (true) {
                    Toolkit.getDefaultToolkit ().beep ();
                    JOptionPane.showMessageDialog (Test.this, "Archive complete", "Archive complete", JOptionPane.INFORMATION_MESSAGE, null);
    }Kind regards,
      Levi

  • Dispatcher dies with message dialog queue standstill

    Hi All,
    SAP WAS 6.20 is installed in win2000 server with oracle 9i as the database.
    When trying to start the server with SAP managment console
    messeger and dispatcher comes up fine. But within some seconds dispatcher stops.
    When trying to restart again messeger starts but dispatcher turns yellow with a message "dialog queue standstill" and stops.
    Please see the developer trace below.Need your help to bring the server up.
    Thanks and regards,
    Niranjan
    trc file: "dev_w11", trc level: 1, release: "620"
    ACTIVE TRACE LEVEL           1
    ACTIVE TRACE COMPONENTS      all, M

    B Wed Oct 27 22:37:44 2004
    B  create_con (con_name=R/3)
    B  Loading DB library 'D:\usr\sap\KNW\SYS\exe\run\dboraslib.dll' ...
    B  Library 'D:\usr\sap\KNW\SYS\exe\run\dboraslib.dll' loaded
    B  Version of 'D:\usr\sap\KNW\SYS\exe\run\dboraslib.dll' is "620.02", patchlevel (0.1504)
    B  New connection 0 created
    M  systemid   560 (PC with Windows NT)
    M  relno      6200
    M  patchlevel 0
    M  patchno    1509
    M  intno      20020600
    M  make:      multithreaded, ASCII
    M  pid        1916

    M  ***LOG Q0Q=> tskh_init, WPStart (Workproc11 1916) [dpxxdisp.c   1088]
    I  MtxInit: -2 0 0
    M  DpShMCreate: sizeof(wp_adm)          12920     (760)
    M  DpShMCreate: sizeof(tm_adm)          1692424     (8420)
    M  DpShMCreate: sizeof(wp_ca_adm)          18000     (60)
    M  DpShMCreate: sizeof(appc_ca_adm)     6000     (60)
    M  DpShMCreate: sizeof(comm_adm)          192000     (384)
    M  DpShMCreate: sizeof(wall_adm)          (22440/34344/56/100)
    M  DpShMCreate: SHM_DP_ADM_KEY          (addr: 05CC0040, size: 1979784)
    M  DpShMCreate: allocated sys_adm at 05CC0040
    M  DpShMCreate: allocated wp_adm at 05CC0638
    M  DpShMCreate: allocated tm_adm_list at 05CC38B0
    M  DpShMCreate: allocated tm_adm at 05CC38D8
    M  DpShMCreate: allocated wp_ca_adm at 05E60BE0
    M  DpShMCreate: allocated appc_ca_adm at 05E65230
    M  DpShMCreate: allocated comm_adm_list at 05E669A0
    M  DpShMCreate: allocated comm_adm at 05E669B8
    M  DpShMCreate: allocated ca_info at 05E957B8
    M  DpShMCreate: allocated wall_adm at 05E957C0
    X  EmInit: MmSetImplementation( 2 ).
    X  <ES> client 11 initializing ....
    X  Using implementation std
    M  <EsNT> Memory Reset enabled as NT default
    X  ES initialized.

    M Wed Oct 27 22:37:45 2004
    M  calling db_connect ...
    C  Got ORACLE_HOME=D:\oracle\ora92 from environment

    C Wed Oct 27 22:37:46 2004
    C  Client NLS settings: AMERICAN_AMERICA.WE8DEC
    C  Logon as OPS$-user to get SAPKNW's password
    C  Connecting as /@KNW on connection 0 ...
    C  Attaching to DB Server KNW (con_hdl=0,svchp=081810CC,svrhp=08183334)
    C  Starting user session (con_hdl=0,svchp=081810CC,srvhp=08183334,usrhp=0818BB1C)

    C Wed Oct 27 22:37:47 2004
    C  *** ERROR => OCI-call 'OCISessionBegin' failed: rc = 1033
    [dboci.c      3795]
    C  Detaching from DB Server (con_hdl=0,svchp=081810CC,srvhp=08183334)
    C  *** ERROR => CONNECT failed with sql error '1033'
    [dboci.c      9702]
    C  Try to connect with default password
    C  Connecting as SAPKNW/<pwd>@KNW on connection 0 ...
    C  Attaching to DB Server KNW (con_hdl=0,svchp=081810CC,svrhp=08183334)
    C  Starting user session (con_hdl=0,svchp=081810CC,srvhp=08183334,usrhp=0818BB1C)
    C  *** ERROR => OCI-call 'OCISessionBegin' failed: rc = 1033
    [dboci.c      3795]
    C  Detaching from DB Server (con_hdl=0,svchp=081810CC,srvhp=08183334)
    C  *** ERROR => CONNECT failed with sql error '1033'
    [dboci.c      9702]
    B  ***LOG BV3=> severe db error 1033      ; work process is stopped [dbsh#2 @ 957] [dbsh    0957 ]
    B  ***LOG BY2=> sql error 1033   performing CON [dblink#1 @ 419] [dblink  0419 ]
    B  ***LOG BY0=> ORA-01033: ORACLE initialization or shutdown in progress [dblink#1 @ 419] [dblink  0419 ]
    M  ***LOG R19=> tskh_init, db_connect ( DB-Connect 000256) [thxxhead.c   1199]
    M  in_ThErrHandle: 1
    M  *** ERROR => tskh_init: db_connect (step 1, th_errno 13, action 3, level 1) [thxxhead.c   8787]

    M  Info for wp 11

    M    stat = 4
    M    reqtype = 3
    M    rq_info = 0
    M    act_reqtype = -1
    M    tid = -1
    M    mode = 255
    M    len = -1
    M    rq_id = -1
    M    rq_source = 255
    M    last_tid = 0
    M    last_mode = 0
    M    int_checked_resource(RFC) = 0
    M    ext_checked_resource(RFC) = 0
    M    int_checked_resource(HTTP) = 0
    M    ext_checked_resource(HTTP) = 0
    M    report = >                                        <
    M    action = 0
    M    tab_name = >                              <

    M  *****************************************************************************
    M  *
    M  *  LOCATION    SAP-Server WHPWKNOW_KNW_00 on host WHPWKNOW (wp 11)
    M  *  ERROR       tskh_init: db_connect
    M  *
    M  *  TIME        Wed Oct 27 22:37:47 2004
    M  *  RELEASE     620
    M  *  COMPONENT   Taskhandler
    M  *  VERSION     1
    M  *  RC          13
    M  *  MODULE      thxxhead.c
    M  *  LINE        8932
    M  *  COUNTER     1
    M  *
    M  *****************************************************************************

    M  Entering TH_CALLHOOKS
    M  ThCallHooks: call hook >ThrSaveSPAFields< for event BEFORE_DUMP
    M  *** ERROR => ThrSaveSPAFields: no valid thr_wpadm [thxxrun1.c   672]
    M  *** ERROR => ThCallHooks: event handler ThrSaveSPAFields for event BEFORE_DUMP failed [thxxtool3.c  238]
    M  Entering ThSetStatError
    M  Entering ThReadDetachMode
    M  call ThrShutDown (1)...
    M  ***LOG Q02=> wp_halt, WPStop (Workproc11 1916) [dpnttool.c   356]

    Hi,
    check please your konfiguration files (tnsnames.ora, listener.ora, sqlnet.ora). Entries like service or global names should be  the same in tnsnames.ora and listener.ora files.
    In sqlnet.ora you should have the entry<i> SQLNET.AUTHENTICATION_SERVICE = (TNS).</i> You need it for your sap users (<SID>adm and SAPSERVICE<SID>).
    Read please the note: 480266.
    Your environment variables should be set correct. Read please the note 556232 for it (WINDOWS)
    Read also please the notes 35278, 445038 and 400241.
    Best regards
    K.Baran
    Message was edited by: Kutbettin Baran
    Message was edited by: Kutbettin Baran
    Message was edited by: Kutbettin Baran

  • Validation and  Error Message Dialog Box

    hi,
    I created 2 items DateFrom and DateTo.....when User enter dates into these items I need validate these dates i.e DateTo should be greater than DateFrom
    if it is not so,,,,I need to Popup a Error message in Dialog Box.........
    and this Error should not terminate the Program.
    Thanks in Advanced
    regards,
    Radhika

    Radhika,
    You need to attach PPR event to the Date To column. In the event code in controller, you can validate do the validation and accordingly throw error on the page.
    Why do you need a pop up(javascript alert) for that?
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for