Java - ¿como hago para ponerle una imagen de fondo al menu?

 
Vista:
Imágen de perfil de juan
Val: 16
Ha aumentado su posición en 2 puestos en Java (en relación al último mes)
Gráfica de Java

¿como hago para ponerle una imagen de fondo al menu?

Publicado por juan (13 intervenciones) el 11/05/2019 08:41:54
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package juego;
import javax.swing.*;
import java.awt.event.*;
public class menu extends JFrame implements ActionListener {
	private static final long serialVersionUID = 1L;
	JButton boton1;
    JButton boton2;
    JButton boton3;
    JButton boton4;
 
    public menu() {
        setLayout(null);
        setResizable(false);
 
 
 
        boton1=new JButton("JUGAR");
        boton2=new JButton("OPCIONES");
        boton3=new JButton("CREDITOS");
        boton4=new JButton("SALIR");
 
 
        boton1.setBounds(500,300,100,30);
        add(boton1);
        boton1.addActionListener(this);
 
        boton2.setBounds(500,350,100,30);
        add(boton2);
        boton2.addActionListener(this);
 
        boton3.setBounds(500,400,100,30);
        add(boton3);
        boton3.addActionListener(this);
 
        boton4.setBounds(500,450,100,30);
        add(boton4);
        boton4.addActionListener(this);
    }
 
 
    public void actionPerformed(ActionEvent e) {
        if (e.getSource()==boton4) {
            System.exit(getDefaultCloseOperation());
        }
 
    }
 
    public static void main(String[] ar) {
        menu formulario1=new menu();
 
        formulario1.setBounds(0,0,800,600);
        formulario1.setVisible(true);
 
 
    }
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder