1 18 package org.apache.batik.util.gui.resource; 19 20 import java.awt.Insets ; 21 import java.awt.event.MouseAdapter ; 22 import java.awt.event.MouseEvent ; 23 24 import javax.swing.JButton ; 25 26 32 public class JToolbarButton extends JButton { 33 36 public JToolbarButton() { 37 initialize(); 38 } 39 40 44 public JToolbarButton(String txt) { 45 super(txt); 46 initialize(); 47 } 48 49 52 protected void initialize() { 53 setBorderPainted(false); 54 setMargin(new Insets (0, 1, 0, 1)); 55 addMouseListener(new MouseListener()); 56 } 57 58 61 protected class MouseListener extends MouseAdapter { 62 public void mouseEntered(MouseEvent ev) { 63 setBorderPainted(true); 64 } 65 public void mouseExited(MouseEvent ev) { 66 setBorderPainted(false); 67 } 68 } 69 } 70 | Popular Tags |