Exemple #1
0
 void setNewPane() {
   if (m_pane != null) {
     getContentPane().remove(m_pane);
     m_pane = null;
   }
   try {
     m_pane = new Bench.BenchPanel(!m_bInApplet, m_parentFrame);
     if (m_strURL != null)
       m_pane.doOpenConnection(m_strDriver, m_strURL, m_strUserName, m_strPassword, false);
     if (m_nDriverType != -1) m_pane.setDriver(m_nDriverType);
   } catch (Exception e) {
     String strMessage = e.getMessage();
     if (strMessage == null) strMessage = e.toString();
     JOptionPane.showMessageDialog(
         null, strMessage, "Error connecting to data source", JOptionPane.ERROR_MESSAGE);
   }
   getContentPane().add(BorderLayout.CENTER, m_pane);
   validate();
   repaint();
 }