From 3185f276b6d1fea0ebf7df1221624402ecd00456 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 13 Oct 2014 12:42:40 +0200 Subject: [PATCH] native laf --- src/de/mpg/molgen/buczek/portifix/Gui.java | 26 ++++++---------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/de/mpg/molgen/buczek/portifix/Gui.java b/src/de/mpg/molgen/buczek/portifix/Gui.java index d719c36..93312fe 100644 --- a/src/de/mpg/molgen/buczek/portifix/Gui.java +++ b/src/de/mpg/molgen/buczek/portifix/Gui.java @@ -28,6 +28,8 @@ import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.TransferHandler; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableCellRenderer; @@ -148,7 +150,7 @@ private void saveThis() { tableModel.setNewDateThis(jTable1.convertRowIndexToModel(selected[i]), d); } } catch (ParseException exception) { - exception.printStackTrace(); + // invalid date string. keep old values } } @@ -162,7 +164,7 @@ private void saveAll() { tableModel.setNewDateAll(jTable1.convertRowIndexToModel(selected[i]), d); } } catch (ParseException exception) { - exception.printStackTrace(); + // invalid date string. keep old values } } @@ -442,25 +444,11 @@ private void jButton_saveallActionPerformed(java.awt.event.ActionEvent evt) {//G */ public static void main(String args[]) throws SQLException { - // DriverManager.registerDriver(new org.firebirdsql.jdbc.FBDriver()); - /* Set the Nimbus look and feel */ - // - /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. - * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html - */ try { - for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); - break; - } - } - } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) { - java.util.logging.Logger.getLogger(Gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { + // if we fail to set the system look and feel, we continue with the default } - // - - // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() {