私が使用しているコードは次のとおりです。
JMenu menu = new JMenu("Menu");
JMenuItem item = new JMenuItem("Add");
item.add(new JButton("SOMETHING A BIT WORDY"));
menu.add(item);
// ...
JMenuBar menuBar = new JMenuBar();
menuBar.addMenu(menu);
JFrame frame = new JFrame();
frame.setJMenuBar(menuBar);
// ...
frame.pack();
frame.setVisible();
ただし、ボタン (メニュー項目の内側) は小さく表示され、ボタンのサイズが意図したテキストに収まらない場合に使用されるテキスト "..." のみが含まれます。JButton (または JTextArea、JLabel、またはコンポーネントが何であれ) に合わせて JMenuItem を「成長」させる方法はありますか?