Hallo,
ich habe ein Problem mit den JButtons und Icons.
Ich habe JButtons zum Panel hinzugefügt, allerdings werden anstatt der Icons auf dem Button nur ca. 5x5px grosse Buttons ohne Icon angezeigt...
ich habe ein Problem mit den JButtons und Icons.
Ich habe JButtons zum Panel hinzugefügt, allerdings werden anstatt der Icons auf dem Button nur ca. 5x5px grosse Buttons ohne Icon angezeigt...
Java:
public class MainPanel extends JPanel {
private JPanel menuPanel, overviewPanel, contentPanel, statusPanel;
private JButton openButton, newButton, saveButton, printButton, debugButton;
public MainPanel() {
super(new BorderLayout());
add(createMenuPanel(), BorderLayout.NORTH);
add(createOverviewPanel(), BorderLayout.WEST);
add(createContentPanel(), BorderLayout.CENTER);
add(createStatusPanel(), BorderLayout.SOUTH);
}
//Menü
private JPanel createMenuPanel() {
menuPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5));
newButton = new JButton(new ImageIcon("resources/newIcon.png"));
menuPanel.add(newButton);
openButton = new JButton(new ImageIcon("resources/openIcon.png"));
menuPanel.add(openButton);
saveButton = new JButton(new ImageIcon("resources/saveIcon.png"));
menuPanel.add(saveButton);
printButton = new JButton(new ImageIcon("resources/printIcon.png"));
menuPanel.add(printButton);
debugButton = new JButton(new ImageIcon("resources/debugIcon.png"));
menuPanel.add(debugButton);
return menuPanel;
}