solvePanel.add(solveButton, "solveAction"); solvePanel.add(terminateSolvingEarlyButton, "terminateSolvingEarlyAction"); solveButton.setMinimumSize(terminateSolvingEarlyButton.getMinimumSize()); solveButton.setPreferredSize(terminateSolvingEarlyButton.getPreferredSize());
@Override public Dimension getMinimumSize() { if (isMinimumSizeSet()) { return super.getMinimumSize(); } return calculatePreferredSize(); }
bok.setMinimumSize(bcancel.getMinimumSize()); bok.setPreferredSize(bcancel.getPreferredSize()); ps.add(bcancel, new GridBagConstraints(1,0,1,1,0,0,GridBagConstraints.SOUTHEAST, GridBagConstraints.BOTH, new Insets(2,2,2,2), 0, 0));
buttonMinSize = leftButton.getMinimumSize();
Dimension md = cancel.getMinimumSize(); Dimension pd = cancel.getPreferredSize(); ok.setMinimumSize(md);
buttonMinSize = leftButton.getMinimumSize();
private void updateView(JFileChooser chooser) { if (chooser.getApproveButtonText() != null) { approveButton.setText(chooser.getApproveButtonText()); approveButton.setMnemonic(chooser.getApproveButtonMnemonic()); } else { if (JFileChooser.OPEN_DIALOG == chooser.getDialogType()) { approveButton.setText(openButtonText); approveButton.setToolTipText(openButtonToolTipText); approveButton.setMnemonic(openButtonMnemonic); } else { approveButton.setText(saveButtonText); approveButton.setToolTipText(saveButtonToolTipText); approveButton.setMnemonic(saveButtonMnemonic); } } cancelButton.setText(cancelButtonText); cancelButton.setMnemonic(cancelButtonMnemonic); newFolderButton.setText(newFolderText); newFolderButton.setToolTipText(newFolderToolTipText); newFolderButton.setVisible(((JDirectoryChooser)chooser).isShowingCreateDirectory()); buttonPanel.setVisible(chooser.getControlButtonsAreShown()); // ensure approve/cancel buttons have the same width approveButton.setPreferredSize(null); cancelButton.setPreferredSize(null); Dimension preferredSize = approveButton.getMinimumSize(); preferredSize = new Dimension(Math.max(preferredSize.width, cancelButton .getPreferredSize().width), preferredSize.height); approveButton.setPreferredSize(preferredSize); cancelButton.setPreferredSize(preferredSize); }
public void doLayout() { Insets ins = getInsets(); Dimension bttn = btn.getMinimumSize(); Dimension lbll = lbl.getPreferredSize(); int height = Math.max (bttn.height, lbll.height); int right = getWidth() - (ins.right + bttn.width); btn.setBounds (right, ins.top, bttn.width, height); lbl.setBounds (ins.left, ins.top, right, height); jsc.setBounds (ins.left, height, getWidth() - (ins.left + ins.right), getHeight() - height); }
public void doLayout() { Insets ins = getInsets(); Dimension bttn = btn.getMinimumSize(); Dimension lbll = lbl.getPreferredSize(); int height = Math.max (bttn.height, lbll.height); int right = getWidth() - (ins.right + bttn.width); btn.setBounds (right, ins.top, bttn.width, height); lbl.setBounds (ins.left, ins.top, right, height); jsc.setBounds (ins.left, height, getWidth() - (ins.left + ins.right), getHeight() - height); }
button.getMinimumSize().height));
button.getMinimumSize().height));
button.getMinimumSize().height));
button.getMinimumSize().height));
button.getMinimumSize().height));
button.getMinimumSize().height));
button.getMinimumSize().height));
button.getMinimumSize().height));
button.getMinimumSize().height));
button.getMinimumSize().height));
button.getMinimumSize().height));