This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: make Component return a default font


Hello,

I committed this patch as obvious.  Sun's Component.getFont returns a
default font object if no font has been explicitly set.

Tom

2004-02-05  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* java/awt/Component.java (getFont): Return a default font
	instead of null.


Index: java/awt/Component.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Component.java,v
retrieving revision 1.35
diff -u -r1.35 Component.java
--- java/awt/Component.java     3 Feb 2004 17:10:51 -0000       1.35
+++ java/awt/Component.java     5 Feb 2004 23:20:32 -0000
@@ -1001,7 +1001,11 @@
   {
     if (font != null)
       return font;
-    return parent == null ? null : parent.getFont();
+
+    if (parent != null)
+      return parent.getFont ();
+    else
+      return new Font ("Fixed", Font.PLAIN, 12);
   }
 
   /**




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]