303304305306307308309310
private class ToggleListener implements ItemListener { public void itemStateChanged(ItemEvent e) { if(e.getStateChange()!=ItemEvent.SELECTED && e.getStateChange()!=ItemEvent.DESELECTED) return; Button button = (Button)e.getSource(); updateTooltip(button); }
505152535455565758596061
Component[] c = titlebar.getComponents(); for (int i = 0; i < c.length; i++) { if (!(c[i] instanceof Button)) continue; Button b = (Button) c[i]; buttonWidth = b.getHeight(); break; } int paintY = (getButtonMargin() + buttonWidth) * 2; paintY += 5;
233234235236237238239240241
private void reconfigureActions(JComponent c) { Component[] c1 = c.getComponents(); for (int i = 0; i < c1.length; i++) { if (!(c1[i] instanceof Button)) continue; Button b = (Button) c1[i]; configureAction(b.getAction()); } }