- setFocusable(false);
- setContentAreaFilled(false);
- setBorderPainted(false);
RadialGradientPaint p = new RadialGradientPaint(new Point2D.Double( getWidth() / 2.0, getHeight() * 1.5), getWidth() / 2.3f, new Point2D.Double(getWidth() / 2.0, getHeight() * 1.75 + 6), new float[] { 0.0f, 0.8f }, new Color[] { destelloinicial,destellofinal}, RadialGradientPaint.CycleMethod.NO_CYCLE, RadialGradientPaint.ColorSpaceType.SRGB, AffineTransform.getScaleInstance(1.0, 0.5));
Graphics2D g2d = (Graphics2D) g.create(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); int h = getHeight(); int height = getHeight(); ButtonModel modelo = getModel(); GradientPaint reflejo_superior = null; GradientPaint fondo_boton = null; /********************************/ reflejo_superior = new GradientPaint(0, 0, new Color(255, 255, 255),0, height / 2, new Color(120, 137, 145, 20)); /********************************/ fondo_boton = new GradientPaint(0, h / 2, getBackgroundTop(), 0, h, getBackgroundBotton()); setForeground(Color.WHITE); if(modelo.isPressed()) { /**SI EL BUTON FUE PRESIONADO*/ fondo_boton = new GradientPaint(0, h / 2, getBackgroundTop(), 0, h, getBackgroundBotton()); }else if(modelo.isRollover()) { /*****SI PASA POR ENCIMA*****/ fondo_boton = new GradientPaint(0, h / 2, getBackgroundTopHover(), 0, h, getBackgroundBottonHover()); } /*************************/ g2d.setPaint(fondo_boton); g2d.fillOval(0, 0, getWidth(), getHeight()); /**********REFLEJO SUPERIOR*************/ g2d.setPaint(reflejo_superior); g2d.fillOval(getWidth() / 3, 6, getWidth() / 3, getHeight() / 6); /*********DESTELLO*****************/ RadialGradientPaint p = new RadialGradientPaint(new Point2D.Double(getWidth() / 2.0, getHeight() * 1.5), getWidth() / 2.3f, new Point2D.Double(getWidth() / 2.0, getHeight() * 1.75 + 6), new float[] { 0.0f, 0.8f }, new Color[] { destelloinicial,destellofinal}, RadialGradientPaint.CycleMethod.NO_CYCLE, RadialGradientPaint.ColorSpaceType.SRGB, AffineTransform.getScaleInstance(1.0, 0.5)); g2d.setPaint(p); g2d.fillOval(0, 0, getWidth() - 1, getHeight() - 1);
les dejo el código fuente completo con métodos para cambiar el color de las esferas.
Mortgage Moda y Diseño Forex Trading Mesothelioma Law Firm Conference Call Abogados Structures Annuity Settlement Insurance Bufete de Abogados banks Claim Credit Lawyer Web Hosting and Domains Loans Health Software lawyers Donate Car to Charity California Fotografía digital Degree Condominiums loans Attomey Cord Blood Salud Donate Recovery Rehab hosting Seguro de coche Cotizaciones Colorado Classes Politics Online games Hosting Hosting gratuito Servicios duro de recuperación de la unidad de datos Juegos online Business Cooking Recipes Trading Hoteles Registro de Dominios baratos Hosting Laws and lawyers Transfer Gas/Electricity Curso de inglés básico Treatment Cómo hacer dinero en línea Web Hosting y Dominios
No hay comentarios:
Publicar un comentario