ShowInternalMessageDialog vs showMessageDialog

I originally posted this to the Java Programming list, but in retrospect, this is probably the better place to look for help... please don't be too hard on me if this is really obvious...
I'm trying to show a pop-up box with a message to indicate an error to the user; the JOptionPane.showMessageDialog works just fine, however when I use JOptionPane.showInternalMessageDialog, I get a NullPointerException being thrown by the L&F component(s) as follows (I'm currently running this as an applet via appletviewer):
Exception occurred during event dispatching:
java.lang.NullPointerException
at javax.swing.plaf.metal.MetalLookAndFeel.getPrimaryControlDarkShadow(MetalLookAndFeel.java:1083)
at javax.swing.plaf.metal.MetalBorders$OptionDialogBorder.paintBorder(MetalBorders.java:188)
at javax.swing.JComponent.paintBorder(JComponent.java:574)
at javax.swing.JComponent.paint(JComponent.java:740)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:23)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:54)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:91)
at java.awt.Container.paint(Container.java:960)
at java.awt.Container.update(Container.java:981)
at sun.awt.RepaintArea.update(RepaintArea.java:337)
at sun.awt.motif.MComponentPeer.handleEvent(MComponentPeer.java:404)
at java.awt.Component.dispatchEventImpl(Component.java:2722)
at java.awt.Container.dispatchEventImpl(Container.java:1214)
at java.awt.Component.dispatchEvent(Component.java:2556)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:333)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
Here's the call I'm making to display the Dialog box:
JOptionPane.showInternalMessageDialog( this, getString( "Messages.NoPOsSelected" ), "Error", JOptionPane.ERROR_MESSAGE );I guess that I've really got two questions about this whole thing... 1) What could be causing the NullPointerException and 2) What is the real difference between JOptionPane.showMessageDialog and JOptionPane.showInternalMessageDialog?

add 2)
The answer is contained in the API doc of JOptionPane
"Each of these methods also comes in a showInternalXXX flavor, which uses an internal frame to hold the dialog
box (see JInternalFrame). Multiple convenience methods have also been defined -- overloaded versions of the
basic methods that use different parameter lists."
JInternalFrame is used within JDesktopPane.
add 1) I'm not sure but I think it has to do with 'peers'. Your applet has a peer to the part of the screen specified in the htmlpage. A JInternalFrame
relies on the peer requested by the topmost container of a JDesktopPane (usually a JFrame wich itself inherits from java.awt.Frame).
So for the 'showInternalXXX' exists no peer and the Graphics-object may be null.
About peers read about the "heavyweight" and "lightweight" components in the swing-tutorial
uiswing/start/swingIntro.html#awt
'How Are Swing Components Different from AWT Components? '

