public void setPlayerControlsVisible(boolean b) {
   boolean oldValue = forwardButton.isVisible();
   if (oldValue != b) {
     forwardButton.setVisible(b);
     rewindButton.setVisible(b);
     startButton.setVisible(b);
     slider.setVisible(b);
     spacer.setVisible(!b);
     revalidate();
   }
 }
示例#2
0
 @Override
 public Dimension getPreferredSize() {
   Dimension dim = super.getPreferredSize();
   int w = button.isVisible() ? 80 - button.getPreferredSize().width : 80;
   return new Dimension(w, dim.height);
 }
示例#3
0
 private void printInfo(String str) {
   System.out.println("JButton: " + str);
   System.out.println("  isDisplayable:" + button.isDisplayable());
   System.out.println("  isShowing:" + button.isShowing());
   System.out.println("  isVisible:" + button.isVisible());
 }