how do i change the background to a custom one.
code

    JButton button = new JButton();
    JButton quit = new JButton();

    public Mainmenu() {

        Icon b = new ImageIcon(getClass().getResource("play.jpg"));
        play = new JButton(playb);
        add(button,BorderLayout.CENTER);

        Icon quitb = new ImageIcon(getClass().getResource("quit.jpg"));
        quit = new JButton(quitb);
        add(quit,BorderLayout.SOUTH);

        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {


            }
        });
        quit.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                dispose();

            }
        });

    }

Recommended Answers

Change the background of what? Please give more detail of your requirement.

Jump to Post

All 3 Replies

Change the background of what? Please give more detail of your requirement.

of the screen

Thyat's an OS function. In windows right click the desktop and select "personalise".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.