Exemplo n.º 1
0
 public void propertyChange(PropertyChangeEvent evt) {
   String name = evt.getPropertyName();
   if (name.equals(VERTICAL_POSITION)
       || name.equals(HORIZONTAL_POSITION)
       || name.equals(SHAPE)
       || name.equals("JButton.segmentPosition")) { // see Apple Tech Note 2196
     AbstractButton button = (AbstractButton) evt.getSource();
     ButtonUI ui = button.getUI();
     if (ui instanceof FilledButtonUI) {
       FilledButtonUI s = (FilledButtonUI) ui;
       s.updateLayout(button, getButtonInfo(button));
       button.invalidate();
       button.repaint();
     }
   }
 }
Exemplo n.º 2
0
 public void componentResized(ComponentEvent e) {
   AbstractButton button = (AbstractButton) e.getSource();
   ButtonInfo info = getButtonInfo(button);
   info.ui.updateLayout(button, info);
   button.repaint();
 }