JOptionPane and JDialog.DO_NOTHING_ON_CLOSE broken?

Hi there
I've created a JDialog from a JOptionPane and I don't want the user to simply dispose of the dialog by clicking on the close button but they are still able and I'm sure that my code is correct. Is it my code that is wrong or is it a java bug? Oh I'm running on 1.3 BTW
JFrame f = new JFrame();
f.setSize(500, 500);
f.setVisible(true);
JOptionPane optionPane = new JOptionPane("Hello there", JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
JDialog d = optionPane.createDialog(f, "Testing");
d.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
d.setVisible(true);I know that I can just set up a JDialog directly and use the setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE) and it seems to work properly but I would like to see it work for JOptionPane!
Thanks in advance

Sorry but this doesn't make it work either. I've looked at the code for createDialog in JOptionPane and it actually adds a WindowListener to the dialog in there as well as a propertyListener. On closing the option pane it calls a method in windowClosing of the windowListener which in turn fires a property change event which then tells the dialog to dispose itself so the addition of another windowAdapter to override the windowClosing method will not help :-(
I've managed to get round it by doing something similar to
JFrame frame = new JFrame();
final JDialog dialog = new JDialog(frame, "Testing", true);
JButton button = new JButton("OK");
button.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
    dialog.dispose();
JOptionPane optionPane = new JOptionPane(button, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
dialog.setContentPane(optionPane);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
dialog.pack();
dialog.setVisible(true);

Similar Messages

  • JOptionPane and JDialog

    Hi guys,
    I've been scooting around the net trying to find an answer to this problem. Basically I have a JDialog that users enter registration details. If they haven't completed all fields or if the password confirmation is wrong then a JOptionPane.showMessageDialog appears telling users what has happened. However if they were to then click ok in the OptionPane it closes both the option pane and the original Dialog window. Have you guys any idea?
    A code snippet below:
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.util.*;
    public class Register extends JDialog implements ActionListener {
         //declare components
         JLabel lblHeading;
         JLabel lblUserName;
         JLabel lblUserPwd;
         JLabel lblCnfUserPwd;
         JLabel lblFrstName;
         JLabel lblLstName;
         JLabel lblAge;
         JLabel lblEmpId;
         JLabel lblSex;
         JLabel lblEmail;
         String usrName;
         String strUsrPwd;
         String strCnfPwd;
         String frstName;
         String lstName;
         String age;
         String empid;
         String email;
         String sex;
         Socket toServer;
         ObjectInputStream streamFromServer;
         PrintStream streamToServer;
         JComboBox listSex;
         JTextField txtUserName;
         JPasswordField txtUsrPwd;
         JPasswordField txtCnfUsrPwd;
         JTextField txtFrstName;
         JTextField txtLstName;
         JTextField txtAge;
         JTextField txtEmpId;
         JTextField txtEmail;
         Font f;
         Color r;
         JButton btnSubmit;
         JButton btnCancel;
         public Register() {
              this.setTitle("Registration Form");
            JPanel panel=new JPanel();
              //apply the layout
               panel.setLayout(new GridBagLayout());
               GridBagConstraints gbCons=new GridBagConstraints();
              //place the components
              gbCons.gridx=0;
              gbCons.gridy=0;
              lblHeading=new JLabel("Please register below");
               Font f = new Font("Monospaced" , Font.BOLD , 12);
              lblHeading.setFont(f);
              Color c=new Color(0,200,0);
              lblHeading.setForeground(new Color(131,25,38));
              lblHeading.setVerticalAlignment(SwingConstants.TOP);
              gbCons.anchor=GridBagConstraints.EAST;
              panel.add(lblHeading, gbCons);
              gbCons.gridx = 0;
              gbCons.gridy = 1;
              lblUserName = new JLabel("Enter Username");
              gbCons.anchor=GridBagConstraints.WEST;
              panel.add(lblUserName, gbCons);
              gbCons.gridx=1;
              gbCons.gridy=1;
              txtUserName=new JTextField(15);
              panel.add(txtUserName, gbCons);
              gbCons.gridx=0;
              gbCons.gridy=2;
              lblUserPwd=new JLabel("Enter Password ");
              panel.add(lblUserPwd, gbCons);
              gbCons.gridx = 1;
              gbCons.gridy = 2;
              txtUsrPwd = new JPasswordField(15);
              panel.add(txtUsrPwd, gbCons);
              gbCons.gridx=0;
              gbCons.gridy=3;
              lblCnfUserPwd=new JLabel("Confirm Password ");
              panel.add(lblCnfUserPwd, gbCons);
              gbCons.gridx=1;
              gbCons.gridy=3;
              txtCnfUsrPwd=new JPasswordField(15);
              panel.add(txtCnfUsrPwd, gbCons);
              gbCons.gridx=0;
              gbCons.gridy=4;
              lblEmpId=new JLabel("Employee ID");
              panel.add(lblEmpId, gbCons);
              gbCons.gridx=1;
              gbCons.gridy=4;
              txtEmpId=new JTextField(15);
              panel.add(txtEmpId, gbCons);
              gbCons.gridx=0;
              gbCons.gridy=5;
              lblFrstName=new JLabel("First Name");
              panel.add(lblFrstName, gbCons);
              gbCons.gridx=1;
              gbCons.gridy=5;
              txtFrstName=new JTextField(15);
              panel.add(txtFrstName, gbCons);
              gbCons.gridx=0;
              gbCons.gridy=6;
              lblLstName=new JLabel("Last Name");
              panel.add(lblLstName, gbCons);
              gbCons.gridx = 1;
              gbCons.gridy = 6;
              txtLstName=new JTextField(15);
              panel.add(txtLstName, gbCons);
              gbCons.gridx=0;
              gbCons.gridy=7;
              lblAge=new JLabel("Age");
              panel.add(lblAge, gbCons);
              gbCons.gridx=1;
              gbCons.gridy=7;
              txtAge=new JTextField(3);
              panel.add(txtAge, gbCons);
              gbCons.gridx=0;
              gbCons.gridy=8;
              lblEmail=new JLabel("Email address");
              panel.add(lblEmail, gbCons);
              gbCons.gridx=1;
              gbCons.gridy=8;
              txtEmail=new JTextField(20);
              panel.add(txtEmail, gbCons);
              gbCons.gridx=0;
              gbCons.gridy=9;
              lblSex=new JLabel("Sex");
              panel.add(lblSex, gbCons);
              gbCons.gridx = 1;
              gbCons.gridy=9;
              String [] sex= {"Male", "Female"};
              listSex = new JComboBox(sex);
              listSex.setSelectedIndex(0);
              panel.add(listSex, gbCons);
              JPanel btnPanel=new JPanel();
              btnSubmit=new JButton("Submit");
              btnPanel.add(btnSubmit);
              btnSubmit.addActionListener(this); //add listener to the Submit button
              btnCancel=new JButton("Cancel");
              btnPanel.add(btnCancel);
              btnCancel.addActionListener(this); //add listener to the Cancel button
              gbCons.gridx=0;
              gbCons.gridy=10;
              gbCons.anchor=GridBagConstraints.EAST;
              panel.add(btnPanel, gbCons);
              getContentPane().add(panel);
             setDefaultCloseOperation(DISPOSE_ON_CLOSE); //get rid of this window only on closing
              setVisible(true);
              setSize(450,400);
             }//end Register()
              public void actionPerformed(ActionEvent ae) {
                   Object o = ae.getSource(); //get the source of the event
                   if(o == btnCancel)
                        this.dispose();
                   if(o == btnSubmit){
                        usrName = txtUserName.getText();
                        strUsrPwd = txtUsrPwd.getText();
                        strCnfPwd = txtCnfUsrPwd.getText();
                        frstName = txtFrstName.getText();
                        lstName = txtLstName.getText();
                        age = txtAge.getText();
                        empid = txtEmpId.getText();
                        email = txtEmail.getText();
                        sex = (String)listSex.getItemAt(0);
                        if ((usrName.length() == 0) || (strUsrPwd.length() == 0) ||
                        (strCnfPwd.length() == 0) || (frstName.length() == 0) ||
                        (lstName.length() == 0) || (age.length() == 0) ||
                        (empid.length() == 0) || (email.length() == 0))
                        JOptionPane.showMessageDialog(null,
                        "One or more entry is empty. Please fill out all entries.", "Message", JOptionPane.ERROR_MESSAGE);
                        if ((!strUsrPwd.equals(strCnfPwd))){
                             JOptionPane.showMessageDialog(null,
                             "Passwords do not match. Please try again", "Message", JOptionPane.ERROR_MESSAGE);
                        Thanks,
    Chris

    try something like this:
    import java.awt.Dimension;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.event.ActionListener;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    public class About extends JDialog {
    /** Creates new form About */
    public About(JFrame parent) {
    super(parent,true);
    initComponents();
    pack();
    Rectangle parentBounds = parent.getBounds();
    Dimension size = getSize();
    // Center in the parent
    int x = Math.max(0, parentBounds.x + (parentBounds.width - size.width) / 2);
    int y = Math.max(0, parentBounds.y + (parentBounds.height - size.height) / 2);
    setLocation(new Point(x, y));
    and from the main dialog:
    new About(this).setVisible(true);

  • How to change the icon of JOptionPane and JFileChooser in swing

    Hi,
    Does any body know how to change the icon of JOptionPane and JFileChooser in swing.
    Please help me out in this.
    Thanx in advance.

    Try this
    import javax.swing.*;
    import java.awt.event.*;
    public class Untitled4 {
      public Untitled4() {
      public static void main(String[] args) {
        ImageIcon i = new ImageIcon("C:/TestTree/closed.gif");
        JOptionPane p = new JOptionPane();
        p.setMessage("This JOptionPane has my icon");
        p.setMessageType(JOptionPane.QUESTION_MESSAGE);
        p.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION);
        final JDialog d = p.createDialog("test");
        d.setIconImage(i.getImage());
        d.setVisible(true);
        d.setModal(true);
        if(Integer.parseInt(p.getValue().toString()) == JOptionPane.YES_OPTION) {
            System.out.println("You Clicked Yes");
    }

  • Connection between SDM client and server is broken

    Dear All,
    First of all this is what I have
    -NW04 SPS 17
    -NWDS Version: 7.0.09 Build id: 200608262203
    -using VPN connection
    -telnet on port 57018 is succesfull
    I can login to SDM server (from NWDS and from SDM GUI) I can see the state of SDM(green light), restart it, can navigate through tabs in GUI, but every time I am trying to deploy an ear i have this error:
    Deployment exception : Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    Inner exception was :
    Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    I have already read a lot of topics,blogs,notes but didn't find the solution.
    Can anybody help me?
    Best Regards

    Having same issue. Nothing helped so far... Using NWDS 7.0 SP18.
    I have turned SDM tracing on and this is what I see on client side after sending first data package:
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/17 Client: finished sending string part"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/0 Client: receive String part from Server"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl.receiveFromServer(NetComm ..): Entering method
    com.sap.bc.cts.tp.net.NetComm.receive(): Entering method
    com.sap.bc.cts.tp.net.NetComm: debug "Method "receive(char[])" could not read all requested bytes. There are still 12 bytes to read"
    com.sap.bc.cts.tp.net.NetComm: debug "Caught IOException during read of header bytes (-1,          43):Connection reset"
    com.sap.bc.cts.tp.net.NetComm: debug "  throwing IOException(net.id_000001)"
    com.sap.bc.cts.tp.net.NetComm.receive(): Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/1 Client: connection was broken"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/0 Client: finshed sendAndReceive"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    My connection on server is still active so I have to restart SDM server to reset and try it again.
    Anyone have idea whats happening?
    Edited by: skyrma on Feb 24, 2012 2:46 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM

  • Less than a month and its already broken

    Dear BT and Forum users,
    I am not very happy with my BB service right now and have come on here in the hope that I might get more that platitudes and fob offs.
    So...  a few weeks ago my husband finally gave into the sales calls and agreed to have Infinity installed. Our reason - not so much faster internet but in the hope we might get a consistant service.The service we had before that was tempermental at best and we were sick of having to reset the router every other day.  (in hindsight we should have just gone with an alternative ISP).
    It was installed a couple of weeks ago and worked well until last Wednesday, since then the service has been a comedy of errors.  To start with my husband confirmed from the outset that they problem was not coming from inside the house but the customer service operator insisted on booking an engineer.
    We agreed to the Friday morning appointment. I booked the morning off work (using annual leave) and the engineer didn't show up. My husband called at 12.30 (they won't take calls from me as I'm not on the bill) and he was assured the appointment was booked in. Shortly after 1 I took a call at the home to say the "system" had lost the booking and the engineer wouldn't be coming.
    I said I was in all day, he could come now but that was clearly off script and the call centre operative wouldn't enterntain the idea (annoyingly there were 2 BT vans in my neighbourhood that afternoon). Instead they wanted me to rebook another 4 hour appointment. I couldn't stop in Saturday and wasn't going to lose more leave. I said I would discuss the options with my husband. 
    What followed that afternoon was a series of coversations with them, some with me at home and some with my husband at work offering the same options and us giving the same response. I don't know if the operatives weren't talking to each other or didn't understand but it was really irritating. In the end they said they would call my husband at 4pm. They called some time after 5 and said the would try the exchange first and call us Monday morning if they needed to access the property.
    Saturday 8.30 the engineer called to say they were on their way, we had the time so we waited. He arrived and was in the house all of 15 minutes before confirming the problem was in the exchange (all that time wasted for that!). We got a call Sunday to say they needed a new part at the exchange then today my husband got an undecipherable voicemail and a text saying the service will be fixed in the next 72 hours. He has spoken to them this evening and we're still non-the-wiser as now there's a fault further up the line. 
    Whilst all this is going on we have tried to find out if they expect us to pay for the Infinity and BT Vision whilst the services are not working. All they will say is they won't look at refunding losses until the issue is fixed. I realise they can't give us a total but it was a pretty straight forward question - am I paying for this non-service. One operator has said I can have £10 to cover the missed appointment (I value my time and annual leave a little higher).
    In all honestly the loss of internet and BT vision is frustrating but what has really dissapointed me is the lack of customer service. No one in the call centres seem to have a clue what's going on (we've had so many versions of what's wrong) and are too tied to a script. There's no sense of inconvenience - I'm supposed to be ready and waiting for 4 hours at a time but they will fix it sometime in the next 3 day. 
    Right now I'm not even sure its worth waiting to get this fixed.
    I'd love for someone to come on here and fix this for me but I'd settle for a little peer support/shared experience.
    Thanks
    L

    OK, so I was being a little optimisitic. We're back online (yay!) but now the bill is just more of the same. Apparently we have to wait 48 hours before they will tell us how they are adjusting the bill  I understand that they cannot confirm the problem si fixed yet because of some internal policy but they won't even tell us how much they would calculate as of now - a pretty straight forward question. 
    So with that, we threw in the towel... said if they can't asnwer a simple question we were off. Of course when I told then operator this he said he's put me straight through to his boss and then left me on hold for over 20 minutes before I gave up!
    Called back to leaver dept. to be told we have to pay £200 to cancel (funny they could give us that figure pretty easily). I don't know what was said when he signed up but I am going to be investigating this further. We've had the service less than a month and its been broken a week.

  • My laptops cooling fan and hinge are broken.  if i were to get a new computer and activate photoshop

    my laptops cooling fan and hinge are broken.  if i were to get a new computer and activate photoshop on it, should i worry about how many times i have activated photoshop?  Is there a limit to how many times i can download photoshop?

    Hi Pinrose,
    Welcome to Adobe Forums.
    You can use the same subscription on 2 machines. If you want to use it on a 3rd machine you can deactivate
    Photoshop from this machine. Please follow the below article on how to deactivate.
    http://helpx.adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html
    Thanks

  • Help on assignment, don't understand JOptionPane and showInputDialog

    Hi, I am currently studying java and have problems doing my assignment. here is the assignment question. What I am looking for is pointers and hints to start on my assignment. I am not looking for the source code, rather the way to actually understand it and start writting my code
    I believe this assignment wanted me to create a class Object called Zeller with the methods in it and a ZellerTester to test the Object?
    I read up on the JOptionPane and the showInputDialog, but don't really quite understand it.
    Do i need a constructor for the Object Zeller?
    Does my assignment require me to put the showInputDialog as a method in the Zeller class? Or put it in the ZellerTester?
    The isLeapYear is a method in the Object Zeller?
    Here is the assignment question
    Examine the method
    showInputDialog() and study its function. Note the return type of this method.
    Write a program on the following requirements:
    1. Use the JOptionPane facility to ask the user for three positive integers,
    representing the day, month and year of a date.
    2. Use the Zeller�s congruence formula to find the day of the week.
    3. Should include a method boolean isLeapYear(int year)
    that will return true if year is a leap year, and false otherwise.
    The method should check for leap years as follow:
    return true if the year is divisible by 400.
    return true if the year is divisible by 4 but not by 100
    return false for the remaining values
    Thank you.

    I can't seems to return the method back to the main
    Not sure where has gone wrong...
    here is my code
    import javax.swing.*;
    public class ZellerTester
        public static void main(String[]args)
        int day  = 28;
        int month = 2;
        int year = 2007;
        int z;
        boolean isLeapYear;
        String[] displayName = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
        if(month==1 || month==2) {
            if (isLeapYear = false)
                day = day-1;
              else
                day = day-2;
        if(month<3)
            month = month + 12;
        z = (1 + day + (month * 2) + (3 * (month + 1) / 5) +
             year + year / 4 + year / 400 - year/ 100) % 7;
        System.out.println("The day is " +displayName[z]);
    public boolean isLeapYear(int year)
           if (year%400 == 0)
               return true;
           else if((year%4 == 0) && (year%100 != 0))
                return true;
           else
                 return false;
    }

  • [svn:fx-trunk] 11664: Update ASDoc comments on new MXItemRenderer classes, and fix a broken HTML tag in Range.as

    Revision: 11664
    Author:   [email protected]
    Date:     2009-11-11 11:42:00 -0800 (Wed, 11 Nov 2009)
    Log Message:
    Update ASDoc comments on new MXItemRenderer classes, and fix a broken HTML tag in Range.as
    QE notes: -
    Doc notes: -
    Bugs: -
    Reviewer: -
    Tests run: - Checkintests
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/dataGridClasses/MXDataGridItemRe nderer.as
        flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/listClasses/MXItemRenderer.as
        flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/treeClasses/MXTreeItemRenderer.a s
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Range.as

    Revision: 11664
    Author:   [email protected]
    Date:     2009-11-11 11:42:00 -0800 (Wed, 11 Nov 2009)
    Log Message:
    Update ASDoc comments on new MXItemRenderer classes, and fix a broken HTML tag in Range.as
    QE notes: -
    Doc notes: -
    Bugs: -
    Reviewer: -
    Tests run: - Checkintests
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/dataGridClasses/MXDataGridItemRe nderer.as
        flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/listClasses/MXItemRenderer.as
        flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/treeClasses/MXTreeItemRenderer.a s
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Range.as

  • [svn:osmf:] 16166: Fix bug FM-857: VAST impression and tracking events broken.

    Revision: 16166
    Revision: 16166
    Author:   [email protected]
    Date:     2010-05-17 16:44:55 -0700 (Mon, 17 May 2010)
    Log Message:
    Fix bug FM-857: VAST impression and tracking events broken.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FM-857
    Modified Paths:
        osmf/trunk/libs/VAST/org/osmf/vast/media/VASTImpressionProxyElement.as
        osmf/trunk/libs/VAST/org/osmf/vast/media/VASTTrackingProxyElement.as
        osmf/trunk/libs/VASTTest/org/osmf/vast/media/TestVASTImpressionProxyElement.as
        osmf/trunk/libs/VASTTest/org/osmf/vast/media/TestVASTTrackingProxyElement.as

  • JOptionPane and Threads

    I have a Class called Execute which runs as a thread. If this fails, then I want to show a JOptionPane from the main thread saying it failed (this works), but also I want to create a JOptionPane within the run() method of Execute stating the reason for the failure.
    I can not put a JOptionPane directly inside the run method 'cos it doesn't get rendered correctly, so I run this in it own thread. Only trouble is that now I have two modal dialog boxes appearing simultaneously; what I want is to have them appear consecutively. I have tried to join the thread that creates the pop-up but then it does not get rendered. Any ideas? I have posted an extract of the code below for testing
    public class Execute implements Runnable {
         File success = new File ("/ukirtdata/orac_data/deferred/.success");
         File failure = new File ("/ukirtdata/orac_data/deferred/.failure");
         success.delete();
         failure.delete();
         try {
             success.createNewFile();
             failure.createNewFile();
         catch (IOException ioe) {
             logger.error("Unable to create success/fail file", ioe);
             return;
         SpItem itemToExecute;
         if (!isDeferred) {
             itemToExecute = ProgramTree.selectedItem;
             logger.info("Executing observation from Program List");
         else {
             itemToExecute = DeferredProgramList.currentItem;
             logger.info("Executing observation from deferred list");
         SpItem inst = (SpItem) SpTreeMan.findInstrument(itemToExecute);
         if (inst == null) {
             logger.error("No instrument found");
             success.delete();
             return;
         String tname = QtTools.translate(itemToExecute, inst.type().getReadable());
         // Catch null sequence names - probably means translation
         // failed:
         if (tname == null) {
             //new ErrorBox ("Translation failed. Please report this!");
             logger.error("Translation failed. Please report this!");
             new PopUp ("Translation Error",
                     "An error occurred during translation",
                     JOptionPane.ERROR_MESSAGE).start();
             success.delete();
             return;
         else{
             logger.info("Trans OK");
             logger.debug("Translated file is "+tname);
                failure.delete()
                return;
        public class PopUp extends Thread implements Serializable{
         String _message;
         String _title;
            int    _errLevel;
         public PopUp (String title, String message, int errorLevel) {
             _message=message;
             _title = title;
             _errLevel=errorLevel;
         public void run() {
             JOptionPane.showMessageDialog(null,
                               _message,
                               _title,
                               _errLevel);

    Comeon,
    Someone must have some idea. I have tried making popup extend JOptionPane and implement Runnable, added a window listener which sets a boolean popDisplayed on windowOpen and windowClose, but this gets me nowhere (I have a Thread.sleep in the code as well)

  • JOptionPane and JList HELP!!!

    Hi there,
    I want to be able to use a JOptionPane and add these elements to my JList component. I know how to add elements to it through the source code but am not able to get a user to inout values into this JList. 've got my JOptionPane running by using the following code:
    public void actionPerformed(ActionEvent ae) {
           if(ae.getActionCommand().equals("New Player")){
                s1 = JOptionPane.showInputDialog("Enter player: ");
                list.append(s1);
           repaint();
      }I want the values taken from this Prompt and be shown in my JList. I tried doing:
    list.addElement(s1);
    list.append(s1);
    I tried looking at the Java API website but didn't find it helpful at all of what I'm trying to do.

    I keep getting an error on the line where it says:
    list.add(s1);And even when I try:
    list.addElement(s1);Still same error. Is it a different way of doing it?
    Thanks for any response

  • I have a mac book air. I felt down and I have broken the screen: several white lines on the screen. Do you know if I can only change the screen? Is it expensive?

    I have a mac book air. I felt down and I have broken the screen: several white lines on the screen. Do you know if I can only change the screen? Is it expensive?

    Welcome to Apple Support Communities
    Take your MacBook Air to an Apple Store or reseller to have your display replaced. If you want, you can buy the display yourself and install it, but as you can see, that's expensive > http://www.ifixit.com/MacBook-Parts/MacBook-Air-13-Inch-Mid-2012-Display-Assembl y/IF188-083?utm_source=ifixit_guide&utm_medium=guide_intro&utm_content=required_ items&utm_term=macbook_air_13%22_mid_2012

  • CC application file sync issue and CC App broken menu..

    1. File sync from Photoshop CC has stopped working.
    Photoshop reports the last sync time and date in edit>sync settings.
    However in my Application settings I get the following..
    Application settings are synced between many of your favorite desktop applications and Creative Cloud, allowing you to work consistently from any machine. To begin syncing, you will need to open your desktop application and click "Sync Settings Now".
    You currently do not have any synced settings.
    2. I have missing menu items in the CC app cog menu (I assume as reported on other threads) including "stop syncing", preferences/settings and other blank or greyed out items.
    Prior to that I had the also reported dead CC app issue and uninstalled and reinstalled the app, which fixed dead app but left the munu broken.

    Hallo over there
    After using creative cloud cleaner ....
    every things is ok...8-)
    Sendt fra mobilen....
    Med venlig hilsen/Kind regards
    Fotograf Hans Søndergaard
    Allégade 23  1.baghus
    DK 2000 Frederiksberg
    M: +45 4044 8190
    [email protected]
    www.soendergaard.com
    Den 07/11/2013 kl. 17.32 skrev Simon_P1 <[email protected]>:
    Re: CC application file sync issue and CC App broken menu..
    created by Simon_P1 in Adobe Creative Cloud - View the full discussion
    Since the CC app messed up again and yet another reinstall, it is working (sort of, after several sync failures of lrcat) properly, including the menu, all be it very slowly considering the fast upload I have.
    As is the setting sync finally.
    Thanks for keeping me informed, oh wait, you didn't!
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5823499#5823499
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5823499#5823499
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5823499#5823499. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Creative Cloud at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • If my ipad accidentally dropped and screen is broken and only 4 months since i buy,does apple will change or fix it?

    If i accidentally dropped my ipad and screen is broken,does apple will change or fix it,my ipad is only 4 months

    It will cost you approximately US$219.00 to US$299.00 depending on the model.
    Apple will replace the entire iPad; they don't repair.
    (If you have AppleCare Protection Plan, you will pay a lot less)

  • I have purchased a 3gs and its jail broken. i tried to update it and it did get update also but it is not working, and techinal person said it is a locked.now how do i factory unlock it?

    i have purchased a 3gs and its jail broken. i tried to update it and it did get update also but it is not working, and techinal person said it is a locked.now how do i factory unlock it?

    It is not always possible to return a jailbroken phone to a pristine state. Jailbroken devices can NOT be discussed here per the terms of service. As for unlocking. It was previously hacked and has re-locked to the original carreir. ONLY the carrier it is locked to can authorize unlocking it. Find out who that is and contact them or do as steve359 advised above and try to return it for your money back.

Maybe you are looking for

  • Looking for a function that returns the currently opened document type

    Dear SAP gurus I have a user exit for transaction VA02. In VA02, when I click on button (Item details-configuration), it launches a URL in a browser. I am asked to add to the URL, values like Document Type, Document Number and Line Item Number. I can

  • Dynamic OS Command file path

    In the OS Command process type of a process chain, is there a way to change the file path depending on the system? In Prod the path should be different from the path in Dev. Right now, I have to manually edit it in each system. Can this be automated?

  • PO version mgt

    Can I activate PO version management if I have not activated it at the time of implementation . How

  • Populating Status field in Opportunity management

    Hi All, I need to populate my own values in Object status list box in opportunity management(CRMD_BUS2000111).Is there any way to fill these values.It would be great helpful to me if u have any solution for this

  • Need help regarding implementing SSAS solution using microsoft decision trees algorithm

    Hi All, I am new to SSAS and Data Mining techniques. I dnt have a good knowledge about data mining in SSAS.  I have a requirement regarding predictive analysis and want to check whether i can implement SSAS for it.  I have two tables namely Tree and