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(); } }
@Override public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); int w = button.isVisible() ? 80 - button.getPreferredSize().width : 80; return new Dimension(w, dim.height); }
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()); }