public MainDialog() throws HeadlessException { super("Jenkins slave agent"); ImageIcon background = new ImageIcon(getClass().getResource("title.png")); JPanel foregroundPanel = new JPanel(new BorderLayout(10, 10)); foregroundPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); foregroundPanel.setOpaque(false); statusLabel = new JLabel("", JLabel.TRAILING); foregroundPanel.add(statusLabel, BorderLayout.CENTER); setContentPane( GUI.wrapInBackgroundImage(foregroundPanel, background, JLabel.BOTTOM, JLabel.LEADING)); resetMenuBar(); pack(); setSize(new Dimension(250, 150)); getContentPane().setBackground(Color.WHITE); setLocationByPlatform(true); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); }