Hello
I want to set the size of a JButton to be the same as another JButton. Both these buttons are on the same JToolBar.
I use the following:
But for some reason the second button doesn't get the same size as the first. It is just as big as it needs to be (Smaller).
Any ideas would be appreciated.
Thanks in advance.
I want to set the size of a JButton to be the same as another JButton. Both these buttons are on the same JToolBar.
I use the following:
Code:
private JToolBar createToolBar()
{
JToolBar m_toolbar = new JToolBar();
JButton rButton = new JButton(refreshAct);
JButton pButton = new JButton(printAct);
m_toolbar.add(rButton);
// Why isn't this working to set pButton the same size
// as rButton?
pButton.setPrefferedSize(rButton.getPreferredSize());
m_toolbar.add(pButton);
return m_toolBar;
}
But for some reason the second button doesn't get the same size as the first. It is just as big as it needs to be (Smaller).
Any ideas would be appreciated.
Thanks in advance.