Similar Messages

  • JOptionPane.showMessageDialog vs JOptionPane.showInternalMessageDialog

    This is my first post to the message boards, so please don't be too hard on me if this is really obvious...
    I'm trying to show a pop-up box with a message to indicate an error to the user; the JOptionPane.showMessageDialog works just fine, however when I use JOptionPane.showInternalMessageDialog, I get a NullPointerException being thrown by the L&F component(s) as follows (I'm currently running this as an applet via appletviewer):
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.metal.MetalLookAndFeel.getPrimaryControlDarkShadow(MetalLookAndFeel.java:1083)
    at javax.swing.plaf.metal.MetalBorders$OptionDialogBorder.paintBorder(MetalBorders.java:188)
    at javax.swing.JComponent.paintBorder(JComponent.java:574)
    at javax.swing.JComponent.paint(JComponent.java:740)
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:23)
    at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:54)
    at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:91)
    at java.awt.Container.paint(Container.java:960)
    at java.awt.Container.update(Container.java:981)
    at sun.awt.RepaintArea.update(RepaintArea.java:337)
    at sun.awt.motif.MComponentPeer.handleEvent(MComponentPeer.java:404)
    at java.awt.Component.dispatchEventImpl(Component.java:2722)
    at java.awt.Container.dispatchEventImpl(Container.java:1214)
    at java.awt.Component.dispatchEvent(Component.java:2556)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:333)
    at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
    I guess that I've really got two questions about this whole thing... 1) What could be causing the NullPointerException and 2) What is the real difference between JOptionPane.showMessageDialog and JOptionPane.showInternalMessageDialog?

    Here's the call that I'm using to the function -- sorry for not posting that originally...
    JOptionPane.showInternalMessageDialog( this, getString( "Messages.NoPOsSelected" ), "Error", JOptionPane.ERROR_MESSAGE );Where "this" should be the applet itself, since this is being called from a function within the JApplet.

  • Help Needed with showMessageDialog in awt

    Yes! I'm back with another problem. I'm trying to use showMessageDialog for my about popup. But, all the examples I have looked at use with Swing. I did see in the tutorials that this could work in java.awt.dialog. But, that doesn't seem to be in the docs, though. Anyway, below is my attempt at inserting showMessageDialog in my code. I'm receiving 2 compile errors on the line of code. Can anyone tell me where I have gone wrong?
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    class ChatClient extends Frame
       private TextField tf1 = new TextField("", 50);
        private TextArea ta;
        private Button sendButton;
        private Button quitButton;
        private Button okButton;
        private MenuItem exitMT, aboutMT;
        private Choice choice;
        private String user;
       public ChatClient()
           super("ChatClient");
          addWindowListener(new WindowAdapter()
          {public void windowClosing(WindowEvent e) {System.exit(0); }});
            addWindowListener(new WindowAdapter()
          {public void windowActivated(WindowEvent e)
                    tf1.requestFocusInWindow();
         setTitle("Chat Room");
          Panel p = new Panel(new BorderLayout());
          Panel p1 = new Panel(new BorderLayout());
          Panel p2 = new Panel(new GridLayout(3,1));
          MenuBar mb = new MenuBar ();
          setMenuBar (mb);
          Menu fileMenu = new Menu ("File");
         mb.add(fileMenu);
        Menu helpMenu = new Menu ("Help");
          mb.add(helpMenu);
          fileMenu.add (exitMT= new MenuItem ("Quit"));
         helpMenu.add (aboutMT = new MenuItem ("About"));
         exitMT.addActionListener(new ExitCommand());
          aboutMT.addActionListener(new AboutCommand());
       //creating main panel
       add(p, BorderLayout.NORTH);
          ta = new TextArea(10, 50);
          add(ta, BorderLayout.CENTER);
          ta.setSize(500,300);
          ta.setEditable(false);
        //adding buttons  and choice box to the right side of the window
          sendButton = new Button("Send");
          Panel p3 = new Panel();
          sendButton.setSize(15,15);
          sendButton.setBackground(Color.green);
          p3.add(sendButton);
          p2.add(p3);
         sendButton.addActionListener(new CopyCommand());
        quitButton = new Button("Quit");
         Panel p4 = new Panel();
        quitButton.setSize(15,15);
         quitButton.setBackground(Color.red);
         p4.add(quitButton);
         p2.add(p4);
        quitButton.addActionListener(new ExitCommand());
         Panel p5 = new Panel();
        choice = new Choice();
        choice.addItem("John");
        choice.addItem("Jena");
        choice.addItem("Colleen");
        choice.addItem("Steve");
        user=choice.getItem(0);
        p5.add(choice);
        choice.addItemListener(new CopyCommand());
        p2.add(p5);
         add(p2, BorderLayout.EAST);
       //adding the textfield to the south end of the window
          p1.add(tf1);
          add(p1, BorderLayout.SOUTH);
          tf1.addActionListener(new CopyCommand());
    //handling ActionEvent from buttons and menu items
      class ExitCommand implements ActionListener
        public void actionPerformed (ActionEvent e)
                   tf1.setText("");
                  ta.setText("");
                  choice.select(0);
                  System.exit(0);
      class AboutCommand implements ActionListener
         public void actionPerformed (ActionEvent e)
             OptionPane.showMessageDialog(OptionDialogFrame.this, "ChatClient ver. 1.0 written by Jennifer McAuliffe", "About Screen");
             System.out.print("About menu was pressed!");
      class CopyCommand implements ActionListener, ItemListener
        public void itemStateChanged(ItemEvent e)
        {  if (e.getSource() instanceof Choice)
            user = (String)e.getItem();
        public void actionPerformed (ActionEvent e)
            ta.append(user + ": " + tf1.getText() + "\n");
              tf1.setText("");
                tf1.requestFocus();
         public void keyPressed (KeyEvent ke)
             //figure out if the enter key was pressed
             if (ke.getKeyCode() == KeyEvent.VK_ENTER)
         ta.append(user + ": " + tf1.getText() + "\n");
         tf1.setText("");
         tf1.requestFocus();
         public void keyTyped (KeyEvent ke) { }
         public void keyReleased (KeyEvent ke) { }
       public static void main(String[] args)
       {  Frame f = new ChatClient();
          f.setSize(600, 400);
          f.show();
    }

    they aren't really stupid questions, you need to rely on the api to know exactly what classes you are using and the methods available. here is a really crude example that might give you some ideas. it could use lots of improvements.
    import java.awt.*;
    import java.awt.event.*;
    class DialogExample extends Frame
         public static void main(String[] args)
              Frame f = new Frame();
              //f.setVisible(true);
              Dialog d = new Dialog(f,"About Screen", true);
              d.add(new Label("ChatClient ver. 1.0 written by Jennifer McAuliffe"));
              d.addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent we) {
                           ((Dialog)(we.getSource())).setVisible(false);
              d.pack();
              d.setLocationRelativeTo(null);
              d.setVisible(true);
              d.dispose();
              System.exit(0);
    }

  • JOptionPane.showMessageDialog() - word wrapping exceptions?!

    Hey ppl,
    Probably a silly question...
    I'm currently working with JDBC, and SQLexceptions can be very long! Currently displaying them in a JOptionPane.showMessageDialog() (as i guess most people do?), but being so long they cause it to span the whole screen & then some!
    I looked through the JOptionPane API, but didn't spot anything that might help. Is there a way to get this exception to dispaly on multiple lines, kinda like word wrap in notepad?
    Cheers for any suggestions.
    Jim

    I can't speak for other developers..But as for myself, I rarely if ever print error messages to the JOptionPane. Almost always, I print my error messages and the stack if necessary, to the ouput. This is either a command line window, console, log file, or output screen in an ide depending upon how you program. My code looks something like this.
    catch(Exception e)
        System.out.println(e.getMessage());  // Will print only the message property of the exception
        e.printStackTrace();  // Will print the stack for more information
    }Sorry I couldn't answer your question directly. Maybe someone else can. Hope I was helpful anyway.

  • Change Button Name in JOptionPane.showMessageDialog

    Hello,
    I've written the following code that invokes a JOPtionPane messageDialog, when the delete button is hit in the following frame and the selectedItem in the JComboBox is Default.
    I want to change the JOPtionPane button name from OK to Close. Is there a way to do this with error message dialoges, as their is with confirmDialoges?
    Please help out.
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    public class MyJOptionPaneTest {
         public MyJOptionPaneTest()
              JFrame frame = new JFrame("My Frame");
              JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT,5,0));
              final JComboBox myComboBox = new JComboBox();
              myComboBox.setPreferredSize(new Dimension(100,20));
              myComboBox.getModel().setSelectedItem("Default");
              myComboBox.addItem("Default");
              myComboBox.addItem("Other");
              JButton deleteButton = new JButton("Delete");
              deleteButton.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        if(myComboBox.getSelectedItem().equals("Default"))
                             JOptionPane.showMessageDialog(null, "Default cannot be deleted", "Error", JOptionPane.ERROR_MESSAGE);
              panel.add(myComboBox);
              panel.add(deleteButton);
              frame.getContentPane().add(panel);
              frame.setSize(200,100);
              frame.setResizable(false);
              frame.setVisible(true);
         public static void main(String [] args)
              MyJOptionPaneTest test = new MyJOptionPaneTest();
    }

    Hi,
    yes, I've looked at the tutorials. But there is no way to change button title for JOptionPane.showMessageDialog. Only JOptionPane.showOptionsDialog provides you w/ that feature, becuz it provides the parameter in the method.
    I was wondering if there was another way to do this for showMessageDialog.

  • Issue with JOptionPane.showInternalMessageDialog() in jre 1.4.2 and higher

    I am using JOptionPane.showInternalMessageDialog() in my code. I have a screen with multiple tab panes that can be opened up. I have a screen which pops up the JOptionPane.showInternalMessageDialog() after completion of an action. In case I am viewing another screen at the point when the action completes on the previous screen, the JOptionPane.showInternalMessageDialog() causes a deadlock on the screens. I see that the issue wasnt there in jre 1.4.1, however the subsequent releases of jre shows up this issue.

    I passed this information to our QA people.
    Thanks
    Grant Ronald
    Forms Product Management

  • InputVerifier and JOptionPane.showMessageDialog

    Since I have intalled JDK 1.4. I have got the following Problem:
    in the verify Method there is a call to JOptionPane.showMessageDialog
    in order to show a error message if the input doesn�t match and before false is returned.
    It doesn�t work anymore with 1.4. In case of error, the message Dialog is not coming up and the verify methodis just called in a endless loop.

    try setting the InputVerifier to null before displaying the JOptionPane, then set it back after the JOptionPane.
    textField.setInputVerifier(null)
    JOptionPane.showMessageDialog(...)
    textField.setInputVerifier(this)

  • JOptionPane.showMessageDialog

    In JOptionPane.showOptionDialog, it is possible to define the button labels using the options parameter (2nd last).
    This does not appear to be possible with showMessageDialog.
    The showMessageDialog gives an "OK" button. I want a button labeled "Close".
    How would I do this?

    Sorry, all I saw was:
    New To Java
    Java Programming
    Training / Learning / Certification
    but I now see there is a swing forum elsewhere

  • JOptionPane.showMessageDialog auto closed by itself

    Hi guys,
    I"m facing a very weird issue. Our application is written in Swing and we encounter that the JOptionPane is automatically closed.
    <code>
    logger.debug( "Showing message dialog" );
    JOptionPane.showMessageDialog( this,
    "Some message" );
    logger.debug( "Message dialog returned" );
    </code>
    In the logs we have found out that it printed both directly. The user didn't have the chance to click OK button.
    We are using JDK 1.5.0_15, Windows XP Pro SP2
    Thanks.

    You need to create a "Short, Self Contained, Compilable
    and Executable, Example Program (SSCCE)",
    see http://homepage1.nifty.com/algafield/sscce.html,
    that demonstrates the incorrect behaviour, because I can't
    guess exactly what you are doing based on the information provided.
    Don't forget to use the "Code Formatting Tags",
    see http://forum.java.sun.com/help.jspa?sec=formatting,
    so the posted code retains its original formatting.

  • JOptionPane.showMessageDialog ( ERROR_MESSAGE)

    hi can anyone help...
    i am using a
    JOptionPane.showMessageDialog ( ERROR_MESSAGE)
    to validate my input in some textfields... and when
    there is an ERROR the merror message will pop up...
    how to write the code so that when the user click the
    OK button inside the pop-up msg , the button can
    handle some functions as to reset some variable....??

    If you read the javadocs for JOptionPane you will find that the dialog you get from calling any JOptionPane.showXXXDialog method is modal. Consequently, when you have called showMessageDialog the current thread will be blocked until the user presses the OK button. So you can just put your reset handling code after the call to showMessageDialog, like the following little program demonstrates:
    import java.awt.event.*;
    import javax.swing.*;
    public class OptionPaneErrorTest {
        public static void main(String[] args) {
            ApplicationFrame app = new ApplicationFrame();
            app.setVisible(true);
        private static class ApplicationFrame extends JFrame {
            public ApplicationFrame() {
                JButton btn = new JButton("Click Me");
                btn.addActionListener( new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        JOptionPane.showMessageDialog(null, "This is an error message", "Error", JOptionPane.ERROR_MESSAGE);
                        System.out.println("This will get printed when the user presses the OK button");
                getContentPane().add(btn);
                pack();
    }Hope this helps.

  • How to activate a link in JOptionPane.showMessageDialog()

    i have the following code (the color of "Email Me" is blue)
    JOptionPane.showMessageDialog
       parent,
       "<html><a href=\"mailto:[email protected]\">Email Me </a></html>"
       "dialog title",
       JOptionPane.PLAIN_MESSAGE
    );"Email Me" is blue and underlined but nothing happened when clicked on.
    please help. thanks.

    hi ra
    good question dear
    if you want to activate cube in business content do this steps.
    1).select your data source and maintain all the things in r/3 side.
    2).then come to bi side .
    3).t-code rsorbct.
    4).you must have an idea about your app component .i..e that app belongs to sd or mm or hr or finance .
    5).if it belongs to purchasing select infoobj and select supply chain management ,select purchasing.
    6).select char and key fig,drag and drop it into right side component .
    7).select info provider select supply chain management and select your cube .
    8).how to find cube .that is cube like 0pur_c01,c02,c03,c04 like that select any of the cube and drop in to right side component .
    9).now installation part.
    10).select source system top side and select your source ecc 6.0, select component and select install/activate.
    11).now your cube is ready to use .create package for full,initialize ,delta.ok
    bye ....................samar reddy...

  • Problem in showMessageDialog method of JOptionPane

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class SwingComp extends JFrame implements ActionListener{
    public SwingComp()
    JPanel p = new JPanel();
    JButton b = new JButton("OK");
              b.addActionListener(this);
    p.add(b);
                    add(p);  
                    pack();
                    setVisible(true);
    public static void main(String args[])
              new SwingComp();
    public void actionPerformed(ActionEvent e)
              JOptionPane.showMessageDialog( null, "Message", "Title", JOptionPane.ERROR_MESSAGE );
    //JDialog d = new JDialog();
    //JButton b1 = new JButton("some");
    //d.add(b1);
    //d.pack();
    //d.setVisible(true);
    }After running the above code is there any way in which I can add action listener to the ok button that is displayed by JOptionPane.showMessageDialog( null, "Message", "Title", JOptionPane.ERROR_MESSAGE ); dialog.

    You'll need to customize the option pane in order to
    achieve what you want. The following link
    demonstrates customizing a JOptionPane dialog.
    You'll need to adapt the code for your purposes but
    it clearly demonstrates the technique.
    http://forum.java.sun.com/thread.jspa?forumID=513&thre
    adID=248471Thanks for the information. Is there any other way by which the problem can be solved, I mean without customising...

  • JOptionPane.showMessageDialog(Component, Object) Help

    Hi,
    I am trying to use the JOptionPane, to display a MessageDialog.
    But, the message should be displayed with special font(BOLD), and the message should have background color(Red). The message is too long, so, I had to set location, with the following code, the dialog window is displayed but I am not able to see the text message. It appears as one red line. Could someone help me in fixing this.
    Not sure, if I have to use Layout, would BoxLayout fix the problem?
    The code is:
    com.sun.java.swing.JPanel displayPanel = new com.sun.java.swing.JPanel();
    com.sun.java.swing.JLabel displayLabel1 = new com.sun.java.swing.JLabel();
    com.sun.java.swing.JLabel displayLabel2 = new com.sun.java.swing.JLabel();
    displayLabel1.setText(getReactivationMessage().substring(0,23));
    displayLabel1.setFont(new java.awt.Font("dialog", 1, 15));
    displayLabel2.setText(getReactivationMessage().substring(23));
    displayLabel2.setFont(new java.awt.Font("dialog", 1, 15));
    displayPanel.setLayout(null);
    displayLabel1.setSize(30, 20);
    displayLabel2.setSize(100, 20);
    displayLabel1.setLocation((displayPanel.getWidth()-30)/2,(displayPanel.getHeight())/2);
    displayLabel2.setLocation((displayPanel.getWidth()-100)/2,(displayPanel.getHeight()-20)/2);
    displayPanel.add(displayLabel1);
    displayPanel.add(displayLabel2);
    displayPanel.setBackground(java.awt.Color.red);
    com.onstar.businessApplications.swing.uiComponentLibrary.widgets.JOptionPane_On.showMessageDialog(winMgr.getCCSAgentWindow(),displayPanel);
    Thanks in Advance

    I didn't quite understand the problem, but if the problem is that the text runs all along one line, and therefore runs out of the right hand side of the dialog window, this is because you need to use a wrapping label.
    JLabel does not wrap text. There is a way to allow for this. This is by putting your string within an open and close html tag (i.e. <html>***myTextHere***</html>).
    Another option would be for you to extend JLabel and write a JWrapLabel or somesuch.
    HTH,
    Manuel Amago.

  • Missing message on JOptionPane.showMessageDialog

    Hi,
    I created two JTrees and drew a line from a node in one tree to a node in another tree.
    After the mouse was released, I showed a message using JOptionPane.showMessageDialog(null, message). The message was not displayed. But if I show the message dialog box before I draw the line,
    the message is displayed.
    Could someone point me the possible problems or any similar example code?
    Thanks in advance!
    Jing

    Hi,
    First of all thanks for ur reply.I think u r not getting my point i don't want that my process waits for the JDialog to be closed.I want that my first Dialog should close automatically when my next Dialog pop up.My application requirement is i want to show two types of dialog one is when my work is going on "Please wait.." and another is when my work has beeen completed confimation message "Work has been completed".I want that when my work has beeen completed then my "Please wait.." dialog box should close automatically and confimation message dialog box should pop up.Plz guide me how i can do that.
    Regards
    Bikash

  • Problem wit JOptionPane.showMessageDialog

    I'm not getting where is the problem here,
    JTextField = AlteKarte,jtf3;
    jtf3.addFocusListener(new FocusListener() {
    public void focusGained(FocusEvent e) {
    public void focusLost(FocusEvent e) {
    if (!e.isTemporary() && isEnabled() ) {
    String Alte = AlteKarte.getText();
    String FoneNum = jtf3.getText();
    if (Alte.length() != 0 ){
    if(Alte.equals("123") != FoneNum.equals("123")) {
    JOptionPane optionPane = new JOptionPane();
    int answer =((Integer)optionPane.getValue()).intValue();
    JOptionPane.showMessageDialog(MainEPOS.frame,"Geben Sie bitte gultige Karten-Seriennummer an.","Fehler",JOptionPane.WARNING_MESSAGE,null);
    if(answer == JOptionPane.OK_OPTION || answer == JOptionPane.CLOSED_OPTION){
    jtf3.requestFocus(true);
    [\code ]
    i'm getting java.lang.ClassCastException at line int answer =((Integer)optionPane.getValue()).intValue();
    [\code]

    i have made it this way :-
             jtf3.addFocusListener(new FocusListener() {
                  public void focusGained(FocusEvent e) {
                  public void focusLost(FocusEvent e) {
                    if (!e.isTemporary() && isEnabled() ) {
                      String Alte = AlteKarte.getText();
                      String FoneNum = jtf3.getText();
                      if (Alte.length() != 0 ){
                           if(Alte.equals("123")  != FoneNum.equals("123")) {
                       JOptionPane optionPane = new JOptionPane();
                       Object[] options = {"OK"};
                       int answer =   JOptionPane.showOptionDialog(MainEPOS.frame,"Geben Sie bitte gultige Karten-Seriennummer an.","Fehler",JOptionPane.WARNING_MESSAGE,JOptionPane.OK_OPTION, null, options, options[0]);
                     //  int answer =((Integer) optionPane.getValue()).intValue();
                       if(answer == JOptionPane.OK_OPTION || answer == JOptionPane.CLOSED_OPTION){
                            jtf3.requestFocus(true);
          });but now the problem is, that it does not get closed at once.
    When i click OK then message appears again, and in second attempt it works.

Maybe you are looking for

  • How to connect to Apple TV using MacBook Air

    I Subscribe to a British streaming service that does not show the apple tv icon on its downloading screen. i Can get onto Apple TV on the iPad by using control centre, but iPad drops the input often. i Have a MacBook Air that is more reliable streami

  • Can you use or have open more than one app at a time on iphone 6 plus?

    Does anyone know if you will be able to open more than on app at a time on the new iphone 6 plus?  I would like to multi-task with the app's in the new operating system.

  • Java 1.5 in Snow Leopard

    So Java 1.5 is deleted from Snow Leopard as I have just found out, to my cost. I have a Java application that requires Java 1.5 in order not to crash randomly (Oxygen-XML) and, more seriously, I do Java development work for platforms where 1.5 is req

  • Did my Macbook have a Kernel Panic? ! ? !

    Well let me start out by saying that this has happened twice. I put my computer to sleep by closing the lid. 5 min later I come back to the computer because I remembered that I had to do one small little task, so I open the lid to wake the computer a

  • Correlated Item

    The other day in Oracle Discoverer I was attempting to determine how to build a subquery and in building the subquery how to relate a member form the main query with a member of the subquery; it is the "Add correlated item". All went well accept in a