< prev index next >

src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/Gradient.java

Print this page

        

@@ -1,8 +1,8 @@
 /*
  *
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *

@@ -91,25 +91,25 @@
                 "GradientPaint", g2.getFont(), g2.getFontRenderContext());
         tl.draw(g2, (int) (w / 2 - tl.getBounds().getWidth() / 2),
                 (int) (h / 2 + tl.getBounds().getHeight() / 2));
     }
 
-    public static void main(String s[]) {
+    public static void main(String[] s) {
         createDemoFrame(new Gradient());
     }
 
 
     static class DemoControls extends CustomControls implements ActionListener {
 
         Gradient demo;
-        Color colors[] = { red, orange, yellow, green, blue, lightGray, cyan,
+        Color[] colors = { red, orange, yellow, green, blue, lightGray, cyan,
             magenta };
-        String colorName[] = { "Red", "Orange", "Yellow", "Green",
+        String[] colorName = { "Red", "Orange", "Yellow", "Green",
             "Blue", "lightGray", "Cyan", "Magenta" };
-        JMenuItem innerMI[] = new JMenuItem[colors.length];
-        JMenuItem outerMI[] = new JMenuItem[colors.length];
-        ColoredSquare squares[] = new ColoredSquare[colors.length];
+        JMenuItem[] innerMI = new JMenuItem[colors.length];
+        JMenuItem[] outerMI = new JMenuItem[colors.length];
+        ColoredSquare[] squares = new ColoredSquare[colors.length];
         JMenu imenu, omenu;
 
         @SuppressWarnings("LeakingThisInConstructor")
         public DemoControls(Gradient demo) {
             super(demo.name);
< prev index next >