JMenuBar
을 Mac OS X의 화면 메뉴 막대로 옮길 때 메뉴에 내 공간이있는 빈 공간이 남습니다. 그 공간을 제거해야합니다. 사용하고 있습니다JMenuBar를 Mac OS X의 화면 메뉴 막대로 어떻게 이동합니까?
System.setProperty("apple.laf.useScreenMenuBar", "true")
JMenuBar
을 화면 메뉴 모음으로 이동하려면 Mac을 사용하는 제 친구는이 속성을 설정하지 않으면 메뉴가 상주 할 수있는 약간의 세로 공간을 남겨 둡니다. 이 문제를 해결하는 가장 좋은 방법은 무엇입니까?
편집 :
public static void main(String[] args) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Name");
JFrame frame = new JFrame("Gabby");
final DesktopMain dm = new DesktopMain();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(dm);
frame.setSize(160, 144);
frame.setLocationRelativeTo(null);
frame.setIgnoreRepaint(true);
JMenuBar menuBar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
menuBar.add(fileMenu);
// Populating the menu bar code goes here
frame.setJMenuBar(menuBar);
frame.setVisible(true);
}
당신이 게시 할 수있는 코드를? 일반적으로 모든 방을 사용하도록 레이아웃이 자동으로 조정됩니다. – Eelke