You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2011/01/31 03:16:02 UTC

svn commit: r1065469 - in /xmlgraphics/batik/trunk/sources/org/apache/batik: apps/svgbrowser/JSVGViewerFrame.java util/gui/JErrorPane.java

Author: cam
Date: Mon Jan 31 02:16:02 2011
New Revision: 1065469

URL: http://svn.apache.org/viewvc?rev=1065469&view=rev
Log:
Focus the OK button when an error message dialog is shown in Squiggle.

Modified:
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/JErrorPane.java

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java?rev=1065469&r1=1065468&r2=1065469&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java Mon Jan 31 02:16:02 2011
@@ -2780,8 +2780,7 @@ public class JSVGViewerFrame
             if (debug) {
                 ex.printStackTrace();
             }
-            JErrorPane pane =
-                new JErrorPane(ex, JOptionPane.ERROR_MESSAGE);
+            JErrorPane pane = new JErrorPane(ex, JOptionPane.ERROR_MESSAGE);
             JDialog dialog = pane.createDialog(JSVGViewerFrame.this, "ERROR");
             dialog.setModal(false);
             dialog.setVisible(true);

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/JErrorPane.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/JErrorPane.java?rev=1065469&r1=1065468&r2=1065469&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/JErrorPane.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/JErrorPane.java Mon Jan 31 02:16:02 2011
@@ -44,6 +44,7 @@ import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JSeparator;
 import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
 
 import org.apache.batik.util.gui.resource.ActionMap;
 import org.apache.batik.util.gui.resource.ButtonFactory;
@@ -115,6 +116,11 @@ public class JErrorPane extends JPanel i
     protected JPanel subpanel;
 
     /**
+     * The OK button.
+     */
+    protected JButton okButton;
+
+    /**
      * Constructs a new JErrorPane.
      *
      * @param th the throwable object that describes the errror
@@ -178,10 +184,11 @@ public class JErrorPane extends JPanel i
     }
 
     public JDialog createDialog(Component owner, String title) {
-        JDialog dialog  =
+        JDialog dialog =
             new JDialog(JOptionPane.getFrameForComponent(owner), title);
         dialog.getContentPane().add(this, BorderLayout.CENTER);
         dialog.pack();
+        dialog.getRootPane().setDefaultButton(okButton);
         return dialog;
     }
 
@@ -191,7 +198,7 @@ public class JErrorPane extends JPanel i
         showDetailButton = bf.createJButton("ShowDetailButton");
         panel.add(showDetailButton);
 
-        JButton okButton = bf.createJButton("OKButton");
+        okButton = bf.createJButton("OKButton");
         panel.add(okButton);
 
         return panel;