JOptionPane: not disappearing properly on seleting "Cancel"

/*takes SQL statement input SQL Input Window, shows table in Center-Right,Tree in Center-Left,
and gives number of records returned in South text field.
import java.awt.*;
import java.awt.event.*;  
import javax.swing.*;                    
import javax.swing.text.BadLocationException;
import javax.swing.table.*;     
import javax.swing.tree.*;
import java.sql.*;   
import java.util.Vector;
public class DataBaseAppCombined
  static DataBaseBrowse1 window;  
  public static void main(String[] args)
    window = new DataBaseBrowse1();    
    Toolkit theKit = window.getToolkit(); 
    Dimension wndSize = theKit.getScreenSize();
    window.setBounds(0, 0,
     wndSize.width,
     wndSize.height);                  
    window.setVisible(true);
class DataBaseBrowse1 extends JFrame implements ActionListener
  public DataBaseBrowse1()
   super("Visual Data");
//This dialog box doesn't respond appropriately to "Cancel" or "No"
   addWindowListener(new WindowAdapter(){
          public void windowClosing(WindowEvent e)
               if (JOptionPane.showConfirmDialog(null,"Do you really want to quit now?")
               == JOptionPane.YES_OPTION)
                    dispose();
                    System.exit(0); 
          // Create the menubar from the menu items
          JMenu fileMenu = new JMenu("File");
          fileMenu.setMnemonic('F');
          fileMenu.add(connectItem);
          connectItem.addActionListener(this);
          fileMenu.add(clearQueryItem);
          clearQueryItem.addActionListener(this);
          fileMenu.add(exitItem);
          exitItem.addActionListener(this);
          menuBar.add(fileMenu);   
    setJMenuBar(menuBar);        
    JPanel commandPane = new JPanel(); //holds label and textArea for SQL queries
    commandPane.setLayout(new BorderLayout());
    commandPane.add(new JLabel("Enter SQL query here: ", JLabel.LEFT),BorderLayout.WEST);
    command.setToolTipText("Key SQL commmand and press Enter");
    command.setLineWrap(true);
    command.setWrapStyleWord(true);
    command.addKeyListener(new KeyHandler());     
    commandPane.add(command, BorderLayout.CENTER);
    getContentPane().add(commandPane, BorderLayout.NORTH);
    // Add the status reporting area at the bottom
    status.setLineWrap(true);
    status.setWrapStyleWord(true);
    status.setEditable(false);
    getContentPane().add(status, BorderLayout.SOUTH);
          // Create a table model to go in right splitPane
          tableModel = new ResultsModel();
          JTable table = new JTable(tableModel);
          table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);  
          tablePane = new JScrollPane(table);
          tablePane.setBorder(BorderFactory.createLineBorder(Color.darkGray));
          //create tree to go in left splitPane
          dbNode = new DefaultMutableTreeNode("No Database");
          dbTreeModel = new DefaultTreeModel(dbNode);
          dbTree = new JTree(dbTreeModel);
          treePane = new JScrollPane(dbTree);
          treePane.setBorder(BorderFactory.createLineBorder(Color.darkGray));
          JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                   true,        //continuous relayout
                   treePane,    //Left pane content
                   tablePane);  //Right pane content
          getContentPane().add(splitpane, BorderLayout.CENTER);
          splitpane.setDividerLocation(400);
    pack();
    //setVisible(true);
     //get variables out of User object
     //and connect to driver
     public void initializeUser(User _user)
          driver = _user.getDriver();
          url = _user.getURL();
          password = _user.getPassword();
          user = _user.getUser();
          try
               Class.forName(driver);                          
               connection = DriverManager.getConnection(url, user, password);
               statement = connection.createStatement();
               catch(ClassNotFoundException cnfe)
               System.err.println(cnfe);
               catch(SQLException sqle)
               System.err.println(sqle);
  public void actionPerformed(ActionEvent e)
    Object source = e.getSource();
          if(source == clearQueryItem)
          try
           command.getDocument().remove(0,len);
          catch (BadLocationException ex)
                         System.err.println(ex);
    else if(source == exitItem)                
//This dialog box does respond appropriately to "Cancel" and "No".
               if (JOptionPane.showConfirmDialog
               (null,"Do you really want to quit now?")
               == JOptionPane.YES_OPTION)
                    dispose();
                    System.exit(0); 
    else if (source ==connectItem)
         showPasswordDialog();
     public void showPasswordDialog()
           // if first time, construct dialog
           if (dlgPanel == null)
                    dlgPanel = new PasswordChooser();
           // pop up dialog
           if (dlgPanel.showDialog(null,
                    "Connect"))
                    // if accepted, retrieve user input as a User object
                    User u = dlgPanel.getUser();
                    DataBaseBrowse1.this.initializeUser(u);
  public void executeSQL()
    //retrieve the text from the JTextField as SQL statement
    try
               len = command.getDocument().getLength();
               stringIn = command.getDocument().getText(0,len);
               query = stringIn.trim();
               if(query == null) 
      return;
          catch (BadLocationException e)
               System.err.println(e + "bad location");
    try
      tableModel.setResultSet(statement.executeQuery(query));
      status.setText("Resultset has " + tableModel.getRowCount() + " rows.");
    catch (SQLException sqle)
      status.setText(sqle.getMessage());
     class KeyHandler extends KeyAdapter
          //Handler for Enter key events
          public void keyPressed(KeyEvent e)
               int keyCode = e.getKeyCode();
               if (keyCode == e.VK_ENTER)
               executeSQL();
     private DefaultMutableTreeNode dbNode;
     private DefaultTreeModel dbTreeModel;
     private JTree dbTree;
     private JScrollPane tablePane,
                         treePane;
  private JTextArea command = new JTextArea(2,1); // Input area for SQL
  private JTextArea status = new JTextArea(3,1); 
  private String stringIn,query,user, driver,url;
  private String password;
  private int len;
  private PasswordChooser dlgPanel;
  private User u;
  JMenuBar menuBar = new JMenuBar();
  JMenuItem connectItem = new JMenuItem("Connect");
  JMenuItem clearQueryItem = new JMenuItem("Clear query");
  JMenuItem exitItem = new JMenuItem("Exit");
  Connection connection;
  Statement statement;                        
  ResultsModel tableModel;
   A password chooser that is shown inside a dialog
class PasswordChooser extends JPanel
   public PasswordChooser()
          // panel conaining the panel holding the JLabels
          //and the panel holding the JComboBoxes
          panel = new JPanel();
          panel.setLayout(new BorderLayout());
          //panel for textfields
          tfPanel = new JPanel();
          tfPanel.setLayout(new GridLayout(4,1,5,5));
          tfPanel.add(new JLabel("Driver:"));
          tfPanel.add(new JLabel("URL"));
          tfPanel.add(new JLabel("User name:"));
          tfPanel.add(new JLabel("Password:"));
          panel.add(tfPanel,BorderLayout.WEST);
          //panel for comboboxes
          cbPanel = new JPanel();
          cbPanel.setLayout(new GridLayout(4,1,5,5));
          //drivers
          String[] driverChoices ={"sun.jdbc.odbc.JdbcOdbcDriver","other"};
          driverFields =new JComboBox(driverChoices);
          driverFields.setEditable(true);
          cbPanel.add(driverFields);
          //urls
          String[] urlChoices = {"jdbc:odbc:technical_library", "other"};
          urlFields = new JComboBox(urlChoices);
          urlFields.setEditable(true);
          cbPanel.add(urlFields);
          //user and password
          cbPanel.add(userName = new JTextField(""));
          cbPanel.add(password = new JTextField(""));
          panel.add(cbPanel, BorderLayout.CENTER);
          // create Ok and Cancel buttons that terminate the dialog
          JButton okButton = new JButton("Ok");
          okButton.addActionListener(new
               ActionListener()
                    public void actionPerformed(ActionEvent event)
                          ok = true;
                          dialog.setVisible(false);
      JButton cancelButton = new JButton("Cancel");
      cancelButton.addActionListener(new
                ActionListener()
                    public void actionPerformed(ActionEvent event)
                     dialog.setVisible(false);
      // add buttons to southern border
      buttonPanel = new JPanel();
      buttonPanel.add(okButton);
      buttonPanel.add(cancelButton);
      panel.add(buttonPanel, BorderLayout.SOUTH);
      this.add(panel);
   public User getUser()
      return new User((String)driverFields.getSelectedItem(),
                (String)urlFields.getSelectedItem(),
                userName.getText(),
                password.getText());
      Show the chooser panel in a dialog
      @param parent a component in the owner frame or null
      @param title the dialog window title
   public boolean showDialog(Component parent, String title)
      ok = false;
      // locate the owner frame
      Frame owner = null;
      if (parent instanceof Frame)
         owner = (Frame) parent;
      else
         owner = (Frame)SwingUtilities.getAncestorOfClass(
            Frame.class, parent);
      // if first time, or if owner has changed, make new dialog
      if (dialog == null || dialog.getOwner() != owner)
         owner = null;
         dialog = new JDialog(owner, true);
         dialog.getContentPane().add(this);
         dialog.pack();
      // set title and show dialog
      dialog.setTitle(title);
      dialog.setVisible(true);
      return ok;
   private JTextField userName,password;
   private JComboBox driverFields,urlFields;
   private boolean ok;
   private JDialog dialog;
   private JPanel panel,tfPanel,cbPanel, buttonPanel;
   A user has a driver, url, name and password.
class User
   public User(String aDriver, String aURL, String aUser, String aPassword)
             driver =aDriver;
             URL =aURL;
      user = aUser;
      password = aPassword;
   public String getDriver() {return driver;}
   public String getURL() {return URL;}
   public String getUser() { return user; }
   public String getPassword() { return password; }
   private String user,URL,driver;
   private String password;
ResultsModel takes a resultset and draws a table
class ResultsModel extends AbstractTableModel
  String[] columnNames = new String[0];
  Vector dataRows;              // Empty vector of rows
  public void setResultSet(ResultSet results)
    try
      ResultSetMetaData metadata = results.getMetaData();
      int columns =  metadata.getColumnCount();    // Get number of columns
      columnNames = new String[columns];           // Array to hold names
      // Get the column names
      for(int i = 0; i < columns; i++)
        columnNames[i] = metadata.getColumnLabel(i+1);
      // Get all rows.
      dataRows = new Vector();                  // New Vector to store the data
      String[] rowData;                         // Stores one row
      while(results.next())                     // For each row...
        rowData = new String[columns];          // create array to hold the data
        for(int i = 0; i < columns; i++)        // For each column
           rowData[i] = results.getString(i+1); // retrieve the data item
        dataRows.addElement(rowData);           // Store the row in the vector
      fireTableChanged(null);           // Signal the table there is new model data
    catch (SQLException sqle)
      System.err.println(sqle);
  public int getColumnCount()
    return columnNames.length;
  public int getRowCount()
    if(dataRows == null)
      return 0;
    else
      return dataRows.size();
  public Object getValueAt(int row, int column)
    return ((String[])(dataRows.elementAt(row)))[column];
  public String getColumnName(int column)
    return columnNames[column] == null ? "No Name" : columnNames[column];
}

I posted the code before clearly restating my question.
I have two JOptionPanes, noted in the code with comments, which appear on closing the program. The first one is in response to a widow event, the second in response to a File>>Exit event. The code for both is identical, but the first one does not function properly when "Cancel" or No" is pressed. Instead of the dialog diasappearing, the program window disappears, but the program does not exit.I'm not sure quite how to implement DO_NOTHING_ON_CLOSE to solove this, as was suggested.
BTW, the formatting is giving me troubles, despite my efforts to use only necessary tabs and remove comments. I reposted in order to make my listing more readable, but don't think I succeeded.

Similar Messages

  • Problem with .gif frames not disappearing

    Hi-
    I'm pretty new to photoshop. Lately I've been messing around with editing and gifs and have been sporadic success achieving what I set out to do. I'm looking for help with a fairly specific problem that seems to pop up again and again. The problem is that when I attempt to make gifs. with a transparent background, the gif frames do not disappear properly once the file is moved out of photoshop.
    For example: I came across the following .gif yesterday and decided that I want to try to edit for a surreal effect.
    http://imgur.com/NJlpA.gif (I hope that link works)
    I wanted to cut out the beginning of the animation where the man is on the motorcycle and make it so that the man just rolls back and forth on the ground (weird I know).
    I successfully deleted the frames that I no longer wanted and duplicated the frames of animation that I wanted to play again so that the image would loop seamlessly. I then went through frame by frame, and corresponding layer by layer, to remove the white background. I used the quickwand tool. It took a long time but the gif was playing in photoshop as I wanted i to, a man writhing back and forth on the ground for no apparent reason. Siiiiiiick.
    So I did the whole save for web and devices thing, saved it as a .gif and then I put it on the interwebs and it turned out I had created this monstrosity:
    http://imgur.com/60CHc.gif
    Please, please, please, someone tell what I'm doing wrong. I feel like I've done the exact same proceedure to other gifs and have had them turn out perfectly. What am I missing???  Please note that the problem isn't that I accidentally made layers active for frames I didn't want them active for. I checked.
    Okay, thanks in advance to anyone who might be able to offer some advice.
    Sean

    Hello, and thanks for the timely response-
    Unfortunately, I only had a save of the "finished" version of the gif which now includes the unwanted frames. However, I went back and followed the same process, made a shorter version of the gif (which suffers from the same problem), and took a screenshot of that.
    http://imgur.com/8e8g1.png
    Also included is the preview screen which shows some of the settings that were in use (could be helpful?).
    http://imgur.com/8e8g1&bOThel
    And, finally, the shorter, still defective, gif.
    http://imgur.com/Ggnw7
    Thanks,
    Sean

  • Cancel button does not work properly in ProgressMonitor

    The cancel button does not work properly in my ProgressMonitor.
    Only the keyboard Enter key is accepted but no mouse click.
    Everything else works fine.
    What could be wrong????
    Thank you!

    Yes, there is a monitor.isCanceled() and it works if the enter key is pressed. However, a mouse click on the cancel button does not work!!!
    Please help.
    m_btnSave.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent arg0) {
              final int maximum = getMyModel().getList(MerchantHierPropagateMgrDataInterface.ATT_MAN_RESULT).size();
              class TimerListener implements ActionListener {
                   public void actionPerformed(ActionEvent evt) {
                        System.out.println("*************isCanceled = "+ m_monitor.isCanceled());
                        if (m_monitor.isCanceled() || getMyModel().isDone()) {
                             m_timer.stop();
                             m_monitor.close();
                             if (getMyModel().isDone()) {
                                  m_ok = true;
                                  close();
                             else {
                                  m_worker.interrupt();
                                  try {
                                       m_pm.rollback();
                                  } catch (SQLException e) {
                                       BPrompter.showException(e);
                                       Log.printOutAlways(e);
                        else {
                             int progress = getMyModel().getProgess();
                             int prozent = maximum == 0 ? 0 : 100 * progress / maximum ;
                             m_monitor.setProgress(progress);
                             m_monitor.setNote("Fertigstellung: (" + prozent + "%) " + progress + " von " + maximum);
              if (getModel().getList(MerchantHierPropagateMgrDataInterface.ATT_MAN_RESULT).size() > 100) {
                   if (BPrompter.showConfirmDialog("Diese Funktion kann mehrere Minuten dauern.", "Hinweis") != JOptionPane.OK_OPTION) {
                        return;
              m_monitor = new ProgressMonitor(FrameApplication.getInstance(), "Fortschritt der Weitergabe",
                        "Initialisierung", 1, maximum);
              m_monitor.setMillisToDecideToPopup(0);
              m_monitor.setMillisToPopup(0);
              m_timer = new Timer(500, new TimerListener());
              m_timer.start();
              m_worker = new SwingWorker() {
                   public Object construct() {
                        try {
                             getMyModel().propagateToMerchantsAndTerminals(m_pm,     m_mutationInZukunftZuErledigenBisDate);
                        } catch (PersistenceException e) {
                             Log.printOutAlways(e);
                             return e;
                        return Boolean.TRUE;
                   } // constuct()
              }; // SwingWorker
              m_worker.start();
    });

  • Hello My ipads Power button is not working properly when I press it once it shows option to turn off instead of locking and some other display problems like it suddenly lockes down or display disappears ...Please help. Thank You

    Hello My ipads Power button is not working properly when I press it once it shows option to turn off instead of locking and some other display problems like it suddenly lockes down or display disappears ...Please help. Thank You

    Thanks for that information!
    I'm sure I will be calling AppleCare, but the problem is, they charge for the phone calls don't they? Because I don't have money to be spending to be on the phone with a support service.
    In other things, it seemed like the only time my MacBook was working was when I had Snow Leopard without the 10.6.8 update download that was supposed to be done to prepare for OS X Lion.
    When I look at the information of my HD it says that I have 10.6.8 but that was the install that it claimed to have failed and caused me to restart resulting in all of the repeated problems.
    Also, because my computer is currently down, and I've lost all files how would that effect the use of my iPhone? Because if it doesn't get fixed by the time OS 5 is released, how would I be able to upgrade?!

  • Flash player does not work properly on Windows 7 32 bits

    Hello,
    My flash player does not work properly on Windows 7 32 bits with Firfox and IE8 (lasts versions).
    My Flash player version : 10.0.45.2, but I tried with version 9 too, with same problems.
    I have tried to uninstall, reboot, reinstall several times, ... witch did not worked.
    In fact, it works correctly on some sites, like youtube, but not on some others like :
    http://www.dailymotion.com/ => black screen instead of videos, right click gives flash context menu
    http://www.canalplus.fr/ => videos does not load, right click gives flash context menu
    http://www.myspace.com/ => no audio player, right click gives flash context menu
    some games in http://www.kongregate.com/ => black screen instead of games, right click gives flash context menu
    I have no problem with shockwave in http://www.adobe.com/shockwave/welcome/
    No problem too with flash player on http://www.adobe.com/software/flash/about/
    But in the Global Privacy Settings panel (http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager02.htm l), I cannot change any settings :
    I cannot check boxes,
    My changes are not saved.
    In most of flash animations, videos, ...,
    when I click on parameters, I cannot do anything, even closing.
    when I am in full screen mode, the message "press escape to exit...." does not disappear.
    Last thing, all those problems was not there when I was on Windows XP, few weeks ago, and appear with my registered Windows 7 premium familly edition, with the same hardware configuration...
    Thank you for your help

    Hi eidnolb
    Thanks for your answer.
    This is what I have :
    Verify user permissions
    I have an administrator account.
    I tried (uninstall, install and run) with super-administrator account for same results
    Install the most current version.
    I am running the latest version (10.0.45.2)
    Run the Clean Installer to Fix 3rd Party Flash Player Cleaners
    I did not "clean" my computer.
    Troubleshoot Pop-up blockers
    I have no Pop-up or esle blocker  software.
    Ensure that Internet utilities do not block Flash Player
    I tried (uninstall, install and run) without Avast.
    I have windows 7 firewall. I do not know where I can allow ActiveX  controls and Flash (SWF) content. I do not see anything relative to ActiveX an Flash in allowed program list.
    Fix machine crashes when displaying Flash content
    I have no freez or crash.
    Using IE, Shockwave Flash Object is Enabled and vs 10.0.45.2
    Using FF, I have SWF vs  10.0.45.2 and it is Enabled
    I really do not understand !!
    Thanks,
    Ju'

  • Mini dvi to vga not working properly

    I have a Macbook from around 2008 and it has a mini dvi port. I have a mini-dvi to vga adapter going to my Vizio 32 inch TV's RGB port.  I have tried two adapters, and they both have problems.
    The display works fine coming from both of my G5s, which are running DVI to VGA to to the VGA cable to RGB port.  However, when I run the mini-dvi out of my Macbook, it does bizarre things.  It resets the display on my Macbook, and displays only part of the information on the Vizio screen.  For instance, the first adapter would show the wallpaper of my Mac, but would not show the icons on the TV.  This second adapter does the reverse.  The icons disappeared from my laptop, but showed on the TV.   The mouse shows sometimes on the TV, sometimes only on the Macbook. Etcetera.
    What's going on here?  This should work.  Grateful for help and suggestions. Thank you.

    Oh, it won't let me edit, so here's an added note:
    This time I started the macbook with the adapter plugged in, so that it didn't have to adjust.  It booted normally, with normal color, recognized properly on the TV, and then went to teh login screen.  All normal.  Once it booted into my login, and everything loaded on the desktop, the blue haze covered the screen.  This happened twice.  The first time, I hard-rebooted - and for some reason it's sort of loud and sounds like it's working very hard to reboot.  The second time I unplugged the adapter, the laptop tried to reset itself, and showed the icons, but not my picture in the middle of the wallpaper or the program bar at the bottom.  It did not respond properly to the restart command, hanging upon shutdown, so I  did a hard-shutdown again.
    EDIT
    Okay, it must be somewhere in the settings.  I am logged in from another login on the machine, which I keep as a control.  It is working fine, no issues.  I will somehow have to trace down the problem?  THe other login is my main and everything is loaded on that one.  Does this issue sound familiar to anyone?  welcome any guidance. 
    Thx.
    EG

  • JTextField does not redraw properly

    Hi,
    I have a JPanel that displays some buttons amongst some textfields and labels. One of my buttons is labeled Add Customer. When the user clicks on Add Customer he is presented with a number of JTextFields and JLabels which are all displayed fine.
    However, when the user clicks on Cancel or closes the InternalFrame in which the JTextFields and JLabels are displayed and then clicks on Add Customer again, then the JTextFields are not redrawn properly. I image of this behavior can be seen at
    http://www.grosslers.com/totals.07.png
    As soon as I start to type text into the textfield then the whole textfield redraws itself as it should, but when it looses focus then the textfield becomes invisible once again.
         // Some textfields
         private     JTextField textField_customerEditCompanyName = new JTextField(10);
         private     JTextField textField_customerEditContactName = new JTextField(10);
          * Panel that will hold all the buttons for the quote request details tabbed panel
         public JPanel createQuoteRequestDetailsButtons() {
              // Panel to act as a container for the buttons
              JPanel panel_quoteRequestDetailsButtons = new JPanel();
              // Create, register action listeners and add buttons to the panel
              JButton button_addCustomer = new JButton("Add Customer");
              button_addCustomer.addActionListener(new ActionListener() {
                   public void actionPerformed (ActionEvent actionEvent) {
                        // Add a new customer
                        addCustomerListener();
              panel_quoteRequestDetailsButtons.add(button_addCustomer);
              return panel_quoteRequestDetailsButtons;
          * Display a new internal frame when the user wants to add a new customer
         public void addCustomerListener() {
              // Master panel for the add customer details
              JPanel panel_addCustomerMaster = new JPanel();
              // Add the customer details panel to the master panel     
              panel_addCustomerMaster.add(customerDetailsPanel());
              // Ensure that all the textfields are blank
              resetCustomerDetailsPanelTextFields();
              // Add the buttons panel to the master panel          
              panel_addCustomerMaster.add(addCustomerButtons());
              // Add the master panel to the internal frame
              internalFrame_addCustomer.add(panel_addCustomerMaster);
              // Add the internal frame to the desktop pane
              JupiterMainGUI.desktopPane.add(internalFrame_addCustomer);
              // Set the size of the internal frame
              internalFrame_addCustomer.setSize(500,420);
              // Set other properties of the internal frame
              internalFrame_addCustomer.setClosable(true);
              internalFrame_addCustomer.setIconifiable(false);
              internalFrame_addCustomer.setMaximizable(false);
              // Set the location of the internal frame to the upper left corner
              // of the current container
              internalFrame_addCustomer.setLocation(0,0);
              // Set the internal frame resizable
              internalFrame_addCustomer.setResizable(false);
              // Show the internal frame
              internalFrame_addCustomer.setVisible(true);
          * Panel that displays the textfields and labels when the user clicks on
          * add or view customer details
         public JPanel customerDetailsPanel() {
              // Create master container for this panel
              JPanel panel_customerDetailsMaster = new JPanel();
              // Create the container that will hold all the textfields/labels for
              // the creation of a new customer          
              JPanel panel_customerDetails = new JPanel(new SpringLayout());
              // Add the details panel to the master panel
              panel_customerDetailsMaster.add(panel_customerDetails);
              // Set the border for the panel
              panel_customerDetails.setBorder(BorderFactory.createTitledBorder("Customer Details"));
              // Create textfields/labels, add them to the internalFrame
              JLabel label_customerCompanyName = new JLabel("Company Name : ");
              JLabel label_customerContactName = new JLabel("Contact Name : ");
              panel_customerDetails.add(label_customerCompanyName);
              panel_customerDetails.add(textField_customerEditCompanyName);
              panel_customerDetails.add(label_customerContactName);
              panel_customerDetails.add(textField_customerEditContactName);
              //Lay out the panel.
              SpringUtilities.makeCompactGrid(panel_customerDetails,
                                    2, 2, //rows, cols
                                    5, 5,        //initX, initY
                                    5, 5);       //xPad, yPad
              return panel_customerDetailsMaster;
          * Panel holding the buttons when the user clicks on add customer
         public JPanel addCustomerButtons() {
              // Container for the buttons
              JPanel panel_addCustomerButtons = new JPanel();
              // Create the buttons for the panel
              JButton button_customerOk = new JButton("Ok");
              JButton button_customerCancel = new JButton("Cancel");
              button_customerOk.addActionListener(new ActionListener() {
                   public void actionPerformed (ActionEvent actionEvent) {
              // Closing the internal frame. When i re-open this internal frame again
                  // the labels are re-drawn properly but not the textfields.
              button_customerCancel.addActionListener(new ActionListener() {
                   public void actionPerformed (ActionEvent actionEvent) {
                        try {
                             // close and remove the internal frame from the desktop pane     
                             internalFrame_addCustomer.setClosed(true);
                        } catch (PropertyVetoException exception) {
                        JupiterMainGUI.desktopPane.remove(internalFrame_addCustomer);
              panel_addCustomerButtons.add(button_customerOk);
              panel_addCustomerButtons.add(button_customerCancel);          
              return panel_addCustomerButtons;
         }So far I have a solution, and that is to use the GTK look and feel, but it is not really an option. Another way that I have managed to get the textfields to display properly is to create them in the same method, where I create the labels. Again, this is not really an option as i need to access the textfields outside the method scope.
    Any help would be greatly appreciated
    -- Pokkie

    I added the following :
         * Panel that displays the textfields and labels when the user clicks on
         * add or view customer details
         public JPanel customerDetailsPanel() {
              // Create master container for this panel
              JPanel panel_customerDetailsMaster = new JPanel();
              // Create the container that will hold all the textfields/labels for
              // the creation of a new customer          
              JPanel panel_customerDetails = new JPanel(new SpringLayout());
              // Add the details panel to the master panel
              panel_customerDetailsMaster.add(panel_customerDetails);
              // Set the border for the panel
              panel_customerDetails.setBorder(BorderFactory.createTitledBorder("Customer Details"));
              // Create textfields/labels, add them to the internalFrame
              JLabel label_customerCompanyName = new JLabel("Company Name : ");
              JLabel label_customerContactName = new JLabel("Contact Name : ");
              panel_customerDetails.add(label_customerCompanyName);
              panel_customerDetails.add(textField_customerEditCompanyName);
              panel_customerDetails.add(label_customerContactName);
              panel_customerDetails.add(textField_customerEditContactName);
    // Added this line , but doesn't seem to make a difference. also called revalidate() on the
    // internalFrame in which this panel is displayed but no luck either. Called revalidate()
    // on panel_customerDetailsMaster but nothing :(
              panel_customerDetails.revalidate();
              //Lay out the panel.
              SpringUtilities.makeCompactGrid(panel_customerDetails,
    2, 2, //rows, cols
    5, 5, //initX, initY
    5, 5); //xPad, yPad
              return panel_customerDetailsMaster;
    Thanks for the response thou, much appreciated

  • TestStand Simple OI does not close properly

    Hi there.
    We have build a test system that is running TestStand 4.2 and the code modules are created with LabVIEW 9.0. The SW is running on a PC with Windows XP.
    We are currently using TestStand Simple Operator Interface (LabVIEW version) to run the tests, and it is with the Operator Interface that we are having a problem.
    If we use the TestExec.exe file that came with the TestStand installation everything works fine. But we need to make some modifications to OI and if we open the project file and recompile the OI, then the OI will not close properly. It seems to shutdown the testengine and stop execution of the VI, but the window does not disappear until we move the mouse.
    When I open the project file LabVIEW informs me that the project was last saved in version 7.1.1 and we are now running 9.0.
    Can anyone tell me what is holding the window on the screen until there is activity on the mouse?
    Solved!
    Go to Solution.

    I was looking through TestStand 4.2 known issues, and I found this:
    ID# 148697
    LabVIEW User Interface might hang when using LabVIEW events
    A LabVIEW User Interface that registers ActiveX callbacks and uses an event structure might hang when the user interacts with a LabVIEW control or indicator. The hang is rare, but when it occurs, TestStand User Interface (UI) Controls remain responsive, but all LabVIEW User Interface elements appear frozen.
    Workaround: Activate another application and reactive the LabVIEW User Interface.
    Not exactly the same as I am experiencing but sounds similar - Does anyone know more about this issue?

  • In photoshop cc is not working properly right button on the tablet stylus genius

    in photoshop cc is not working properly right button on the tablet stylus, when clicked, the menu appears and immediately disappears in Pshotosho CS6 everything was OK, and in other programs all OK.
    Tablet - Genius G-Pen M712X.

    have you participated on here before, smihop? -- do Adobe representatives ever provide a solution? I pay monthly for all adobe cloud applications <-- doesn't it seem like that should come w/some kind of support? (especially when they push out buggy releases <-- which make me wish I could go back a version)

  • Error message after upgrade to iTunes 11: "iTunes has detected a problem with your audio configuration. Audio/Video playback may not operate properly."  At this point my PC running XP loses all audio.

    Several attempts to upgrade to iTunes 11 have failed.  After an upgrade to 11 the error message reads: "iTunes has detected a problem with your audio configuration. Audio/Video playback may not operate properly."  At this point--after the upgrade to iTunes 11--my PC running Windows XP loses audio playback for all functions--in iTunes, in the browser and the volume icon disappears from the System Tray.  Only by removing iTunes 11, and then using System Restore to turn back the OS settings can I return the PC to normal functioning.
    I did that.  I reinstalled iTunes 10.5.  Everything seemed fine, but when I try to plug in and copy a CD to my iPhone 4S an error message reads roughly: 'iPhone 4S requires iTunes 10.5 or higher to work.'
    What might be the problem with my audio configuration?
    Why doesn't my iPhone 4S work with iTunes 10.5?  It used to work with iTunes 10.5.
    Please advise.
    ep

    This forum is for questions about iTunes U, Apple's service for colleges and universities to post educational material in the iTunes Store. You'll be most likely to get help with this issue if you ask in the general iTunes for Windows forums.
    Regards.

  • Routine is not working properly?

    Expert's please tell me is there any problem with this routine?
    Because this routine is not working properly.It is not populating to all the fields the RESULT value.
    if
      COMM_STRUCTURE-/BIC/ZVEN_NAME = 'VENDOR1' or
    COMM_STRUCTURE-/BIC/ZVEN_NAME = 'VENDOR2'.
    result value of the routine
    RESULT = 'YEPSILON'.
    ELSE.
    RESULT = COMM_STRUCTURE-/BIC/ZVEN_NAME.
      ENDIF.
    Thanks in advance.
    vasu.

    Vasu,
    Here is the sample code which i have tried out in my system: its working properly, please find the same.
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
    IF
    COMM_STRUCTURE-/BIC/YSLSTDP3 = '08.2007' or
    COMM_STRUCTURE-/BIC/YSLSTDP3 = '09.2007'.
    result value of the routine
      RESULT = 200000.
      ELSE.
      RESULT = COMM_STRUCTURE-/BIC/YSLSTDP3.
      ENDIF.
    if the returncode is not equal zero, the result will not be updated
      RETURNCODE = 0.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    *****Assign Points*****
    Thanks,
    Gattu

  • "disk not ejected properly" but is still mounted on desktop?

    Hi,
    I get a "The disk was not ejected properly" message, yet if I go to the Finder's desktop the drive is still mounted and accessible and read/write works fine.
    I've witnessed it happen once while viewing the desktop. The drive disappears momentarily for about 1.5 - 2 seconds, then shows up again. So It DOES eject, but it instantly re-mounts, and I mean in under 2 seconds and I've neder experienced a drive intentioanlly unmount/remount this fast in my life. It does happen more often when waking from sleep, but not only in that instance.
    Been having this bug since OS X Lion and on to the current version of Marveicks. I am posting this under Mavericks because it's not hardware specific to anything other than USB and LaCie. I am experiencing it on multiple machines, different models, with different external LaCie drives of differing types, with different USB cables. This does not only happen when waking from sleep (as most threads seem to indicate), it sometimes happens for no reason. 
    The common factors:
    All the external drives are LaCie drives (though vastly different models).
    Both affected Macs are 2012+ models with Thunderbolt interphases and USB 3 ports (am using USB ports for USB drives, no Thunderbolt adaptors). 
    I could suspect LaCie, but since it's new since Lion... well you get the picture. Something leads me to suspect a bug in OS X USB protocol, possibly on software, maybe even in firmware. Might be linked to energy saving. I have "sleep drives when possible" enabled, and though it might help to turn that off (I haven't tested yet) I just don't feel I should need to, I want unused drives to spin down and save energy.

    Hello there The Heftster,
    It sounds like your external drives are periodically disconnecting on their own from the computer causing the prompt saying that the drive was not ejected properly. I would start by resetting the PRAM on your computer with this article:
    OS X Mavericks: Reset your computer’s PRAM
    http://support.apple.com/kb/ph14222
    Shut down your Mac.
    Locate the following keys on the keyboard: Option, Command (⌘), P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on your Mac.
    Immediately press and hold the Option-Command-P-R keys. You must press this key combination before the gray screen appears.Continue holding the keys down until your Mac restarts, and you hear the startup sound for the second time.
    Release the keys.
    Resetting PRAM may change some system settings and preferences. Use System Preferences to restore your settings.
    As well as the SMC on your computer:
    Intel-based Macs: Resetting the System Management Controller (SMC)
    http://support.apple.com/kb/ht3964
    Shut down the computer.
    Unplug the computer's power cord.
    Wait fifteen seconds.
    Attach the computer's power cord.
    Wait five seconds, then press the power button to turn on the computer.
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • Images not displayed properly

    [Migrated from the Syclo Resource Center]
    prashanthi_vangala   01/03/2012 06:44,
    Hi,I am working on Agentry 5.4.0I have a list screen where for one of the columns I have a rule to display images ( I use checked and unchecked images ). Earlier the images were getting displayed properly on the ATE but  it is not working now and I did not make any changes to the image properties then.But after this, I tried couple of things with the image properties to make it work, like when I do not use any mask colour the image does not get displayed but when i use any maks colour the image gets displayed but its completely blacked out ( and thus for checked image, cannot see the check mark and its completely blacked out ).I face same issue with the login image as well. I added a new Image ( Logo ) to my App for the login Screen, but even this image does not appear on the login screen.
    I also tried deleting the Dev folder and re-publishing, but even this does not work.
      -Prashanthi
    Jason Latko   01/03/2012 11:42
    Try deleting the Application directory under your development server where the images reside and publish again.
      Completely clear your ATE and transmit again from scratch.
      Also, what mask color are you using?
      Try using a green hugh and not black or white for the mask.
    Jason Latko - Senior Product Developer at Syclo
    prashanthi_vangala   01/03/2012 12:38
    Hi Jason,Thank you for the reply.I already tried all the  things you have mentioned, but the same issue exits still.
    Prashanthi
    Jason Latko   01/03/2012 12:40
    Is it just the ATE, or do you have the same problems using the WIn32 or PPC clients?
    Jason Latko - Senior Product Developer at Syclo
    prashanthi_vangala   01/04/2012 06:21
    Hi Jason,Behaviour in ATE:I have changed the image now and tested with the new image . Now, its behaving strangely:When I do a sync after publishing or a reset of ATE; I see the new image properly displayed on the screen but when I leave the screen and come back to the same screen again, the new image is getting replaced by the old image ( atleast the old image is not displayed properly, it appears like a black square box..and because of the same issue I had with this image I switched to the new image ). Behaviour in Win32 Client:When I tested with the client, I see  the new image properly for the first time and when i leave the screen and come back the image disappears..This is the behaviour in client.
    Please suggest.
    -Prashanthi
    Jason Latko   01/09/2012 11:35
    Prashanthi,What did you use to create these images?
      They are simple bitmaps I assume?
      Try creating some very simple images using Microsoft Paint, then set a mask of green in Agentry.
      Your problem sounds familiar, but I can't find a matching bug in our database.
      Maybe someone else has experienced this?
      You could also try upgrading to a newer version of Agentry to see if the problem goes away.
      We are currently on version 6.0.4.Jason Latko - Senior Product Developer at Syclo
    prashanthi_vangala   01/11/2012 10:02
    Hi Jason,
    Thank you for the reply.
    But strangely, from past few days I see that the image is working fine again.
    But kept this topic open because it was wierd, that the image is working correctly again without making any major change. What I did was to just write the rule again which calls the image ( though i did this before and did not work then but worked now ) and to observe the image behaviour for few days.But it seems like it is fine now.
    Thanks and Regards,Prashanthi

    We am using "jv:imageButton" tag for displaying the image and below is the tag code,
    <jv:imageButton styleClass="buttonStyle"
    selected="true"
    onclick="networkCanvas.setInteractor(clientSelect)"
    image="../oracle/communications/inventory/ui/images/arrow.png" buttonGroupId="interactors"
    rolloverImage="../oracle/communications/inventory/ui/images/arrowh.png"
    selectedImage="../oracle/communications/inventory/ui/images/arrowd.png"
    title="#{inventoryUIBundle.SELECT}"
    message="#{inventoryUIBundle.SELECT}" />
    The able code is present in the below path,
    ..\public_html\oracle\communications\inventory\ui\network\page\NetworkView.jsff
    The images are present in the following path,
    ..\public_html\oracle\communications\inventory\ui\images\zoomrecth.png
    I am not thinking this is a Platform Beta 3 uptake issue. And I am suspecting an issue with integration of ilog with ADF. Any help in this regard would be helpful.
    regards,
    Chandra
    Edited by: user638992 on Feb 25, 2010 3:40 AM

  • The disk was not ejected properly

    I have 3 Seagate 1.5TB external USB drives. Two of which I am using with a MacbookPro 17" first gen. Latest snow leopard. The third one I am tethering to a Dell XPS server. The one attached to the Dell works fine.
    On the MBP17 Every now and again (randomly) the disk disappears from finder and I get this dialog:
    |
    | The disk was not ejected properly. If
    | possible, always eject a disk before
    | unplugging it or turning it off.
    |
    | To eject a disk, select it in the finder and choose File
    | > Eject. The next time you connect the disk, Mac OS
    | X will attempt to repair any damage to the
    | information on the disk.
    |
    | ( OK )
    I've replaced one of the drives through Seagate RMA and the same thing happens with the returned/refurbished drive. So, I really don't think there's anything wrong with the drives.
    I've tried at least 3 different USB cables of different lengths from different vendors. One is only 1.5feet & gold plated. Still, random ejects. Using the disk attached to an old dual G5 I have... I don't have this problem.
    Anyway, I am thus quite leery of using it for anything other than backups. I've never had the problem while actually copying files, only when I'm doing something else (like typing an email, or browsing the net).
    I recall having read some older Macbook Pro 17" owners having similar issues with >= 1TB drives on these forums [http://discussions.apple.com/thread.jspa?threadID=2151621&start=120&tstart=0] but no solutions.
    If someone can point me to a solution I would be very grateful.
    Message was edited by: phpguru

    @Gizmolab - Thanks for that reply. It seems like a decent theory. I found Seagate Diagnostics for Mac. It says it's only for drives that have a FireWire800 port. The ones I am using have USB only. I installed it anyway. When I run diagnostics it says no drives found so I cannot diagnose them. I'll see how it goes though, maybe it updated the driver.
    To add some more info to this thread... I figured I'd try Disk Utility to manage the drives manually. I've tried dismounting them and also just dragging the volumes to the trash when they are not in use, and using Disk Utility to mount them again when they are needed.
    What I've found is that in addition to the drives automagically ejecting themselves (and remounting again automatically about 20 to 30 seconds later)... is that a dismounted drive will automagically mount, too. Okay fine, I'll dismount them and unplug the USB cables, and reattach them when I need them.
    Disk Utility reports that there appears to be no problems with the disk... thankfully. While typing this reply, I heard the disk go to sleep and about 3 minutes later it just ejected itself dang it. So Seagate Diagnostics appears to be only for Firewire800 drives.

  • I see that there are people that have the problem suddenly almeer notes disappear this is with me also happened and now comes the: If I put a backup that I have my back than notes for 30 seconds back and THEN THEY DISAPPEAR again!

    i see that there are people that have the problem suddenly all notes disappear :
    this is with me also happend and now comes it
    when iputa backup that i have back than i kan see the notes voor 30 seconds and than the disappear again!

    Hello,
    Just to set your expectations...it's fine to "rant" about things here, but I do hope you are not expecting a formal reply from anyone at BlackBerry. For this site is not a channel for any formal communications with, escalations to, nor support from BlackBerry for any purpose whatsoever. Rather, it is a user-to-user community of volunteers who try to help each other out to the best of their abilities. Note this banner, please, posted at the top of nearly every page of the site:
    Consequently, words posted such as "WHAT THE HECK IS WRONG WITH YOU?" are actually directed at the other kind volunteers of this site, who may not respond in the most kindly of fashions. Hopefully, we all can understand that your rant is directed at BlackBerry (though, by placing it here, it is misplaced), but I just wanted to gently caution you about such posts, as well as ensure that your expectation concerning replies is properly set. Also, for new members who join the site, it's always good to have responses to such posts, covering the intended use of the site so that those new members can better understand such things.
    On the other hand, if you do desire assistance from other users for your issues, you might consider wording your requests in a manner that would motivate a kind volunteer to provide such.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

Maybe you are looking for

  • In BADi , How to pass the values between two Method

    Hi Experts, We have two methods in BADis. How to pass the value  between two Methods. Can you guys explain me out with one example... Thanks & Regards, Sivakumar S

  • Variable substitution or dynamic configuration

    Hi,    I am doing Proxy sender to File receiver scenario. I have message payload like, MTtest1..... 0..1 date.... 0..1 item....0...unbound I want to create a text file  with the name SAP<date>. I am using a variable substitution method, date: payload

  • Forefront for Exchange 2010 - no mails in quarantine or incidents list

    I have a client with Forefront 2010 installed on their exchange 2010 server. I see 45 messages that have been blocked as spam in the dashboard - 43 connection, 1 smtp and 1 content. The client wants to know which messages are being blocked and which

  • How to use two external monitors and Tecra M5

    Hi , I've been used to work with two 17" monitors connected to a computer in extended desktop monitor view, ii've just changed Job and now i have the following setup: a Toshiba Laptop connected to Toshiba Tecra M5 dockstation and one external 17" mon

  • Form fill won't fill only certain email address

    I am using Yahoo mail. We had to delete on email address from the passwords list due to a password change. Since deleting it, Firefox's form fill will work with all of my email addresses except for the one whose original password was deleted.