KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > memoire > vainstall > xui > XuiButton


1
2 package com.memoire.vainstall.xui;
3
4 import java.awt.*;
5 import javax.swing.*;
6 import javax.swing.border.*;
7
8 public class XuiButton extends JButton
9 {
10   public XuiButton(String JavaDoc _text)
11   {
12     super(_text);
13     setForeground(Color.white);
14     setFont(new Font("SansSerif",Font.PLAIN,12));
15     setBorder(new XuiButtonBorder());
16     setPreferredSize(new Dimension(100,30));
17     setOpaque(false);
18     setContentAreaFilled(false);
19     setFocusPainted(false);
20   }
21
22   public void paint(Graphics _g)
23   {
24     ((Graphics2D)_g).setRenderingHint
25       (RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
26     super.paint(_g);
27   }
28 }
29
Popular Tags